[11282] Use uint32 datatype for aura charges and stacks

* Some spells have StackAmount > 255, for example 22735, 54314
* In SMSG_AURA_UPDATE maximum stack amount is limited by 255
* Move duplicate code into SpellAuraHolder::BuildUpdatePacket function
* Cleanup some weird type casts in _LoadAuras
This commit is contained in:
zergtmn 2011-03-25 14:40:09 +05:00
parent 77e612cbf7
commit 0bc4bc1d75
8 changed files with 62 additions and 102 deletions

View file

@ -2040,12 +2040,10 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
const uint32 spellShrink = 53805;
const uint32 spellTransf = 53806;
if (Aura* pAura = m_caster->GetAura(spellShrink, EFFECT_INDEX_0))
if (SpellAuraHolder* holder = m_caster->GetSpellAuraHolder(spellShrink))
{
uint32 stackNum = pAura->GetStackAmount();
// chance to become pygmified (5, 10, 15 etc)
if (roll_chance_i(stackNum*5))
if (roll_chance_i(holder->GetStackAmount() * 5))
{
m_caster->RemoveAurasDueToSpell(spellShrink);
m_caster->CastSpell(m_caster, spellTransf, true);
@ -2053,7 +2051,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
}
}
if (m_caster->HasAura(spellTransf, EFFECT_INDEX_0))
if (m_caster->HasAura(spellTransf))
return;
m_caster->CastSpell(m_caster, spellShrink, true);