From a11efab2a28d2b0e4ed5b5b4b2492a993f02fec9 Mon Sep 17 00:00:00 2001 From: thenecromancer Date: Wed, 13 Jan 2010 11:56:20 +0100 Subject: [PATCH] Fix character sheet showing wrong values for weapon dependant damage mods --HG-- branch : trunk --- src/game/Player.cpp | 9 ++++++++- src/game/SpellAuraEffects.cpp | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index febf205ca1..8e4bd3052a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -7320,7 +7320,14 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att } if (!item->IsBroken()&&item->IsFitToSpellRequirements(aura->GetSpellProto())) - HandleStatModifier(unitMod, unitModType, float(aura->GetAmount()),apply); + { + HandleStatModifier(unitMod, unitModType, float(aura->GetAmount()),apply); + + if (unitModType == TOTAL_PCT) + ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT,aura->GetAmount()/100.0f,apply); + else + ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,aura->GetAmount(),apply); + } } void Player::ApplyItemEquipSpell(Item *item, bool apply, bool form_change) diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp index 1f1b9b4208..792152ad88 100644 --- a/src/game/SpellAuraEffects.cpp +++ b/src/game/SpellAuraEffects.cpp @@ -5098,19 +5098,19 @@ void AuraEffect::HandleModDamageDone(AuraApplication const * aurApp, uint8 mode, target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(GetAmount()), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(GetAmount()), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(GetAmount()), apply); + + if(target->GetTypeId() == TYPEID_PLAYER) + { + if(GetAmount() > 0) + target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,GetAmount(),apply); + else + target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG,GetAmount(),apply); + } } else { // done in Player::_ApplyWeaponDependentAuraMods } - - if(target->GetTypeId() == TYPEID_PLAYER) - { - if(GetAmount() > 0) - target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,GetAmount(),apply); - else - target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG,GetAmount(),apply); - } } // Skip non magic case for speedup @@ -5185,14 +5185,14 @@ void AuraEffect::HandleModDamagePercentDone(AuraApplication const * aurApp, uint target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(GetAmount()), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(GetAmount()), apply); target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(GetAmount()), apply); + // For show in client + if(target->GetTypeId() == TYPEID_PLAYER) + target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT,GetAmount()/100.0f,apply); } else { // done in Player::_ApplyWeaponDependentAuraMods } - // For show in client - if(target->GetTypeId() == TYPEID_PLAYER) - target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT,GetAmount()/100.0f,apply); } // Skip non magic case for speedup