From 13fd0ed366d250c59b46825628e0507e6dc21489 Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 19 Feb 2009 00:27:30 +0100 Subject: *Try to fix enormous amount of some ap related spells. This may not fix all issues. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 2 +- src/game/Unit.cpp | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 73677ccc15f..1686c8b607f 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2264,7 +2264,7 @@ void Spell::EffectApplyAura(uint32 i) //mod duration of channeled aura by spell haste if (IsChanneledSpell(m_spellInfo)) - m_caster->ModSpellCastTime(m_spellInfo, duration); + caster->ModSpellCastTime(m_spellInfo, duration); // if Aura removed and deleted, do not continue. if(duration== 0 && !(Aur->IsPermanent())) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 473be9e88a6..8863f5b19f6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10459,17 +10459,13 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const { if (attType == RANGED_ATTACK) { - int32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS); - if (ap < 0) - return 0.0f; - return ap * (1.0f + GetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER)); + float ap = (1.0f + GetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER)) * float(GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS)); + return ap < 0.0f ? 0.0f : ap ; } else { - int32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS); - if (ap < 0) - return 0.0f; - return ap * (1.0f + GetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER)); + float ap = (1.0f + GetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER)) * float(GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS)); + return ap < 0.0f ? 0.0f : ap ; } } -- cgit v1.2.3