Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Database/World Building

Archive::Database/World Building Archive area for General Discussion's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 12-22-2003, 08:32 PM
r2d2atemyhomework
Fire Beetle
 
Join Date: Dec 2003
Posts: 10
Default

Quote:
Originally Posted by Muuss
since you know sql code, you could just make a short fix by yourself (at least for your own use if you need it), of the kind :

update npc_types set maxdmg=9 where level=1;
update npc_types set maxdmg=14 where level=2;

...
I actually already did and things are running great now.

In mysql you can't do a subselect in an update when the subselect queries the table you are updating, so I had to break it in to two queries. The first grabs the average and the second updates the maxdmg. It will only update rows with maxdmg equal to 400. Obviously you will have to do this manually for each level or write a script/app to do it for you. Here's the SELECT query which gets the average, in this case for level 1:

Code:
select ROUND(AVG(maxdmg)) from npc_types where level = 1 and maxdmg <> 400;
Then take the average returned by the query above and set maxdmg to it. In this update, the average was 4 for level 1:

Code:
update npc_types set maxdmg = 4 where level = 1 and maxdmg = 400;
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:24 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3