refactor(Scripts/Northrend): dungeons Spell Scripts registry macros (#19134)

* instance_azjol_nerub spell:spell_azjol_nerub_fixate

* instance_azjol_nerub aura:spell_azjol_nerub_web_wrap_aura

* boss_hadronox aura:spell_hadronox_summon_periodic_aura

* boss_hadronox aura:spell_hadronox_leech_poison_aura

* boss_argent_challenge spell:spell_eadric_radiance

* boss_argent_challenge spell:spell_toc5_light_rain

* boss_argent_challenge aura:spell_reflective_shield_aura

* fixup! boss_argent_challenge aura:spell_reflective_shield_aura

* instance_drak_tharon_keep aura:spell_dtk_raise_dead_aura

* instance_drak_tharon_keep spell:spell_dtk_summon_random_drakkari

* boss_trollgore spell:spell_trollgore_consume

* boss_trollgore aura:spell_trollgore_corpse_explode_aura

* boss_trollgore spell:spell_trollgore_invader_taunt

* boss_novos spell:spell_novos_despawn_crystal_handler

* boss_novos aura:spell_novos_crystal_handler_death_aura

* boss_novos spell:spell_novos_summon_minions

* boss_tharon_ja aura:spell_tharon_ja_curse_of_life_aura

* boss_tharon_ja aura:spell_tharon_ja_dummy_aura

* boss_tharon_ja spell:spell_tharon_ja_clear_gift_of_tharon_ja

* boss_dred aura:spell_dred_grievious_bite_aura

* boss_dred spell:spell_dred_raptor_call

* boss_moorabi aura:spell_moorabi_mojo_frenzy_aura

* boss_slad_ran aura:spell_sladran_grip_of_sladran_aura

* boss_drakkari_colossus spell:spell_drakkari_colossus_emerge

* boss_drakkari_colossus spell:spell_drakkari_colossus_surge

* boss_drakkari_colossus spell:spell_drakkari_colossus_face_me

* boss_gal_darah spell:spell_galdarah_impaling_charge

* boss_gal_darah spell:spell_galdarah_transform

* boss_malygos spell:spell_eoe_ph3_surge_of_power

* oculus aura:spell_oculus_stop_time_aura

* oculus aura:spell_oculus_evasive_maneuvers_aura

* oculus spell:spell_oculus_shock_lance

* oculus aura:spell_oculus_temporal_rift_aura

* oculus spell:spell_oculus_touch_the_nightmare

* oculus aura:spell_oculus_dream_funnel_aura

* oculus spell:spell_oculus_call_ruby_emerald_amber_drake

* oculus aura:spell_oculus_ride_ruby_emerald_amber_drake_que_aura

* oculus aura:spell_oculus_evasive_charges_aura

* oculus aura:spell_oculus_soar_aura

* oculus aura:spell_oculus_rider_aura

* oculus aura:spell_oculus_drake_flag_aura

* boss_magus_telestra aura:spell_boss_magus_telestra_summon_telestra_clones_aura

* boss_magus_telestra spell:spell_boss_magus_telestra_gravity_well

* utgarde_keep aura:spell_ticking_time_bomb_aura

* boss_keleseth aura:spell_frost_tomb_aura

* boss_svala pair:spell_svala_ritual_strike

* boss_moragg aura:spell_optic_link_aura

* violet_hold aura:spell_destroy_door_seal_aura

* forge_of_souls aura:spell_shield_of_bones_aura

* boss_devourer_of_souls aura:spell_wailing_souls_periodic_aura

* boss_bronjahm spell:spell_bronjahm_magic_bane

* boss_bronjahm aura:spell_bronjahm_soulstorm_channel_ooc_aura

* boss_bronjahm aura:spell_bronjahm_soulstorm_visual_aura

* boss_bronjahm spell:spell_bronjahm_soulstorm_targeting

* boss_krickandick aura:spell_krick_explosive_barrage_aura

* boss_krickandick aura:spell_exploding_orb_auto_grow_aura

* pit_of_saron aura:spell_pos_empowered_blizzard_aura

* pit_of_saron spell:spell_pos_slave_trigger_closest

* pit_of_saron spell:spell_pos_rimefang_frost_nova

* pit_of_saron aura:spell_pos_blight_aura

* pit_of_saron aura:spell_pos_glacial_strike_aura

* boss_forgemaster_garfrost spell:spell_garfrost_permafrost

* halls_of_reflection aura:spell_hor_gunship_cannon_fire_aura

* boss_marwyn aura:spell_hor_shared_suffering_aura

* fixup! forge_of_souls aura:spell_shield_of_bones_aura

* fixup! boss_bronjahm aura:spell_bronjahm_soulstorm_channel_ooc_aura

* fixup! boss_bronjahm aura:spell_bronjahm_soulstorm_visual_aura

* fixup! pit_of_saron aura:spell_pos_empowered_blizzard_aura

* fixup! halls_of_reflection aura:spell_hor_gunship_cannon_fire_aura

* fixup! boss_marwyn aura:spell_hor_shared_suffering_aura
This commit is contained in:
Jelle Meeus
2024-06-23 19:17:19 +02:00
committed by GitHub
parent b055faf8ee
commit cd9dff5032
29 changed files with 1282 additions and 1765 deletions

View File

@@ -343,32 +343,26 @@ public:
};
};
class spell_frost_tomb : public SpellScriptLoader
class spell_frost_tomb_aura : public AuraScript
{
public:
spell_frost_tomb() : SpellScriptLoader("spell_frost_tomb") { }
PrepareAuraScript(spell_frost_tomb_aura);
class spell_frost_tombAuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_frost_tombAuraScript);
return ValidateSpellInfo({ SPELL_FROST_TOMB_SUMMON });
}
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (aurEff->GetTickNumber() == 1)
if( Unit* target = GetTarget() )
target->CastSpell((Unit*)nullptr, SPELL_FROST_TOMB_SUMMON, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_frost_tombAuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
return new spell_frost_tombAuraScript();
PreventDefaultAction();
if (aurEff->GetTickNumber() == 1)
if( Unit* target = GetTarget() )
target->CastSpell((Unit*)nullptr, SPELL_FROST_TOMB_SUMMON, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_frost_tomb_aura::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
@@ -377,6 +371,6 @@ void AddSC_boss_keleseth()
new boss_keleseth();
new npc_frost_tomb();
new npc_vrykul_skeleton();
new spell_frost_tomb();
RegisterSpellScript(spell_frost_tomb_aura);
}

View File

@@ -208,37 +208,26 @@ enum TickingTimeBomb
SPELL_TICKING_TIME_BOMB_EXPLODE = 59687
};
class spell_ticking_time_bomb : public SpellScriptLoader
class spell_ticking_time_bomb_aura : public AuraScript
{
public:
spell_ticking_time_bomb() : SpellScriptLoader("spell_ticking_time_bomb") { }
PrepareAuraScript(spell_ticking_time_bomb_aura);
class spell_ticking_time_bomb_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_ticking_time_bomb_AuraScript);
return ValidateSpellInfo({ SPELL_TICKING_TIME_BOMB_EXPLODE });
}
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_TICKING_TIME_BOMB_EXPLODE });
}
void HandleOnEffectRemove(AuraEffect const* /* aurEff */, AuraEffectHandleModes /* mode */)
{
if (GetCaster() == GetTarget())
{
GetTarget()->CastSpell(GetTarget(), SPELL_TICKING_TIME_BOMB_EXPLODE, true);
}
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_ticking_time_bomb_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleOnEffectRemove(AuraEffect const* /* aurEff */, AuraEffectHandleModes /* mode */)
{
return new spell_ticking_time_bomb_AuraScript();
if (GetCaster() == GetTarget())
{
GetTarget()->CastSpell(GetTarget(), SPELL_TICKING_TIME_BOMB_EXPLODE, true);
}
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_ticking_time_bomb_aura::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -247,6 +236,6 @@ void AddSC_utgarde_keep()
new npc_dragonflayer_forge_master();
new npc_enslaved_proto_drake();
new spell_ticking_time_bomb();
RegisterSpellScript(spell_ticking_time_bomb_aura);
}

View File

@@ -396,56 +396,40 @@ public:
};
};
class spell_svala_ritual_strike : public SpellScriptLoader
class spell_svala_ritual_strike : public SpellScript
{
public:
spell_svala_ritual_strike() : SpellScriptLoader("spell_svala_ritual_strike") { }
PrepareSpellScript(spell_svala_ritual_strike);
class spell_svala_ritual_strike_SpellScript : public SpellScript
void HandleDummyEffect(SpellEffIndex /*effIndex*/)
{
PrepareSpellScript(spell_svala_ritual_strike_SpellScript);
void HandleDummyEffect(SpellEffIndex /*effIndex*/)
if (Unit* unitTarget = GetHitUnit())
{
if (Unit* unitTarget = GetHitUnit())
{
if (unitTarget->GetTypeId() != TYPEID_UNIT)
return;
if (unitTarget->GetTypeId() != TYPEID_UNIT)
return;
Unit::DealDamage(GetCaster(), unitTarget, 7000, nullptr, DIRECT_DAMAGE);
}
Unit::DealDamage(GetCaster(), unitTarget, 7000, nullptr, DIRECT_DAMAGE);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_svala_ritual_strike_SpellScript::HandleDummyEffect, EFFECT_2, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_svala_ritual_strike_SpellScript();
}
class spell_svala_ritual_strike_AuraScript : public AuraScript
void Register() override
{
PrepareAuraScript(spell_svala_ritual_strike_AuraScript);
OnEffectHitTarget += SpellEffectFn(spell_svala_ritual_strike::HandleDummyEffect, EFFECT_2, SPELL_EFFECT_DUMMY);
}
};
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
// Set amount based on difficulty
amount = (GetCaster()->GetMap()->IsHeroic() ? 2000 : 1000);
}
class spell_svala_ritual_strike_aura : public AuraScript
{
PrepareAuraScript(spell_svala_ritual_strike_aura);
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_svala_ritual_strike_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
}
};
AuraScript* GetAuraScript() const override
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
return new spell_svala_ritual_strike_AuraScript();
// Set amount based on difficulty
amount = (GetCaster()->GetMap()->IsHeroic() ? 2000 : 1000);
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_svala_ritual_strike_aura::CalculateAmount, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
}
};
@@ -453,6 +437,6 @@ void AddSC_boss_svala()
{
new boss_svala();
new npc_ritual_channeler();
new spell_svala_ritual_strike();
RegisterSpellAndAuraScriptPair(spell_svala_ritual_strike, spell_svala_ritual_strike_aura);
}