Skip to content

Commit

Permalink
fix(Scripts/Quest): improve Securing the Celestial Ridge (azerothcore…
Browse files Browse the repository at this point in the history
…#17847)

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

* update
  • Loading branch information
grimgravy authored Jan 8, 2024
1 parent 9c95ac6 commit db4a6ba
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
9 changes: 9 additions & 0 deletions data/sql/updates/pending_db_world/rev_1700913491921182500.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 18544);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(18544, 0, 0, 0, 1, 0, 100, 257, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 3832.74, 1448.12, -138.4, 0, 'Veraku - Out of Combat - Move To Position'),
(18544, 0, 1, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 0, 'Veraku - On Just Summoned - Start Attacking');

DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_challenge_veraku';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(34895, 'spell_challenge_veraku');
32 changes: 32 additions & 0 deletions src/server/scripts/Outland/zone_netherstorm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

0 comments on commit db4a6ba

Please sign in to comment.