Advertisement
Rochet2

Items set same DPS

Dec 15th, 2012
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.80 KB | None | 0 0
  1. /*
  2. Q: Is there any way to make it so all weapons have the same DPS?
  3.  
  4. What the hell does it do???
  5. It calculates a multiplier according to the formula found here: http://www.wowwiki.com/Damage_per_second
  6. Then it multiplies the min damage and max damage values with the said multiplier.
  7.  
  8. So I just used some basic math skills to screw around with the formula, until I got a formula that calculates .. stuff.
  9.  
  10.  
  11. So:
  12. It wont alter the speed or anything like that.
  13. It will alter the damage of the weapons, BUT it will preserve the range of damage.
  14.  
  15. * Made it into one query and added a DPS range check, so you can easily see if a lot of weapons are not exactly at the DPS you want.
  16. Also fixed some division by 0 errors that caused nulls to occur.
  17.  
  18. */
  19.  
  20. SET @DPS := 25.5; -- Put the desired DPS here
  21.  
  22. -- Update DPS
  23. UPDATE item_template_copy SET dmg_min1 = dmg_min1*((@DPS*2*delay)/(1000*(dmg_min1+dmg_max1+dmg_min2+dmg_max2))), dmg_max1 = dmg_max1*((@DPS*2*delay)/(1000*(dmg_min1+dmg_max1+dmg_min2+dmg_max2))), dmg_min2 = dmg_min2*((@DPS*2*delay)/(1000*(dmg_min1+dmg_max1+dmg_min2+dmg_max2))), dmg_max2 = dmg_max2*((@DPS*2*delay)/(1000*(dmg_min1+dmg_max1+dmg_min2+dmg_max2))) WHERE dmg_min1 >= 0 AND dmg_max1 >= 0 AND dmg_min2 >= 0 AND dmg_max2 >= 0 AND delay > 0 AND dmg_min1 <= dmg_max1 AND dmg_min2 <= dmg_max2 AND (dmg_min1+dmg_max1+dmg_min2+dmg_max2) > 0;
  24. -- See out of range DPS results: (range is @DPS+-1)
  25. SELECT entry, (((dmg_min1+dmg_max1+dmg_min2+dmg_max2)*1000) / (2*delay)) AS DPS FROM item_template_copy WHERE class = 2 AND dmg_min1 >= 0 AND dmg_max1 >= 0 AND dmg_min2 >= 0 AND dmg_max2 >= 0 AND delay > 0 AND dmg_min1 <= dmg_max1 AND dmg_min2 <= dmg_max2 AND (dmg_min1+dmg_max1+dmg_min2+dmg_max2) > 0 AND NOT (((dmg_min1+dmg_max1+dmg_min2+dmg_max2)*1000) / (2*delay)) BETWEEN @DPS-1 AND @DPS+1 ORDER BY DPS ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement