[8406] Detect/check stacking of food/drink/elental shileds as spell specifics.

Food/Drink checks base at nos4r2zod's patch code.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
VladimirMangos 2009-08-23 03:28:03 +04:00
parent 178c308c5b
commit f3930cb06f
4 changed files with 75 additions and 17 deletions

View file

@ -3631,9 +3631,8 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
SpellSpecific i_spellId_spec = GetSpellSpecific(i_spellId);
// single allowed spell specific from same caster
bool is_sspc = IsSingleFromSpellSpecificPerCaster(spellId_spec,i_spellId_spec);
bool is_sspt = IsSingleFromSpellSpecificRanksPerTarget(spellId_spec,i_spellId_spec);
if( is_sspc && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
{
// cannot remove higher rank
@ -3653,8 +3652,15 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
break;
else
next = m_Auras.begin();
continue;
}
else if( is_sspt && Aur->GetCasterGUID() != (*i).second->GetCasterGUID() && spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId) )
// spell with spell specific that allow single ranks for spell from diff caster
// same caster case processed or early or later
bool is_sspt = IsSingleFromSpellSpecificRanksPerTarget(spellId_spec,i_spellId_spec);
if ( is_sspt && Aur->GetCasterGUID() != (*i).second->GetCasterGUID() &&
(spellProto->Id == i_spellId || spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId)))
{
// cannot remove higher rank
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
@ -3672,8 +3678,12 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
break;
else
next = m_Auras.begin();
continue;
}
else if( !is_sspc && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
// non single per caster spell specific (possible single per target spells at caster)
if( !is_sspc && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
{
// Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse())
@ -3687,9 +3697,12 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
break;
else
next = m_Auras.begin();
continue;
}
// Potions stack aura by aura (elixirs/flask already checked)
else if( spellProto->SpellFamilyName == SPELLFAMILY_POTION && i_spellProto->SpellFamilyName == SPELLFAMILY_POTION )
if( spellProto->SpellFamilyName == SPELLFAMILY_POTION && i_spellProto->SpellFamilyName == SPELLFAMILY_POTION )
{
if (IsNoStackAuraDueToAura(spellId, effIndex, i_spellId, i_effIndex))
{