mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[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:
parent
dcba023261
commit
82d3e2ae7d
5 changed files with 13 additions and 10 deletions
|
|
@ -1447,8 +1447,7 @@ void Aura::TriggerSpell()
|
||||||
if (mana)
|
if (mana)
|
||||||
{
|
{
|
||||||
mana /= 10;
|
mana /= 10;
|
||||||
caster->ModifyPower( POWER_MANA, mana );
|
caster->EnergizeBySpell(caster, 23493, mana, POWER_MANA);
|
||||||
caster->SendEnergizeSpellLog(caster, 23493, mana, POWER_MANA);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2369,9 +2369,7 @@ void Spell::EffectPowerDrain(uint32 i)
|
||||||
|
|
||||||
int32 gain = int32(new_damage * manaMultiplier);
|
int32 gain = int32(new_damage * manaMultiplier);
|
||||||
|
|
||||||
m_caster->ModifyPower(POWER_MANA,gain);
|
m_caster->EnergizeBySpell(m_caster, m_spellInfo->Id, gain, POWER_MANA);
|
||||||
//send log
|
|
||||||
m_caster->SendEnergizeSpellLog(m_caster, m_spellInfo->Id, gain, POWER_MANA);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2792,8 +2790,7 @@ void Spell::EffectEnergize(uint32 i)
|
||||||
if(unitTarget->GetMaxPower(power) == 0)
|
if(unitTarget->GetMaxPower(power) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unitTarget->ModifyPower(power,damage);
|
m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, damage, power);
|
||||||
m_caster->SendEnergizeSpellLog(unitTarget, m_spellInfo->Id, damage, power);
|
|
||||||
|
|
||||||
// Mad Alchemist's Potion
|
// Mad Alchemist's Potion
|
||||||
if (m_spellInfo->Id == 45051)
|
if (m_spellInfo->Id == 45051)
|
||||||
|
|
@ -2855,8 +2852,7 @@ void Spell::EffectEnergisePct(uint32 i)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 gain = damage * maxPower / 100;
|
uint32 gain = damage * maxPower / 100;
|
||||||
unitTarget->ModifyPower(power, gain);
|
m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, gain, power);
|
||||||
m_caster->SendEnergizeSpellLog(unitTarget, m_spellInfo->Id, gain, power);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::SendLoot(uint64 guid, LootType loottype)
|
void Spell::SendLoot(uint64 guid, LootType loottype)
|
||||||
|
|
|
||||||
|
|
@ -7643,6 +7643,13 @@ void Unit::SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, Po
|
||||||
SendMessageToSet(&data, true);
|
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)
|
uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack)
|
||||||
{
|
{
|
||||||
if(!spellProto || !pVictim || damagetype==DIRECT_DAMAGE )
|
if(!spellProto || !pVictim || damagetype==DIRECT_DAMAGE )
|
||||||
|
|
|
||||||
|
|
@ -1119,6 +1119,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
|
|
||||||
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, bool critical = false);
|
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, bool critical = false);
|
||||||
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
|
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
|
||||||
|
void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
|
||||||
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage);
|
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage);
|
||||||
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8010"
|
#define REVISION_NR "8011"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue