diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuras.cpp | 6 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 5 | ||||
-rw-r--r-- | src/game/Unit.cpp | 24 |
3 files changed, 16 insertions, 19 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 18abbd4c2e8..c0c64bd8181 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1145,7 +1145,7 @@ void Aura::_RemoveAura() } uint32 id = GetId(); // Remove Linked Auras - if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_REMOVE) + if(m_removeMode!=AURA_REMOVE_BY_STACK && m_removeMode!=AURA_REMOVE_BY_DEATH && spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_REMOVE) { if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)id)) for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) @@ -1153,11 +1153,11 @@ void Aura::_RemoveAura() if(*itr < 0) m_target->RemoveAurasDueToSpell(-(*itr)); else if(Unit* caster = GetCaster()) - if (m_removeMode!=AURA_REMOVE_BY_DEFAULT && m_removeMode!=AURA_REMOVE_BY_DEATH) + if (m_removeMode!=AURA_REMOVE_BY_DEFAULT) m_target->CastSpell(m_target, *itr, true, 0, 0, caster->GetGUID()); } } - if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA) + if(m_removeMode!=AURA_REMOVE_BY_STACK && m_removeMode!=AURA_REMOVE_BY_DEATH && spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA) { if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA)) for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 2737cbef54b..053617bd965 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2641,6 +2641,11 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool spellId_2 = GetLastSpellInChain(spellId_2); spellId_1 = GetLastSpellInChain(spellId_1); + + // Hack for Incanter's Absorption + if (spellId_1 == spellId_2 && spellId_1 == 44413) + return false; + if (spellId_1 == spellId_2) return true; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 47bb7307a2b..609aef6df02 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3809,22 +3809,18 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects) SpellEntry const* aurSpellInfo = Aur->GetSpellProto(); - // passive and persistent auras can stack with themselves any number of times - if (!Aur->IsPassive() && !Aur->IsPersistent()) + // passive and persistent and Incanter's Absorption auras can stack with themselves any number of times + if (!Aur->IsPassive() && !Aur->IsPersistent() && aurSpellInfo->Id != 44413) { // find current aura from spell and change it's stackamount if (Aura * foundAura = GetAura(aurSpellInfo->Id, Aur->GetCasterGUID())) { - // hack for Incanter's Absorption - if (aurSpellInfo->Id != 44413) - { - if(aurSpellInfo->StackAmount && foundAura->GetStackAmount() < aurSpellInfo->StackAmount) - foundAura->SetStackAmount(foundAura->GetStackAmount()+1); - else - foundAura->RefreshAura(); - delete Aur; - return false; - } + uint8 stackAmount = foundAura->GetStackAmount() + 1; + if (stackAmount > aurSpellInfo->StackAmount) + stackAmount = aurSpellInfo->StackAmount; + Aur->SetStackAmount(stackAmount); + RemoveAura(foundAura, AURA_REMOVE_BY_STACK); + return true; } } @@ -3915,10 +3911,6 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) 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)) { // passive non-stackable spells not stackable only for same caster |