Core/Units: Aura´s of type SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE (143) should stack with eachother in the way that only the strongest aura of each magical school applies.

Author: Iskander
Fixes issue #3897

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-12-17 20:31:46 +01:00
parent 97f912fe93
commit 32d94ed52a
3 changed files with 10 additions and 6 deletions
@@ -4550,9 +4550,13 @@ void AuraEffect::HandleAuraModResistanceExclusive(AuraApplication const * aurApp
{
if (GetMiscValue() & int32(1<<x))
{
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(GetAmount()), apply);
if (target->GetTypeId() == TYPEID_PLAYER)
target->ApplyResistanceBuffModsMod(SpellSchools(x),aurApp->IsPositive(),(float)GetAmount(), apply);
int32 amount = target->GetMaxPositiveAuraModifierByMiscMask(SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE, 1<<x, this);
if (amount < GetAmount())
{
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(GetAmount() - amount), apply);
if (target->GetTypeId() == TYPEID_PLAYER)
target->ApplyResistanceBuffModsMod(SpellSchools(x), aurApp->IsPositive(), float(GetAmount() - amount), apply);
}
}
}
}