fix(Core/Spell): handle 5,000 Gold with SpellScript (#6996)

This commit is contained in:
Kitzunu
2021-07-24 00:40:20 +02:00
committed by GitHub
parent 96821a3e05
commit 4ace9f17de
3 changed files with 36 additions and 15 deletions

View File

@@ -35,7 +35,36 @@
// there is probably some underlying problem with imports which should properly addressed
#include "GridNotifiersImpl.h"
// Ours
// 46642 - 5,000 Gold
class spell_gen_5000_gold : public SpellScriptLoader
{
public:
spell_gen_5000_gold() : SpellScriptLoader("spell_gen_5000_gold") {}
class spell_gen_5000_gold_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_5000_gold_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Player* target = GetHitPlayer())
{
target->ModifyMoney(5000 * GOLD);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_5000_gold_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_5000_gold_SpellScript();
}
};
class spell_gen_model_visible : public SpellScriptLoader
{
public:
@@ -5149,7 +5178,7 @@ public:
void AddSC_generic_spell_scripts()
{
// ours:
new spell_gen_5000_gold();
new spell_gen_model_visible();
new spell_the_flag_of_ownership();
new spell_gen_have_item_auras();
@@ -5196,8 +5225,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_flurry_of_claws();
new spell_gen_throw_back();
new spell_gen_haunted();
// theirs:
new spell_gen_absorb0_hitlimit1();
new spell_gen_adaptive_warding();
new spell_gen_av_drekthar_presence();