2011-03-22

Energy.... again

Ok, I've decided to face reality and now I'm implementing energy tracking "right".  Which means using the right events to perform energy updates.  After some testing with VERY weird results, it turns out that using SPELL_DAMAGE events doesn't cut it, and energy tracking must be done right, i.e. using SPELL_CAST_SUCCESS to substract energy and SPELL_MISSED for energy refunds.  SPELL_ENERGIZE to account for energy boosts was already done right.  It's interesting to see the weirdness of energy checking/usage which is done partly client-side (SPELL_CAST_SUCCESS is client-side timing) and partly server side (SPELL_ENERGIZE provides energy at spell execution on the server).  The result is for example that if you Mangle, the Mangle energy cost is subtracted immediately, while the energy return of Tiger's Fury is delayed by your lag.  I'm also adding in handling of Primal Madness and the related /cancelaura to correcly manage the 20 extra energy provided by the talent.

Overall, the new version will have a more reliable energy tracking (assuming the right values for haste are used), and also more reliable error indications.

No comments:

Post a Comment