mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 19:31:59 +01:00
DB/Quest: Convert & update support for 'Mark V is Alive!' to SAI
Closes #24686
(cherry picked from commit e48c415156)
This commit is contained in:
@@ -24,7 +24,6 @@ EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_commander_dawnforge
|
||||
npc_maxx_a_million
|
||||
go_captain_tyralius_prison
|
||||
EndContentData */
|
||||
|
||||
@@ -468,113 +467,6 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_maxx_a_million
|
||||
######*/
|
||||
|
||||
enum MaxxAMillion
|
||||
{
|
||||
QUEST_MARK_V_IS_ALIVE = 10191,
|
||||
GO_DRAENEI_MACHINE = 183771
|
||||
};
|
||||
|
||||
class npc_maxx_a_million_escort : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_maxx_a_million_escort() : CreatureScript("npc_maxx_a_million_escort") { }
|
||||
|
||||
struct npc_maxx_a_million_escortAI : public EscortAI
|
||||
{
|
||||
npc_maxx_a_million_escortAI(Creature* creature) : EscortAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
bTake = false;
|
||||
uiTakeTimer = 3000;
|
||||
}
|
||||
|
||||
bool bTake;
|
||||
uint32 uiTakeTimer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 7:
|
||||
case 17:
|
||||
case 29:
|
||||
//Find Object and "work"
|
||||
if (GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE))
|
||||
{
|
||||
// take the GO -> animation
|
||||
me->HandleEmoteCommand(EMOTE_STATE_LOOT);
|
||||
SetEscortPaused(true);
|
||||
bTake = true;
|
||||
}
|
||||
break;
|
||||
case 36: //return and quest_complete
|
||||
player->CompleteQuest(QUEST_MARK_V_IS_ALIVE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
player->FailQuest(QUEST_MARK_V_IS_ALIVE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 uiDiff) override
|
||||
{
|
||||
EscortAI::UpdateAI(uiDiff);
|
||||
|
||||
if (bTake)
|
||||
{
|
||||
if (uiTakeTimer < uiDiff)
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_STATE_NONE);
|
||||
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE))
|
||||
{
|
||||
SetEscortPaused(false);
|
||||
bTake = false;
|
||||
uiTakeTimer = 3000;
|
||||
go->Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
uiTakeTimer -= uiDiff;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_MARK_V_IS_ALIVE)
|
||||
{
|
||||
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
Start(false, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_maxx_a_million_escortAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## go_captain_tyralius_prison
|
||||
######*/
|
||||
@@ -674,7 +566,6 @@ void AddSC_netherstorm()
|
||||
new npc_commander_dawnforge();
|
||||
new at_commander_dawnforge();
|
||||
new npc_phase_hunter();
|
||||
new npc_maxx_a_million_escort();
|
||||
new go_captain_tyralius_prison();
|
||||
new npc_captain_tyralius();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user