fix(Scripts/Quest): improve Securing the Celestial Ridge (#17847)

* fix(Scripts/Quest): improve Securing the Celestial Ridge

* update
This commit is contained in:
Grimgravy
2024-01-08 15:46:05 -03:00
committed by GitHub
parent 9c95ac6d2e
commit db4a6bab34
2 changed files with 41 additions and 0 deletions

View File

@@ -950,6 +950,37 @@ class spell_q10190_battery_recharging_blaster_aura : public AuraScript
}
};
enum Veraku
{
NPC_VERAKU = 18544,
SPELL_CHALLENGE_VERAKU = 34895
};
class spell_challenge_veraku : public SpellScript
{
public:
PrepareSpellScript(spell_challenge_veraku);
bool Validate(SpellInfo const* /*SpellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CHALLENGE_VERAKU });
}
SpellCastResult CheckRequirement()
{
if (Unit* caster = GetCaster())
if (Creature* veraku = caster->FindNearestCreature(NPC_VERAKU, 100.0f))
if (!veraku->HasAura(SPELL_CHALLENGE_VERAKU))
return SPELL_FAILED_CASTER_AURASTATE;
return SPELL_CAST_OK;
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_challenge_veraku::CheckRequirement);
}
};
void AddSC_netherstorm()
{
// Ours
@@ -962,5 +993,6 @@ void AddSC_netherstorm()
new npc_bessy();
new npc_maxx_a_million_escort();
RegisterSpellAndAuraScriptPair(spell_q10190_battery_recharging_blaster, spell_q10190_battery_recharging_blaster_aura);
RegisterSpellScript(spell_challenge_veraku);
}