mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +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:
@@ -734,104 +734,81 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_eadric_radiance : public SpellScriptLoader
|
||||
class spell_eadric_radiance : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_eadric_radiance() : SpellScriptLoader("spell_eadric_radiance") { }
|
||||
PrepareSpellScript(spell_eadric_radiance);
|
||||
|
||||
class spell_eadric_radiance_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_eadric_radiance_SpellScript);
|
||||
std::list<WorldObject*> tmplist;
|
||||
for( std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
if( (*itr)->ToUnit()->HasInArc(M_PI, GetCaster()) )
|
||||
tmplist.push_back(*itr);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
std::list<WorldObject*> tmplist;
|
||||
for( std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
if( (*itr)->ToUnit()->HasInArc(M_PI, GetCaster()) )
|
||||
tmplist.push_back(*itr);
|
||||
targets.clear();
|
||||
for( std::list<WorldObject*>::iterator itr = tmplist.begin(); itr != tmplist.end(); ++itr )
|
||||
targets.push_back(*itr);
|
||||
}
|
||||
|
||||
targets.clear();
|
||||
for( std::list<WorldObject*>::iterator itr = tmplist.begin(); itr != tmplist.end(); ++itr )
|
||||
targets.push_back(*itr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_eadric_radiance_SpellScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_toc5_light_rain : public SpellScriptLoader
|
||||
class spell_toc5_light_rain : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_toc5_light_rain() : SpellScriptLoader("spell_toc5_light_rain") { }
|
||||
PrepareSpellScript(spell_toc5_light_rain);
|
||||
|
||||
class spell_toc5_light_rain_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_toc5_light_rain_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
for( std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); )
|
||||
{
|
||||
for( std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); )
|
||||
{
|
||||
if ((*itr)->GetTypeId() == TYPEID_UNIT)
|
||||
if ((*itr)->ToCreature()->GetEntry() == NPC_FOUNTAIN_OF_LIGHT)
|
||||
{
|
||||
targets.erase(itr);
|
||||
itr = targets.begin();
|
||||
continue;
|
||||
}
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_toc5_light_rain_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_toc5_light_rain_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reflective_shield : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_reflective_shield() : SpellScriptLoader("spell_reflective_shield") { }
|
||||
|
||||
class spell_reflective_shield_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reflective_shield_AuraScript)
|
||||
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
if( Unit* attacker = dmgInfo.GetAttacker() )
|
||||
if( GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID() )
|
||||
if ((*itr)->GetTypeId() == TYPEID_UNIT)
|
||||
if ((*itr)->ToCreature()->GetEntry() == NPC_FOUNTAIN_OF_LIGHT)
|
||||
{
|
||||
int32 damage = (int32)(absorbAmount * 0.25f);
|
||||
GetOwner()->ToUnit()->CastCustomSpell(attacker, 33619, &damage, nullptr, nullptr, true);
|
||||
targets.erase(itr);
|
||||
itr = targets.begin();
|
||||
continue;
|
||||
}
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_reflective_shield_AuraScript::HandleAfterEffectAbsorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_reflective_shield_AuraScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_toc5_light_rain::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
enum ReflectiveShield
|
||||
{
|
||||
SPELL_REFLECTIVE_SHIELD_DAMAGE = 33619
|
||||
};
|
||||
|
||||
class spell_reflective_shield_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reflective_shield_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_REFLECTIVE_SHIELD_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
if( Unit* attacker = dmgInfo.GetAttacker() )
|
||||
if( GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID() )
|
||||
{
|
||||
int32 damage = (int32)(absorbAmount * 0.25f);
|
||||
GetOwner()->ToUnit()->CastCustomSpell(attacker, SPELL_REFLECTIVE_SHIELD_DAMAGE, &damage, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_reflective_shield_aura::HandleAfterEffectAbsorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -841,8 +818,8 @@ void AddSC_boss_argent_challenge()
|
||||
new boss_paletress();
|
||||
new npc_memory();
|
||||
new npc_argent_soldier();
|
||||
new spell_eadric_radiance();
|
||||
new spell_toc5_light_rain();
|
||||
new spell_reflective_shield();
|
||||
RegisterSpellScript(spell_eadric_radiance);
|
||||
RegisterSpellScript(spell_toc5_light_rain);
|
||||
RegisterSpellScript(spell_reflective_shield_aura);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user