mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 10:37:01 +00:00
[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:
parent
77e612cbf7
commit
0bc4bc1d75
8 changed files with 62 additions and 102 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue