From 8051ff13dfcf3819b58adfcec1608c08dcbcd080 Mon Sep 17 00:00:00 2001 From: DanVS <33371360+DanVS@users.noreply.github.com> Date: Sat, 5 Jan 2019 00:54:33 +0000 Subject: Core/Scripts: Move some spells to scripts (#22332) --- .../Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/server/scripts/Kalimdor') diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index 1416fcd0105..019c7c2647e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -19,6 +19,7 @@ #include "ruins_of_ahnqiraj.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" +#include "SpellScript.h" enum Yells { @@ -134,7 +135,27 @@ class boss_rajaxx : public CreatureScript } }; +class spell_rajaxx_thundercrash : public SpellScript +{ + PrepareSpellScript(spell_rajaxx_thundercrash); + + void HandleDamageCalc(SpellEffIndex /*effIndex*/) + { + int32 damage = GetHitUnit()->GetHealth() / 2; + if (damage < 200) + damage = 200; + + SetHitDamage(damage); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_rajaxx_thundercrash::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + void AddSC_boss_rajaxx() { new boss_rajaxx(); + RegisterSpellScript(spell_rajaxx_thundercrash); } -- cgit v1.2.3