From 1b653c1b5bafbfab7d595feab963d438935e440a Mon Sep 17 00:00:00 2001 From: killerwife Date: Tue, 24 Sep 2024 22:51:49 +0200 Subject: [PATCH] Icecrown: Script s.56578 to deal percentage damage --- sql/scriptdev2/spell.sql | 1 + .../AI/ScriptDevAI/scripts/northrend/icecrown.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index a021d5bc068..294a215f455 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -888,6 +888,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (56265,'spell_vortex_aura'), (56266,'spell_vortex_aura'), (56430,'spell_arcane_bomb'), +(56578,'spell_rapid_fire_harpoon'), (56683,'spell_grab_captured_crusader'), (56684,'spell_drop_off_captured_crusader'), (56839,'spell_to_icecrown_air_ship_a_summon_vehicle'), diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp index 0a8269e6e9a..7804df30350 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp @@ -1242,6 +1242,18 @@ struct InfraGreenShield : public AuraScript } }; +// 56578 - Rapid-Fire Harpoon +struct RapidFireHarpoon : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override + { + if (effIdx != EFFECT_INDEX_0) + return; + + spell->SetDamage(spell->GetUnitTarget()->GetMaxHealth() * spell->GetDamage() / 100); // percentage of effect + } +}; + void AddSC_icecrown() { Script* pNewScript = new Script; @@ -1292,4 +1304,5 @@ void AddSC_icecrown() RegisterSpellScript("spell_fire_sgm3"); RegisterSpellScript("spell_burning"); RegisterSpellScript("spell_infragreenshield"); + RegisterSpellScript("spell_rapid_fire_harpoon"); }