Core/Spells: fixed Heroic Strike damage calculation

This commit is contained in:
Ovahlord
2024-07-09 11:43:30 +02:00
parent 9c67bdf329
commit a0de631a8a
2 changed files with 21 additions and 0 deletions

View File

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

View File

@@ -22,7 +22,25 @@
*/
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "Unit.h"
// 78 - Heroic Strike
class spell_warr_heroic_strike : public SpellScript
{
// Damage = {8+$ap*60/100}
void CalculateDamage(Unit* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
{
damage = static_cast<int32>(8 + GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.6f);
}
void Register() override
{
CalcDamage += SpellCalcDamageFn(spell_warr_heroic_strike::CalculateDamage);
}
};
void AddSC_warrior_spell_scripts()
{
RegisterSpellScript(spell_warr_heroic_strike);
}