aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShocker <shocker@freakz.ro>2011-11-26 22:53:37 +0200
committerShocker <shocker@freakz.ro>2011-11-26 22:53:37 +0200
commitbef006c5bf7269a69d06a62aa8235f48be5faaf9 (patch)
tree0774f20f718c659db1613e7e97776dff0a266f2b
parent8160e6e30392d946f29c6eccbcca1ff3bfadbdef (diff)
Core/Spells: Fix SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 9f1fd5b6de1..67938498a4b 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -3801,19 +3801,13 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8
Unit* target = aurApp->GetTarget();
- if (GetMiscValue() < -1 || GetMiscValue() > 4)
- {
- sLog->outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
- return;
- }
-
// save current health state
float healthPct = target->GetHealthPct();
bool alive = target->isAlive();
for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
{
- if (GetMiscValue() == i || GetMiscValue() == -1)
+ if (GetMiscValueB() & 1 << i || !GetMiscValueB()) // 0 is also used for all stats
{
target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(GetAmount()), apply);
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
@@ -3823,7 +3817,7 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8
// recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR0_UNK4 0x00000010 flag)
// this check is total bullshit i think
- if (GetMiscValue() == STAT_STAMINA && (m_spellInfo->Attributes & SPELL_ATTR0_ABILITY))
+ if (GetMiscValueB() & 1 << STAT_STAMINA && (m_spellInfo->Attributes & SPELL_ATTR0_ABILITY))
target->SetHealth(std::max<uint32>(uint32(healthPct * target->GetMaxHealth() * 0.01f), (alive ? 1 : 0)));
}