mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-17 13:29:41 -04:00
*always remove old aura instead of recalculating new one in same id stack case-this prevents some problem with spelleffects execution problems
--HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+8
-16
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user