fix(Core/Spells): Resistance auras should affect creatures. (#12946)
Fixes #12867
This commit is contained in:
@@ -3953,20 +3953,11 @@ void AuraEffect::HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, u
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Unit* target = aurApp->GetTarget();
|
Unit* target = aurApp->GetTarget();
|
||||||
|
for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
|
||||||
// only players have base stats
|
|
||||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
|
||||||
{
|
{
|
||||||
//pets only have base armor
|
if (GetMiscValue() & int32(1 << x))
|
||||||
if (target->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
|
||||||
target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(GetAmount()), apply);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
|
|
||||||
{
|
{
|
||||||
if (GetMiscValue() & int32(1 << x))
|
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(GetAmount()), apply);
|
||||||
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(GetAmount()), apply);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3998,16 +3989,11 @@ void AuraEffect::HandleModBaseResistance(AuraApplication const* aurApp, uint8 mo
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Unit* target = aurApp->GetTarget();
|
Unit* target = aurApp->GetTarget();
|
||||||
|
for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
|
||||||
// only players and pets have base stats
|
|
||||||
if (target->IsPlayer() || target->IsPet())
|
|
||||||
{
|
{
|
||||||
for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
|
if (GetMiscValue() & (1 << i))
|
||||||
{
|
{
|
||||||
if (GetMiscValue() & (1 << i))
|
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_VALUE, float(GetAmount()), apply);
|
||||||
{
|
|
||||||
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_VALUE, float(GetAmount()), apply);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user