*Do not remove/add aura for refreshing case.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-21 14:54:22 -05:00
parent 1403419164
commit 32064b79da
2 changed files with 20 additions and 25 deletions
-4
View File
@@ -2639,10 +2639,6 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
} }
} }
// hack for Incanter's Absorption
if (spellInfo_1->Id==44413 && spellInfo_2->Id==44413)
return false;
spellId_2 = GetLastSpellInChain(spellId_2); spellId_2 = GetLastSpellInChain(spellId_2);
spellId_1 = GetLastSpellInChain(spellId_1); spellId_1 = GetLastSpellInChain(spellId_1);
if (spellId_1 == spellId_2) if (spellId_1 == spellId_2)
+15 -16
View File
@@ -3810,12 +3810,15 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects)
SpellEntry const* aurSpellInfo = Aur->GetSpellProto(); SpellEntry const* aurSpellInfo = Aur->GetSpellProto();
// passive and persistent auras can stack with themselves any number of times // passive and persistent auras can stack with themselves any number of times
if (!Aur->IsPassive() && !Aur->IsPersistent() && aurSpellInfo->StackAmount>1) if (!Aur->IsPassive() && !Aur->IsPersistent())
{ {
// find current aura from spell and change it's stackamount // find current aura from spell and change it's stackamount
if (Aura * foundAura = GetAura(aurSpellInfo->Id,Aur->GetCasterGUID())) if (Aura * foundAura = GetAura(aurSpellInfo->Id, Aur->GetCasterGUID()))
{ {
if(foundAura->GetStackAmount() < aurSpellInfo->StackAmount) // hack for Incanter's Absorption
if (aurSpellInfo->Id != 44413)
{
if(aurSpellInfo->StackAmount && foundAura->GetStackAmount() < aurSpellInfo->StackAmount)
foundAura->SetStackAmount(foundAura->GetStackAmount()+1); foundAura->SetStackAmount(foundAura->GetStackAmount()+1);
else else
foundAura->RefreshAura(); foundAura->RefreshAura();
@@ -3823,6 +3826,7 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects)
return false; return false;
} }
} }
}
// passive auras not stacable with other ranks // passive auras not stacable with other ranks
if (!RemoveNoStackAurasDueToAura(Aur)) if (!RemoveNoStackAurasDueToAura(Aur))
@@ -3888,9 +3892,6 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects)
bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
{ {
if (!Aur)
return false;
SpellEntry const* spellProto = Aur->GetSpellProto(); SpellEntry const* spellProto = Aur->GetSpellProto();
uint32 spellId = Aur->GetId(); uint32 spellId = Aur->GetId();
@@ -3906,20 +3907,20 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
//bool linked = spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_LINK_AURA? true : false; //bool linked = spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_LINK_AURA? true : false;
AuraMap::iterator i,next; for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
for (i = m_Auras.begin(); i != m_Auras.end(); i = next)
{ {
next = i; SpellEntry const* i_spellProto = i->second->GetSpellProto();
++next;
SpellEntry const* i_spellProto = (*i).second->GetSpellProto();
uint32 i_spellId = i_spellProto->Id; uint32 i_spellId = i_spellProto->Id;
bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID();
// Incanter's Absorption, has been checked in refresh part
if(i_spellId == spellId && sameCaster)
continue;
if(IsPassiveSpell(i_spellId)) if(IsPassiveSpell(i_spellId))
{ {
// passive non-stackable spells not stackable only for same caster // passive non-stackable spells not stackable only for same caster
if(Aur->GetCasterGUID()!=i->second->GetCasterGUID()) if(!sameCaster)
continue; continue;
// passive non-stackable spells not stackable only with another rank of same spell // passive non-stackable spells not stackable only with another rank of same spell
@@ -3934,7 +3935,6 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
is_triggered_by_spell = true; is_triggered_by_spell = true;
// check if they can stack // check if they can stack
bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID();
/*// Dont remove by stack with linked auras /*// Dont remove by stack with linked auras
// Not needed for now // Not needed for now
@@ -3965,7 +3965,6 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
// Remove all auras by aura caster // Remove all auras by aura caster
RemoveAura(i, AURA_REMOVE_BY_STACK); RemoveAura(i, AURA_REMOVE_BY_STACK);
next=i;
} }
return true; return true;
} }