fix(Scripts/ZulAman): Akil'zon storm damage should multiply per tick (#20842)

This commit is contained in:
Andrew
2024-12-05 09:46:07 -03:00
committed by GitHub
parent 0d0e3a6ce1
commit 00c0e202ef
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `spell_script_names` WHERE `spell_id` = 43657;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(43657, 'spell_electrical_storm_proc');

View File

@@ -20,6 +20,8 @@
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "Weather.h"
@@ -321,9 +323,30 @@ class spell_electrial_storm : public AuraScript
}
};
// 43657 - Electrical Storm
class spell_electrical_storm_proc : public SpellScript
{
PrepareSpellScript(spell_electrical_storm_proc);
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
{
if (Aura* aura = GetCaster()->GetAura(SPELL_ELECTRICAL_STORM))
{
uint8 multiplier = aura->GetEffect(EFFECT_1)->GetTickNumber();
SetHitDamage(GetHitDamage() * multiplier);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_electrical_storm_proc::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
void AddSC_boss_akilzon()
{
RegisterZulAmanCreatureAI(boss_akilzon);
RegisterZulAmanCreatureAI(npc_akilzon_eagle);
RegisterSpellScript(spell_electrial_storm);
RegisterSpellScript(spell_electrical_storm_proc);
}