mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
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:
@@ -155,60 +155,38 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_dred_grievious_bite : public SpellScriptLoader
|
||||
class spell_dred_grievious_bite_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_dred_grievious_bite() : SpellScriptLoader("spell_dred_grievious_bite") { }
|
||||
PrepareAuraScript(spell_dred_grievious_bite_aura);
|
||||
|
||||
class spell_dred_grievious_bite_AuraScript : public AuraScript
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_dred_grievious_bite_AuraScript);
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetHealth() == target->GetMaxHealth())
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetHealth() == target->GetMaxHealth())
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dred_grievious_bite_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_dred_grievious_bite_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dred_grievious_bite_aura::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dred_raptor_call : public SpellScriptLoader
|
||||
class spell_dred_raptor_call : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_dred_raptor_call() : SpellScriptLoader("spell_dred_raptor_call") { }
|
||||
PrepareSpellScript(spell_dred_raptor_call);
|
||||
|
||||
class spell_dred_raptor_call_SpellScript : public SpellScript
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_dred_raptor_call_SpellScript);
|
||||
GetCaster()->SummonCreature(RAND(NPC_DRAKKARI_GUTRIPPER, NPC_DRAKKARI_SCYTHECLAW), -522.02f, -718.89f, 30.26f, 2.41f);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->SummonCreature(RAND(NPC_DRAKKARI_GUTRIPPER, NPC_DRAKKARI_SCYTHECLAW), -522.02f, -718.89f, 30.26f, 2.41f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dred_raptor_call_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_dred_raptor_call_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dred_raptor_call::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -231,7 +209,7 @@ public:
|
||||
void AddSC_boss_dred()
|
||||
{
|
||||
new boss_dred();
|
||||
new spell_dred_grievious_bite();
|
||||
new spell_dred_raptor_call();
|
||||
RegisterSpellScript(spell_dred_grievious_bite_aura);
|
||||
RegisterSpellScript(spell_dred_raptor_call);
|
||||
new achievement_better_off_dred();
|
||||
}
|
||||
|
||||
@@ -268,85 +268,62 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_novos_despawn_crystal_handler : public SpellScriptLoader
|
||||
class spell_novos_despawn_crystal_handler : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_novos_despawn_crystal_handler() : SpellScriptLoader("spell_novos_despawn_crystal_handler") { }
|
||||
PrepareSpellScript(spell_novos_despawn_crystal_handler);
|
||||
|
||||
class spell_novos_despawn_crystal_handler_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_novos_despawn_crystal_handler_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_BEAM_CHANNEL });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_BEAM_CHANNEL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_novos_despawn_crystal_handler_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_novos_despawn_crystal_handler_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_BEAM_CHANNEL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_novos_despawn_crystal_handler::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_novos_crystal_handler_death : public SpellScriptLoader
|
||||
class spell_novos_crystal_handler_death_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_novos_crystal_handler_death() : SpellScriptLoader("spell_novos_crystal_handler_death") { }
|
||||
PrepareAuraScript(spell_novos_crystal_handler_death_aura);
|
||||
|
||||
class spell_novos_crystal_handler_death_AuraScript : public AuraScript
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_novos_crystal_handler_death_AuraScript)
|
||||
GetUnitOwner()->InterruptNonMeleeSpells(false);
|
||||
if (GameObject* crystal = GetUnitOwner()->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_DOOR, 5.0f))
|
||||
crystal->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->InterruptNonMeleeSpells(false);
|
||||
if (GameObject* crystal = GetUnitOwner()->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_DOOR, 5.0f))
|
||||
crystal->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_novos_crystal_handler_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_novos_crystal_handler_death_AuraScript();
|
||||
OnEffectApply += AuraEffectApplyFn(spell_novos_crystal_handler_death_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_novos_summon_minions : public SpellScriptLoader
|
||||
class spell_novos_summon_minions : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_novos_summon_minions() : SpellScriptLoader("spell_novos_summon_minions") { }
|
||||
PrepareSpellScript(spell_novos_summon_minions);
|
||||
|
||||
class spell_novos_summon_minions_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_novos_summon_minions_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_COPY_OF_SUMMON_MINIONS });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
GetCaster()->CastSpell((Unit*)nullptr, SPELL_COPY_OF_SUMMON_MINIONS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_novos_summon_minions_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_novos_summon_minions_SpellScript();
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
GetCaster()->CastSpell((Unit*)nullptr, SPELL_COPY_OF_SUMMON_MINIONS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_novos_summon_minions::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -364,8 +341,8 @@ public:
|
||||
void AddSC_boss_novos()
|
||||
{
|
||||
new boss_novos();
|
||||
new spell_novos_despawn_crystal_handler();
|
||||
new spell_novos_crystal_handler_death();
|
||||
new spell_novos_summon_minions();
|
||||
RegisterSpellScript(spell_novos_despawn_crystal_handler);
|
||||
RegisterSpellScript(spell_novos_crystal_handler_death_aura);
|
||||
RegisterSpellScript(spell_novos_summon_minions);
|
||||
new achievement_oh_novos();
|
||||
}
|
||||
|
||||
@@ -208,107 +208,79 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_tharon_ja_curse_of_life : public SpellScriptLoader
|
||||
class spell_tharon_ja_curse_of_life_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_tharon_ja_curse_of_life() : SpellScriptLoader("spell_tharon_ja_curse_of_life") { }
|
||||
PrepareAuraScript(spell_tharon_ja_curse_of_life_aura);
|
||||
|
||||
class spell_tharon_ja_curse_of_life_AuraScript : public AuraScript
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_tharon_ja_curse_of_life_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
if (GetUnitOwner()->HealthBelowPct(50))
|
||||
{
|
||||
if (GetUnitOwner()->HealthBelowPct(50))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_tharon_ja_curse_of_life_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_tharon_ja_curse_of_life_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_tharon_ja_curse_of_life_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_tharon_ja_dummy : public SpellScriptLoader
|
||||
class spell_tharon_ja_dummy_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_tharon_ja_dummy() : SpellScriptLoader("spell_tharon_ja_dummy") { }
|
||||
PrepareAuraScript(spell_tharon_ja_dummy_aura);
|
||||
|
||||
class spell_tharon_ja_dummy_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_tharon_ja_dummy_AuraScript)
|
||||
return ValidateSpellInfo({ SPELL_FLESH_VISUAL, SPELL_GIFT_OF_THARON_JA, SPELL_TURN_BONES });
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FLESH_VISUAL, true);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_GIFT_OF_THARON_JA, true);
|
||||
GetUnitOwner()->SetDisplayId(GetUnitOwner()->GetNativeDisplayId() + 1);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->GetThreatMgr().ResetAllThreat();
|
||||
GetUnitOwner()->GetMotionMaster()->Clear();
|
||||
GetUnitOwner()->CastSpell((Unit*)nullptr, SPELL_TURN_BONES, false);
|
||||
GetUnitOwner()->GetAI()->DoAction(ACTION_TURN_BONES);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_tharon_ja_dummy_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_tharon_ja_dummy_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_tharon_ja_dummy_AuraScript();
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FLESH_VISUAL, true);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_GIFT_OF_THARON_JA, true);
|
||||
GetUnitOwner()->SetDisplayId(GetUnitOwner()->GetNativeDisplayId() + 1);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->GetThreatMgr().ResetAllThreat();
|
||||
GetUnitOwner()->GetMotionMaster()->Clear();
|
||||
GetUnitOwner()->CastSpell((Unit*)nullptr, SPELL_TURN_BONES, false);
|
||||
GetUnitOwner()->GetAI()->DoAction(ACTION_TURN_BONES);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_tharon_ja_dummy_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_tharon_ja_dummy_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_tharon_ja_clear_gift_of_tharon_ja : public SpellScriptLoader
|
||||
class spell_tharon_ja_clear_gift_of_tharon_ja : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_tharon_ja_clear_gift_of_tharon_ja() : SpellScriptLoader("spell_tharon_ja_clear_gift_of_tharon_ja") { }
|
||||
PrepareSpellScript(spell_tharon_ja_clear_gift_of_tharon_ja);
|
||||
|
||||
class spell_tharon_ja_clear_gift_of_tharon_ja_SpellScript : public SpellScript
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_tharon_ja_clear_gift_of_tharon_ja_SpellScript);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->RemoveAura(SPELL_GIFT_OF_THARON_JA);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->RemoveAura(SPELL_GIFT_OF_THARON_JA);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_tharon_ja_clear_gift_of_tharon_ja_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_tharon_ja_clear_gift_of_tharon_ja_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_tharon_ja_clear_gift_of_tharon_ja::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_tharon_ja()
|
||||
{
|
||||
new boss_tharon_ja();
|
||||
new spell_tharon_ja_curse_of_life();
|
||||
new spell_tharon_ja_dummy();
|
||||
new spell_tharon_ja_clear_gift_of_tharon_ja();
|
||||
RegisterSpellScript(spell_tharon_ja_curse_of_life_aura);
|
||||
RegisterSpellScript(spell_tharon_ja_dummy_aura);
|
||||
RegisterSpellScript(spell_tharon_ja_clear_gift_of_tharon_ja);
|
||||
}
|
||||
|
||||
|
||||
@@ -171,92 +171,69 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_trollgore_consume : public SpellScriptLoader
|
||||
class spell_trollgore_consume : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_trollgore_consume() : SpellScriptLoader("spell_trollgore_consume") { }
|
||||
PrepareSpellScript(spell_trollgore_consume);
|
||||
|
||||
class spell_trollgore_consume_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_trollgore_consume_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_CONSUME_AURA });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_CONSUME_AURA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_trollgore_consume_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_trollgore_consume_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_CONSUME_AURA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_trollgore_consume::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_trollgore_corpse_explode : public SpellScriptLoader
|
||||
class spell_trollgore_corpse_explode_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_trollgore_corpse_explode() : SpellScriptLoader("spell_trollgore_corpse_explode") { }
|
||||
PrepareAuraScript(spell_trollgore_corpse_explode_aura);
|
||||
|
||||
class spell_trollgore_corpse_explode_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_trollgore_corpse_explode_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_CORPSE_EXPLODE_DAMAGE });
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTickNumber() == 2)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_CORPSE_EXPLODE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Creature* target = GetTarget()->ToCreature())
|
||||
target->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_trollgore_corpse_explode_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_trollgore_corpse_explode_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void PeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
return new spell_trollgore_corpse_explode_AuraScript();
|
||||
if (aurEff->GetTickNumber() == 2)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_CORPSE_EXPLODE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Creature* target = GetTarget()->ToCreature())
|
||||
target->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_trollgore_corpse_explode_aura::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_trollgore_corpse_explode_aura::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_trollgore_invader_taunt : public SpellScriptLoader
|
||||
class spell_trollgore_invader_taunt : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_trollgore_invader_taunt() : SpellScriptLoader("spell_trollgore_invader_taunt") { }
|
||||
PrepareSpellScript(spell_trollgore_invader_taunt);
|
||||
|
||||
class spell_trollgore_invader_taunt_SpellScript : public SpellScript
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_trollgore_invader_taunt_SpellScript);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_trollgore_invader_taunt_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_trollgore_invader_taunt_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_trollgore_invader_taunt::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -279,8 +256,8 @@ public:
|
||||
void AddSC_boss_trollgore()
|
||||
{
|
||||
new boss_trollgore();
|
||||
new spell_trollgore_consume();
|
||||
new spell_trollgore_corpse_explode();
|
||||
new spell_trollgore_invader_taunt();
|
||||
RegisterSpellScript(spell_trollgore_consume);
|
||||
RegisterSpellScript(spell_trollgore_corpse_explode_aura);
|
||||
RegisterSpellScript(spell_trollgore_invader_taunt);
|
||||
new achievement_consumption_junction();
|
||||
}
|
||||
|
||||
@@ -77,67 +77,50 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dtk_raise_dead : public SpellScriptLoader
|
||||
class spell_dtk_raise_dead_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_dtk_raise_dead() : SpellScriptLoader("spell_dtk_raise_dead") { }
|
||||
PrepareAuraScript(spell_dtk_raise_dead_aura);
|
||||
|
||||
class spell_dtk_raise_dead_AuraScript : public AuraScript
|
||||
bool Load() override
|
||||
{
|
||||
PrepareAuraScript(spell_dtk_raise_dead_AuraScript)
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->ToCreature()->DespawnOrUnsummon(1);
|
||||
GetUnitOwner()->SummonCreature(NPC_RISEN_DRAKKARI_WARRIOR, *GetUnitOwner());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dtk_raise_dead_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_dtk_raise_dead_AuraScript();
|
||||
GetUnitOwner()->ToCreature()->DespawnOrUnsummon(1);
|
||||
GetUnitOwner()->SummonCreature(NPC_RISEN_DRAKKARI_WARRIOR, *GetUnitOwner());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dtk_raise_dead_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dtk_summon_random_drakkari : public SpellScriptLoader
|
||||
class spell_dtk_summon_random_drakkari : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_dtk_summon_random_drakkari() : SpellScriptLoader("spell_dtk_summon_random_drakkari") { }
|
||||
PrepareSpellScript(spell_dtk_summon_random_drakkari);
|
||||
|
||||
class spell_dtk_summon_random_drakkari_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_dtk_summon_random_drakkari_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_DRAKKARI_SHAMAN, SPELL_SUMMON_DRAKKARI_GUARDIAN });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_DRAKKARI_SHAMAN, SPELL_SUMMON_DRAKKARI_GUARDIAN), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dtk_summon_random_drakkari_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_dtk_summon_random_drakkari_SpellScript();
|
||||
GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_DRAKKARI_SHAMAN, SPELL_SUMMON_DRAKKARI_GUARDIAN), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dtk_summon_random_drakkari::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_drak_tharon_keep()
|
||||
{
|
||||
new instance_drak_tharon_keep();
|
||||
new spell_dtk_raise_dead();
|
||||
new spell_dtk_summon_random_drakkari();
|
||||
RegisterSpellScript(spell_dtk_raise_dead_aura);
|
||||
RegisterSpellScript(spell_dtk_summon_random_drakkari);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user