refactor(Scripts/RubySanctum): Spell Scripts registry macros (#19487)
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
--
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_meteor_strike_marker_aura' WHERE `spell_id`=74641 AND `ScriptName`='spell_halion_meteor_strike_marker';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_meteor_strike_spread_aura' WHERE `spell_id`=74696 AND `ScriptName`='spell_halion_meteor_strike_spread';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_soul_consumption_aura' WHERE `spell_id`=74792 AND `ScriptName`='spell_halion_soul_consumption';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_fiery_combustion_aura' WHERE `spell_id`=74562 AND `ScriptName`='spell_halion_fiery_combustion';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_soul_consumption_aura' WHERE `spell_id`=74792 AND `ScriptName`='spell_halion_soul_consumption';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_fiery_combustion_aura' WHERE `spell_id`=74562 AND `ScriptName`='spell_halion_fiery_combustion';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_mark_of_combustion_aura' WHERE `spell_id`=74567 AND `ScriptName`='spell_halion_mark_of_combustion';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_mark_of_consumption_aura' WHERE `spell_id`=74795 AND `ScriptName`='spell_halion_mark_of_consumption';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_twilight_realm_aura' WHERE `spell_id`=74807 AND `ScriptName`='spell_halion_twilight_realm';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_leave_twilight_realm_aura' WHERE `spell_id`=74812 AND `ScriptName`='spell_halion_leave_twilight_realm';
|
||||||
|
UPDATE `spell_script_names` SET `ScriptName`='spell_halion_twilight_cutter_periodic_aura' WHERE `spell_id`=74768 AND `ScriptName`='spell_halion_twilight_cutter_periodic';
|
||||||
+18
-24
@@ -334,34 +334,28 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_baltharus_enervating_brand_trigger : public SpellScriptLoader
|
class spell_baltharus_enervating_brand_trigger : public SpellScript
|
||||||
{
|
{
|
||||||
public:
|
PrepareSpellScript(spell_baltharus_enervating_brand_trigger);
|
||||||
spell_baltharus_enervating_brand_trigger() : SpellScriptLoader("spell_baltharus_enervating_brand_trigger") { }
|
|
||||||
|
|
||||||
class spell_baltharus_enervating_brand_trigger_SpellScript : public SpellScript
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||||
{
|
{
|
||||||
PrepareSpellScript(spell_baltharus_enervating_brand_trigger_SpellScript);
|
return ValidateSpellInfo({ SPELL_SIPHONED_MIGHT });
|
||||||
|
}
|
||||||
|
|
||||||
void CheckDistance()
|
void CheckDistance()
|
||||||
{
|
|
||||||
if (Unit* caster = GetOriginalCaster())
|
|
||||||
if (Unit* target = GetHitUnit())
|
|
||||||
if (target == GetCaster()
|
|
||||||
// the spell has an unlimited range, so we need this check
|
|
||||||
&& target->GetDistance2d(caster) <= 12.0f)
|
|
||||||
target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnHit += SpellHitFn(spell_baltharus_enervating_brand_trigger_SpellScript::CheckDistance);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
|
||||||
{
|
{
|
||||||
return new spell_baltharus_enervating_brand_trigger_SpellScript();
|
if (Unit* caster = GetOriginalCaster())
|
||||||
|
if (Unit* target = GetHitUnit())
|
||||||
|
if (target == GetCaster()
|
||||||
|
// the spell has an unlimited range, so we need this check
|
||||||
|
&& target->GetDistance2d(caster) <= 12.0f)
|
||||||
|
target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnHit += SpellHitFn(spell_baltharus_enervating_brand_trigger::CheckDistance);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -486,7 +480,7 @@ void AddSC_boss_baltharus_the_warborn()
|
|||||||
{
|
{
|
||||||
new boss_baltharus_the_warborn();
|
new boss_baltharus_the_warborn();
|
||||||
new npc_baltharus_the_warborn_clone();
|
new npc_baltharus_the_warborn_clone();
|
||||||
new spell_baltharus_enervating_brand_trigger();
|
RegisterSpellScript(spell_baltharus_enervating_brand_trigger);
|
||||||
new npc_xerestrasza();
|
new npc_xerestrasza();
|
||||||
new at_baltharus_plateau();
|
new at_baltharus_plateau();
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+24
-41
@@ -185,65 +185,48 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_saviana_conflagration_init : public SpellScriptLoader
|
class spell_saviana_conflagration_init : public SpellScript
|
||||||
{
|
{
|
||||||
public:
|
PrepareSpellScript(spell_saviana_conflagration_init);
|
||||||
spell_saviana_conflagration_init() : SpellScriptLoader("spell_saviana_conflagration_init") { }
|
|
||||||
|
|
||||||
class spell_saviana_conflagration_init_SpellScript : public SpellScript
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||||
{
|
{
|
||||||
PrepareSpellScript(spell_saviana_conflagration_init_SpellScript);
|
return ValidateSpellInfo({ SPELL_FLAME_BEACON, SPELL_CONFLAGRATION_MISSLE });
|
||||||
|
}
|
||||||
|
|
||||||
void HandleDummy(SpellEffIndex effIndex)
|
void HandleDummy(SpellEffIndex effIndex)
|
||||||
{
|
|
||||||
PreventHitDefaultEffect(effIndex);
|
|
||||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_FLAME_BEACON, true);
|
|
||||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_CONFLAGRATION_MISSLE, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_init_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
|
||||||
{
|
{
|
||||||
return new spell_saviana_conflagration_init_SpellScript();
|
PreventHitDefaultEffect(effIndex);
|
||||||
|
GetCaster()->CastSpell(GetHitUnit(), SPELL_FLAME_BEACON, true);
|
||||||
|
GetCaster()->CastSpell(GetHitUnit(), SPELL_CONFLAGRATION_MISSLE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_init::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_saviana_conflagration_throwback : public SpellScriptLoader
|
class spell_saviana_conflagration_throwback : public SpellScript
|
||||||
{
|
{
|
||||||
public:
|
PrepareSpellScript(spell_saviana_conflagration_throwback);
|
||||||
spell_saviana_conflagration_throwback() : SpellScriptLoader("spell_saviana_conflagration_throwback") { }
|
|
||||||
|
|
||||||
class spell_saviana_conflagration_throwback_SpellScript : public SpellScript
|
void HandleScript(SpellEffIndex effIndex)
|
||||||
{
|
{
|
||||||
PrepareSpellScript(spell_saviana_conflagration_throwback_SpellScript);
|
PreventHitDefaultEffect(effIndex);
|
||||||
|
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
|
||||||
|
}
|
||||||
|
|
||||||
void HandleScript(SpellEffIndex effIndex)
|
void Register() override
|
||||||
{
|
|
||||||
PreventHitDefaultEffect(effIndex);
|
|
||||||
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_throwback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
|
||||||
{
|
{
|
||||||
return new spell_saviana_conflagration_throwback_SpellScript();
|
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_throwback::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_saviana_ragefire()
|
void AddSC_boss_saviana_ragefire()
|
||||||
{
|
{
|
||||||
new boss_saviana_ragefire();
|
new boss_saviana_ragefire();
|
||||||
new spell_saviana_conflagration_init();
|
RegisterSpellScript(spell_saviana_conflagration_init);
|
||||||
new spell_saviana_conflagration_throwback();
|
RegisterSpellScript(spell_saviana_conflagration_throwback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-25
@@ -245,41 +245,35 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_ruby_sanctum_rallying_shout : public SpellScriptLoader
|
class spell_ruby_sanctum_rallying_shout : public SpellScript
|
||||||
{
|
{
|
||||||
public:
|
PrepareSpellScript(spell_ruby_sanctum_rallying_shout);
|
||||||
spell_ruby_sanctum_rallying_shout() : SpellScriptLoader("spell_ruby_sanctum_rallying_shout") { }
|
|
||||||
|
|
||||||
class spell_ruby_sanctum_rallying_shout_SpellScript : public SpellScript
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||||
{
|
{
|
||||||
PrepareSpellScript(spell_ruby_sanctum_rallying_shout_SpellScript);
|
return ValidateSpellInfo({ SPELL_RALLY });
|
||||||
|
}
|
||||||
|
|
||||||
void CountAllies()
|
void CountAllies()
|
||||||
{
|
|
||||||
uint32 count = GetSpell()->GetUniqueTargetInfo()->size();
|
|
||||||
if (count == GetCaster()->GetAuraCount(SPELL_RALLY))
|
|
||||||
return;
|
|
||||||
|
|
||||||
GetCaster()->RemoveAurasDueToSpell(SPELL_RALLY);
|
|
||||||
if (count > 0)
|
|
||||||
GetCaster()->CastCustomSpell(SPELL_RALLY, SPELLVALUE_AURA_STACK, count, GetCaster(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
AfterHit += SpellHitFn(spell_ruby_sanctum_rallying_shout_SpellScript::CountAllies);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
|
||||||
{
|
{
|
||||||
return new spell_ruby_sanctum_rallying_shout_SpellScript();
|
uint32 count = GetSpell()->GetUniqueTargetInfo()->size();
|
||||||
|
if (count == GetCaster()->GetAuraCount(SPELL_RALLY))
|
||||||
|
return;
|
||||||
|
|
||||||
|
GetCaster()->RemoveAurasDueToSpell(SPELL_RALLY);
|
||||||
|
if (count > 0)
|
||||||
|
GetCaster()->CastCustomSpell(SPELL_RALLY, SPELLVALUE_AURA_STACK, count, GetCaster(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
AfterHit += SpellHitFn(spell_ruby_sanctum_rallying_shout::CountAllies);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_instance_ruby_sanctum()
|
void AddSC_instance_ruby_sanctum()
|
||||||
{
|
{
|
||||||
new instance_ruby_sanctum();
|
new instance_ruby_sanctum();
|
||||||
new spell_ruby_sanctum_rallying_shout();
|
RegisterSpellScript(spell_ruby_sanctum_rallying_shout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user