diff options
author | Shauren <shauren.trinity@gmail.com> | 2013-06-21 02:05:55 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2013-06-21 02:05:55 +0200 |
commit | cd32579a43ae3dbdb7681cc281fc7c6e414f7136 (patch) | |
tree | 2ea1d14a4b6059bf6e745181beff1f52a0135d94 /src | |
parent | 53a5701d18e1e6c0c1791e09aa576174137e2004 (diff) |
Core/Auras: Simplified Furor handling
Closes #10048
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 58f49f72cfd..c4952659b64 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1771,39 +1771,21 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo if (target->getPowerType() != PowerType) target->setPowerType(PowerType); - switch (form) + if (form == FORM_CAT || form == FORM_BEAR) { - case FORM_CAT: - case FORM_BEAR: - { - // get furor proc chance - int32 FurorChance = 0; - if (AuraEffect const* dummy = target->GetDummyAuraEffect(SPELLFAMILY_DRUID, 238, 0)) - FurorChance = std::max(dummy->GetAmount(), 0); + // get furor proc chance + int32 FurorChance = 0; + if (AuraEffect const* dummy = target->GetDummyAuraEffect(SPELLFAMILY_DRUID, 238, 0)) + FurorChance = std::max(dummy->GetAmount(), 0); - switch (GetMiscValue()) - { - case FORM_CAT: - { - int32 basePoints = std::min<int32>(oldPower, FurorChance); - target->SetPower(POWER_ENERGY, 0); - target->CastCustomSpell(target, 17099, &basePoints, NULL, NULL, true, NULL, this); - break; - } - case FORM_BEAR: - if (urand(0, 99) < FurorChance) - target->CastSpell(target, 17057, true); - default: - { - int32 newEnergy = std::min(target->GetPower(POWER_ENERGY), FurorChance); - target->SetPower(POWER_ENERGY, newEnergy); - break; - } - } - break; + if (form == FORM_CAT) + { + int32 basePoints = std::min<int32>(oldPower, FurorChance); + target->SetPower(POWER_ENERGY, 0); + target->CastCustomSpell(target, 17099, &basePoints, NULL, NULL, true, NULL, this); } - default: - break; + else if (roll_chance_i(FurorChance)) + target->CastSpell(target, 17057, true); } } // stop handling the effect if it was removed by linked event |