Skip to content

Commit

Permalink
Icecrown: Implement initial code for subdue lithe stalker
Browse files Browse the repository at this point in the history
Co-Authored-By: Grz3s <Grz3s@users.noreply.github.com>
  • Loading branch information
killerwife and Grz3s committed Jan 2, 2025
1 parent fb6c253 commit 8311700
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions sql/scriptdev2/scriptdev2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ UPDATE creature_template SET ScriptName='npc_father_kamaros' WHERE entry IN (312
UPDATE creature_template SET ScriptName='npc_saronite_mine_slave' WHERE entry=31397;
UPDATE creature_template SET ScriptName='npc_grand_admiral_westwind' WHERE entry=29621;
UPDATE gameobject_template SET ScriptName='go_bloodstained_stone' WHERE entry IN (194023,194024,193980);
UPDATE creature_template SET ScriptName='npc_lithe_stalker_1' WHERE entry=30894;

/* IRONFORGE */

Expand Down
1 change: 1 addition & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(57667,'spell_frozen_siegebolt'),
(57669,'spell_replenishment'),
(57853,'spell_master_summoners_staff'),
(58151,'spell_subdued_lithe_stalker'),
(58203,'spell_iron_chain'),
(58418,'spell_portal_to_capital_city'),
(58420,'spell_portal_to_capital_city'),
Expand Down
77 changes: 77 additions & 0 deletions src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ EndContentData */

#include "AI/ScriptDevAI/include/sc_common.h"
#include "AI/ScriptDevAI/base/escort_ai.h"
#include "AI/BaseAI/PetAI.h"
#include "Entities/Vehicle.h"

/*######
Expand Down Expand Up @@ -1349,6 +1350,76 @@ struct SummonOminousCloud : public SpellScript
}
};

/*######
## npc_lithe_stalker
######*/

enum
{
NPC_LITHE_STALKER = 30894,

SPELL_SUBDUED_LITHE_STALKER = 58151, // Subdued Lithe Stalker
SPELL_CSA_DUMMY_EFFECT = 58178, // CSA Dummy Effect (25 yards)
SPELL_GEIST_RETURN_KILL_CREDIR = 58190,

SAY_AT50HP = 31580,
};

enum LitheStalkerActions
{
LITHER_STALKER_BELOW_50 = 0,
LITHER_STALKER_MAX,
};

// 58151 - Subdued Lithe Stalker
struct SubduedLitheStalker : public SpellScript, public AuraScript
{
SpellCastResult OnCheckCast(Spell* spell, bool /*strict*/) const override
{
Unit* target = spell->m_targets.getUnitTarget();
// Subdued Lithe Stalker can be cast only on less than 50% HP - 30894
if (target->GetHealthPercent() > 50.0f || !target || target->GetEntry() != NPC_LITHE_STALKER)
return SPELL_FAILED_BAD_TARGETS;

return SPELL_CAST_OK;
}
};

struct npc_lithe_stalker : public PetAI
{
npc_lithe_stalker(Creature* creature) : PetAI(creature, LITHER_STALKER_MAX)
{
AddTimerlessCombatAction(LITHER_STALKER_BELOW_50, true);
Reset();
}

bool CanHandleCharm() const override { return true; }

void ExecuteAction(uint32 action) override
{
switch (action)
{
case LITHER_STALKER_BELOW_50:
if (m_creature->GetHealthPercent() <= 50.0f)
{
DoBroadcastText(SAY_AT50HP, m_creature);
DisableCombatAction(action);
}
break;
}
}

void SpellHit(Unit* /*pCaster*/, const SpellEntry* pSpell) override
{
if (pSpell->Id == SPELL_CSA_DUMMY_EFFECT)
{
SetFollowMovement(false);
m_creature->CastSpell(nullptr, 58190, TRIGGERED_OLD_TRIGGERED);
// DO STUFF HERE
}
}
};

void AddSC_icecrown()
{
Script* pNewScript = new Script;
Expand Down Expand Up @@ -1385,6 +1456,11 @@ void AddSC_icecrown()
pNewScript->GetGameObjectAI = &GetNewAIInstance<go_bloodstained_stone>;
pNewScript->RegisterSelf();

pNewScript = new Script;
pNewScript->Name = "npc_lithe_stalker_1";
pNewScript->GetAI = &GetNewAIInstance<npc_lithe_stalker>;
pNewScript->RegisterSelf();

RegisterSpellScript<spell_create_lance>("spell_create_lance");
RegisterSpellScript<GrabCapturedCrusader>("spell_grab_captured_crusader");
RegisterSpellScript<DropOffCapturedCrusader>("spell_drop_off_captured_crusader");
Expand Down Expand Up @@ -1412,4 +1488,5 @@ void AddSC_icecrown()
RegisterSpellScript<ControlEidolonWatcher>("spell_control_eidolon_watcher");
RegisterSpellScript<IronChain>("spell_iron_chain");
RegisterSpellScript<SummonOminousCloud>("spell_summon_ominous_cloud");
RegisterSpellScript<SubduedLitheStalker>("spell_subdued_lithe_stalker");
}

0 comments on commit 8311700

Please sign in to comment.