Core/Spells: Fix warrior "Rend" damage

This commit is contained in:
Vincent-Michael
2013-07-26 02:43:55 +02:00
parent b96945bd4b
commit c764e3e1c0
2 changed files with 6 additions and 11 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_warr_rend';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(94009, 'spell_warr_rend');

View File

@@ -538,7 +538,7 @@ class spell_warr_rallying_cry : public SpellScriptLoader
}
};
// 772 - Rend
// 94009 - Rend
class spell_warr_rend : public SpellScriptLoader
{
public:
@@ -554,21 +554,13 @@ class spell_warr_rend : public SpellScriptLoader
{
canBeRecalculated = false;
// $0.2 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick
// $0.25 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick
float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 mws = caster->GetAttackTime(BASE_ATTACK);
float mwbMin = caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE);
float mwbMax = caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE);
float mwb = ((mwbMin + mwbMax) / 2 + ap * mws / 14000) * 0.2f;
float mwb = ((mwbMin + mwbMax) / 2 + ap * mws / 14000) * 0.25f;
amount += int32(caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), mwb));
// "If used while your target is above 75% health, Rend does 35% more damage."
// as for 3.1.3 only ranks above 9 (wrong tooltip?)
if (GetSpellInfo()->GetRank() >= 9)
{
if (GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, GetSpellInfo(), caster))
AddPct(amount, GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster));
}
}
}