fix(Core/Spells): Restrict percent stat aura target (#26198)
Co-authored-by: QAston <qaston@gmail.com>
This commit is contained in:
committed by
GitHub
parent
72fbcd35d7
commit
98e7a05caa
@@ -4246,15 +4246,18 @@ void AuraEffect::HandleModPercentStat(AuraApplication const* aurApp, uint8 mode,
|
|||||||
|
|
||||||
for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
||||||
{
|
{
|
||||||
if (apply)
|
if (GetMiscValue() == i || GetMiscValue() == -1)
|
||||||
target->ApplyStatPctModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(GetAmount()));
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_PERCENT_STAT, [i](AuraEffect const* aurEff)
|
if (apply)
|
||||||
|
target->ApplyStatPctModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(GetAmount()));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return (aurEff->GetMiscValue() == i || aurEff->GetMiscValue() == -1);
|
float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_PERCENT_STAT, [i](AuraEffect const* aurEff)
|
||||||
});
|
{
|
||||||
target->SetStatPctModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, amount);
|
return (aurEff->GetMiscValue() == i || aurEff->GetMiscValue() == -1);
|
||||||
|
});
|
||||||
|
target->SetStatPctModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, amount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user