*Allow lifebloom stack from 2 different casters.
--HG-- branch : trunk
This commit is contained in:
+37
-46
@@ -4154,59 +4154,50 @@ bool Unit::AddAura(Aura *Aur)
|
|||||||
SpellEntry const* aurSpellInfo = Aur->GetSpellProto();
|
SpellEntry const* aurSpellInfo = Aur->GetSpellProto();
|
||||||
|
|
||||||
spellEffectPair spair = spellEffectPair(Aur->GetId(), Aur->GetEffIndex());
|
spellEffectPair spair = spellEffectPair(Aur->GetId(), Aur->GetEffIndex());
|
||||||
AuraMap::iterator i = m_Auras.find( spair );
|
|
||||||
|
|
||||||
// take out same spell
|
// passive and persistent auras can stack with themselves any number of times
|
||||||
if (i != m_Auras.end())
|
if (!Aur->IsPassive() && !Aur->IsPersistent())
|
||||||
{
|
{
|
||||||
// passive and persistent auras can stack with themselves any number of times
|
// if StackAmount==0 not allow auras from same caster
|
||||||
if (!Aur->IsPassive() && !Aur->IsPersistent())
|
for(AuraMap::iterator i2 = m_Auras.lower_bound(spair); i2 != m_Auras.upper_bound(spair); ++i2)
|
||||||
{
|
{
|
||||||
// replace aura if next will > spell StackAmount
|
if(i2->second->GetCasterGUID()==Aur->GetCasterGUID())
|
||||||
if(aurSpellInfo->StackAmount)
|
|
||||||
{
|
{
|
||||||
Aur->SetStackAmount(i->second->GetStackAmount());
|
// replace aura if next will > spell StackAmount
|
||||||
if(Aur->GetStackAmount() < aurSpellInfo->StackAmount)
|
if(aurSpellInfo->StackAmount)
|
||||||
Aur->SetStackAmount(Aur->GetStackAmount()+1);
|
|
||||||
RemoveAura(i,AURA_REMOVE_BY_STACK);
|
|
||||||
}
|
|
||||||
// if StackAmount==0 not allow auras from same caster
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for(AuraMap::iterator i2 = m_Auras.lower_bound(spair); i2 != m_Auras.upper_bound(spair); ++i2)
|
|
||||||
{
|
{
|
||||||
if(i2->second->GetCasterGUID()==Aur->GetCasterGUID())
|
Aur->SetStackAmount(i2->second->GetStackAmount());
|
||||||
{
|
if(Aur->GetStackAmount() < aurSpellInfo->StackAmount)
|
||||||
// can be only single (this check done at _each_ aura add
|
Aur->SetStackAmount(Aur->GetStackAmount()+1);
|
||||||
RemoveAura(i2,AURA_REMOVE_BY_STACK);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool stop = false;
|
|
||||||
switch(aurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()])
|
|
||||||
{
|
|
||||||
// DoT/HoT/etc
|
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE: // allow stack
|
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
|
|
||||||
case SPELL_AURA_PERIODIC_LEECH:
|
|
||||||
case SPELL_AURA_PERIODIC_HEAL:
|
|
||||||
case SPELL_AURA_OBS_MOD_HEALTH:
|
|
||||||
case SPELL_AURA_PERIODIC_MANA_LEECH:
|
|
||||||
case SPELL_AURA_PERIODIC_ENERGIZE:
|
|
||||||
case SPELL_AURA_OBS_MOD_MANA:
|
|
||||||
case SPELL_AURA_POWER_BURN_MANA:
|
|
||||||
break;
|
|
||||||
default: // not allow
|
|
||||||
// can be only single (this check done at _each_ aura add
|
|
||||||
RemoveAura(i2,AURA_REMOVE_BY_STACK);
|
|
||||||
stop = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(stop)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
// can be only single (this check done at _each_ aura add
|
||||||
|
RemoveAura(i2,AURA_REMOVE_BY_STACK);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool stop = false;
|
||||||
|
switch(aurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()])
|
||||||
|
{
|
||||||
|
// DoT/HoT/etc
|
||||||
|
case SPELL_AURA_PERIODIC_DAMAGE: // allow stack
|
||||||
|
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
|
||||||
|
case SPELL_AURA_PERIODIC_LEECH:
|
||||||
|
case SPELL_AURA_PERIODIC_HEAL:
|
||||||
|
case SPELL_AURA_OBS_MOD_HEALTH:
|
||||||
|
case SPELL_AURA_PERIODIC_MANA_LEECH:
|
||||||
|
case SPELL_AURA_PERIODIC_ENERGIZE:
|
||||||
|
case SPELL_AURA_OBS_MOD_MANA:
|
||||||
|
case SPELL_AURA_POWER_BURN_MANA:
|
||||||
|
break;
|
||||||
|
default: // not allow
|
||||||
|
// can be only single (this check done at _each_ aura add
|
||||||
|
RemoveAura(i2,AURA_REMOVE_BY_STACK);
|
||||||
|
stop = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(stop)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user