mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Scripts/Quest: Update & convert to SAI 'The Escape' (#31160)
This commit is contained in:
@@ -466,161 +466,9 @@ public:
|
||||
|
||||
};
|
||||
|
||||
/*#####
|
||||
## npc_wizzlecrank_shredder
|
||||
#####*/
|
||||
|
||||
enum Wizzlecrank
|
||||
{
|
||||
SAY_MERCENARY = 0,
|
||||
SAY_START = 0,
|
||||
SAY_STARTUP1 = 1,
|
||||
SAY_STARTUP2 = 2,
|
||||
SAY_PROGRESS_1 = 3,
|
||||
SAY_PROGRESS_2 = 4,
|
||||
SAY_PROGRESS_3 = 5,
|
||||
SAY_END = 6,
|
||||
|
||||
QUEST_ESCAPE = 863,
|
||||
NPC_PILOT_WIZZ = 3451,
|
||||
NPC_MERCENARY = 3282,
|
||||
};
|
||||
|
||||
class npc_wizzlecrank_shredder : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_wizzlecrank_shredder() : CreatureScript("npc_wizzlecrank_shredder") { }
|
||||
|
||||
struct npc_wizzlecrank_shredderAI : public EscortAI
|
||||
{
|
||||
npc_wizzlecrank_shredderAI(Creature* creature) : EscortAI(creature)
|
||||
{
|
||||
IsPostEvent = false;
|
||||
PostEventTimer = 1000;
|
||||
PostEventCount = 0;
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
}
|
||||
|
||||
bool IsPostEvent;
|
||||
uint32 PostEventTimer;
|
||||
uint32 PostEventCount;
|
||||
|
||||
void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
|
||||
{
|
||||
switch (waypointId)
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_STARTUP1);
|
||||
break;
|
||||
case 9:
|
||||
SetRun(false);
|
||||
break;
|
||||
case 17:
|
||||
if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 2min))
|
||||
{
|
||||
temp->AI()->Talk(SAY_MERCENARY);
|
||||
me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 2min);
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
IsPostEvent = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointStarted(uint32 PointId, uint32 /*pathId*/) override
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (PointId)
|
||||
{
|
||||
case 9:
|
||||
Talk(SAY_STARTUP2, player);
|
||||
break;
|
||||
case 18:
|
||||
Talk(SAY_PROGRESS_1, player);
|
||||
SetRun();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) override
|
||||
{
|
||||
if (summoned->GetEntry() == NPC_PILOT_WIZZ)
|
||||
me->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
|
||||
if (summoned->GetEntry() == NPC_MERCENARY)
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void UpdateEscortAI(uint32 Diff) override
|
||||
{
|
||||
if (UpdateVictim())
|
||||
{
|
||||
DoMeleeAttackIfReady();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsPostEvent)
|
||||
return;
|
||||
|
||||
if (PostEventTimer > Diff)
|
||||
{
|
||||
PostEventTimer -= Diff;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (PostEventCount)
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_PROGRESS_2);
|
||||
break;
|
||||
case 1:
|
||||
Talk(SAY_PROGRESS_3);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_END);
|
||||
break;
|
||||
case 3:
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
{
|
||||
player->GroupEventHappens(QUEST_ESCAPE, me);
|
||||
me->DespawnOrUnsummon(5min);
|
||||
me->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 3min);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
++PostEventCount;
|
||||
PostEventTimer = 5000;
|
||||
}
|
||||
|
||||
void OnQuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE)
|
||||
{
|
||||
me->SetFaction(FACTION_RATCHET);
|
||||
Talk(SAY_START);
|
||||
SetDespawnAtEnd(false);
|
||||
Start(true, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_wizzlecrank_shredderAI(creature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void AddSC_the_barrens()
|
||||
{
|
||||
new npc_gilthares();
|
||||
new npc_taskmaster_fizzule();
|
||||
new npc_twiggy_flathead();
|
||||
new npc_wizzlecrank_shredder();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user