refactor(Core/Scripts): Spell To Scripts (#9718)

This commit is contained in:
IntelligentQuantum
2021-12-21 17:43:45 +03:30
committed by GitHub
parent 838c88f45a
commit 11a734bf2b
6 changed files with 103 additions and 31 deletions

View File

@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "ruins_of_ahnqiraj.h"
enum Yells
@@ -124,7 +125,29 @@ public:
}
};
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);
}