Scripts/Spells: Migrate Some Scripted Spells to Scripts (#23185)
* Migrate spells to scripts * Simplify code * I need to sleep * Update chapter1.cpp * Use actual damage * No need in null check here (cherry picked from commit 2cfaeb14004cfbb5500855472ad89ab9238df13d)
This commit is contained in:
@@ -1657,6 +1657,23 @@ class spell_steal_essence_visual : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 46642 - 5,000 Gold
|
||||
class spell_gen_5000_gold : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_5000_gold);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* target = GetHitPlayer())
|
||||
target->ModifyMoney(5000 * GOLD);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_5000_gold::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
enum FishingSpells
|
||||
{
|
||||
SPELL_FISHING_NO_FISHING_POLE = 131476,
|
||||
@@ -2635,6 +2652,22 @@ class spell_gen_remove_flight_auras : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 20589 - Escape artist
|
||||
class spell_gen_remove_impairing_auras : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_remove_impairing_auras);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
GetHitUnit()->RemoveMovementImpairingAuras(true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_remove_impairing_auras::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
// 23493 - Restoration
|
||||
// 24379 - Restoration
|
||||
class spell_gen_restoration : public AuraScript
|
||||
@@ -4438,6 +4471,7 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_ethereal_pet_onsummon);
|
||||
RegisterSpellScript(spell_ethereal_pet_aura_remove);
|
||||
RegisterAuraScript(spell_steal_essence_visual);
|
||||
RegisterSpellScript(spell_gen_5000_gold);
|
||||
RegisterSpellScript(spell_gen_fishing);
|
||||
RegisterSpellScript(spell_gen_gadgetzan_transporter_backfire);
|
||||
RegisterAuraScript(spell_gen_gift_of_naaru);
|
||||
@@ -4475,6 +4509,7 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_gen_profession_research);
|
||||
RegisterSpellScript(spell_gen_pvp_trinket);
|
||||
RegisterSpellScript(spell_gen_remove_flight_auras);
|
||||
RegisterSpellScript(spell_gen_remove_impairing_auras);
|
||||
RegisterAuraScript(spell_gen_restoration);
|
||||
RegisterSpellAndAuraScriptPair(spell_gen_replenishment, spell_gen_replenishment_aura);
|
||||
// Running Wild
|
||||
|
||||
Reference in New Issue
Block a user