diff options
| author | Anubisss <none@none> | 2010-12-16 18:08:23 +0100 |
|---|---|---|
| committer | Anubisss <none@none> | 2010-12-16 18:08:23 +0100 |
| commit | 6d9029c12e9805ee993d98ba66355db1147b0195 (patch) | |
| tree | 2d0c46a04f03a0b61c6c9f49a7b7cef889db3237 /src/server/game/Spells | |
| parent | bb7bd9ef45cd15c7da271c690f5c798cdd340b22 (diff) | |
Make some cleanup.
My thank goes to Az@zel for the code analysis.
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Spells')
| -rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 47 | ||||
| -rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 4 |
2 files changed, 10 insertions, 41 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index dca970edf95..06b065eb78d 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4223,14 +4223,9 @@ void AuraEffect::HandleAuraModIncreaseSpeed(AuraApplication const * aurApp, uint target->UpdateSpeed(MOVE_RUN, true); } -void AuraEffect::HandleAuraModIncreaseMountedSpeed(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const +void AuraEffect::HandleAuraModIncreaseMountedSpeed(AuraApplication const * aurApp, uint8 mode, bool apply) const { - if (!(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK)) - return; - - Unit * target = aurApp->GetTarget(); - - target->UpdateSpeed(MOVE_RUN, true); + HandleAuraModIncreaseSpeed(aurApp, mode, apply); } void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -4868,20 +4863,9 @@ void AuraEffect::HandleModPowerRegen(AuraApplication const * aurApp, uint8 mode, // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate } -void AuraEffect::HandleModPowerRegenPCT(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const +void AuraEffect::HandleModPowerRegenPCT(AuraApplication const * aurApp, uint8 mode, bool apply) const { - if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) - return; - - Unit * target = aurApp->GetTarget(); - - if (target->GetTypeId() != TYPEID_PLAYER) - return; - - // Update manaregen value - if (GetMiscValue() == POWER_MANA) - target->ToPlayer()->UpdateManaRegen(); - // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate + HandleModPowerRegen(aurApp, mode, apply); } void AuraEffect::HandleModManaRegen(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const @@ -5055,17 +5039,9 @@ void AuraEffect::HandleAuraModBlockPercent(AuraApplication const * aurApp, uint8 target->ToPlayer()->UpdateBlockPercentage(); } -void AuraEffect::HandleAuraModRegenInterrupt(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const +void AuraEffect::HandleAuraModRegenInterrupt(AuraApplication const * aurApp, uint8 mode, bool apply) const { - if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) - return; - - Unit * target = aurApp->GetTarget(); - - if (target->GetTypeId() != TYPEID_PLAYER) - return; - - target->ToPlayer()->UpdateManaRegen(); + HandleModManaRegen(aurApp, mode, apply); } void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -5362,16 +5338,9 @@ void AuraEffect::HandleAuraModRangedAttackPowerOfStatPercent(AuraApplication con target->ToPlayer()->UpdateAttackPowerAndDamage(true); } -void AuraEffect::HandleAuraModAttackPowerOfStatPercent(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const +void AuraEffect::HandleAuraModAttackPowerOfStatPercent(AuraApplication const * aurApp, uint8 mode, bool apply) const { - if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) - return; - - Unit * target = aurApp->GetTarget(); - - // Recalculate bonus - if (target->GetTypeId() == TYPEID_PLAYER) - target->ToPlayer()->UpdateAttackPowerAndDamage(false); + HandleAuraModAttackPowerOfArmor(aurApp, mode, apply); } void AuraEffect::HandleAuraModAttackPowerOfArmor(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8f4bf73c1a3..c5d9179f78a 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3228,10 +3228,10 @@ void Spell::EffectDualWield(SpellEffIndex /*effIndex*/) unitTarget->ToCreature()->UpdateDamagePhysical(OFF_ATTACK); } -void Spell::EffectPull(SpellEffIndex /*effIndex*/) +void Spell::EffectPull(SpellEffIndex effIndex) { // TODO: create a proper pull towards distract spell center for distract - sLog.outDebug("WORLD: Spell Effect DUMMY"); + EffectNULL(effIndex); } void Spell::EffectDistract(SpellEffIndex /*effIndex*/) |
