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:
@@ -4680,14 +4680,14 @@ float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
|
||||
int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except) const
|
||||
{
|
||||
int32 modifier = 0;
|
||||
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetMiscValue()& misc_mask && (*i)->GetAmount() > modifier)
|
||||
if (except != (*i) && (*i)->GetMiscValue()& misc_mask && (*i)->GetAmount() > modifier)
|
||||
modifier = (*i)->GetAmount();
|
||||
}
|
||||
|
||||
|
||||
@@ -1652,7 +1652,7 @@ class Unit : public WorldObject
|
||||
|
||||
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = NULL) const;
|
||||
int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
|
||||
int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
|
||||
|
||||
@@ -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);
|
||||
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(), apply);
|
||||
target->ApplyResistanceBuffModsMod(SpellSchools(x), aurApp->IsPositive(), float(GetAmount() - amount), apply);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user