Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Q: Is there any way to make it so all weapons have the same DPS?
- What the hell does it do???
- It calculates a multiplier according to the formula found here: http://www.wowwiki.com/Damage_per_second
- Then it multiplies the min damage and max damage values with the said multiplier.
- So I just used some basic math skills to screw around with the formula, until I got a formula that calculates .. stuff.
- So:
- It wont alter the speed or anything like that.
- It will alter the damage of the weapons, BUT it will preserve the range of damage.
- * 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.
- Also fixed some division by 0 errors that caused nulls to occur.
- */
- SET @DPS := 25.5; -- Put the desired DPS here
- -- Update DPS
- 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;
- -- See out of range DPS results: (range is @DPS+-1)
- 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