[8011] Send energize packets in correct order to avoid strange client behaviour.

If you send SMSG_SPELLENERGIZELOG after SMSG_POWER_UPDATE client shows mana gain twice.

Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
nos4r2zod 2009-06-14 12:05:04 +02:00 committed by hunuza
parent dcba023261
commit 82d3e2ae7d
5 changed files with 13 additions and 10 deletions

View file

@ -7643,6 +7643,13 @@ void Unit::SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, Po
SendMessageToSet(&data, true);
}
void Unit::EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype)
{
SendEnergizeSpellLog(pVictim, SpellID, Damage, powertype);
// needs to be called after sending spell log
ModifyPower(powertype, Damage);
}
uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack)
{
if(!spellProto || !pVictim || damagetype==DIRECT_DAMAGE )