*Allow lifebloom stack from 2 different casters.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-09 20:22:52 +01:00
parent 052caf335a
commit b47a282850
+7 -16
View File
@@ -4154,29 +4154,22 @@ bool Unit::AddAura(Aura *Aur)
SpellEntry const* aurSpellInfo = Aur->GetSpellProto();
spellEffectPair spair = spellEffectPair(Aur->GetId(), Aur->GetEffIndex());
AuraMap::iterator i = m_Auras.find( spair );
// take out same spell
if (i != m_Auras.end())
{
// passive and persistent auras can stack with themselves any number of times
if (!Aur->IsPassive() && !Aur->IsPersistent())
{
// replace aura if next will > spell StackAmount
if(aurSpellInfo->StackAmount)
{
Aur->SetStackAmount(i->second->GetStackAmount());
if(Aur->GetStackAmount() < 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())
{
// replace aura if next will > spell StackAmount
if(aurSpellInfo->StackAmount)
{
Aur->SetStackAmount(i2->second->GetStackAmount());
if(Aur->GetStackAmount() < aurSpellInfo->StackAmount)
Aur->SetStackAmount(Aur->GetStackAmount()+1);
}
// can be only single (this check done at _each_ aura add
RemoveAura(i2,AURA_REMOVE_BY_STACK);
break;
@@ -4207,8 +4200,6 @@ bool Unit::AddAura(Aura *Aur)
break;
}
}
}
}
// passive auras stack with all (except passive spell proc auras)
if ((!Aur->IsPassive() || !IsPassiveStackableSpell(Aur->GetId())) &&