Files
TCPlayerbotCore/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp
T

151 lines
4.9 KiB
C++
Raw Normal View History

/*
2020-01-02 06:44:10 +01:00
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2009-10-17 15:51:44 -07:00
/* ScriptData
SDName: Ghostlands
SD%Complete: 100
SDComment:
SDCategory: Ghostlands
EndScriptData */
2009-10-17 15:51:44 -07:00
/* ContentData
npc_ranger_lilatha
EndContentData */
2009-10-17 15:51:44 -07:00
#include "ScriptMgr.h"
2017-05-28 16:34:44 +02:00
#include "GameObject.h"
#include "Player.h"
2017-05-28 16:34:44 +02:00
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "TemporarySummon.h"
#include "WorldSession.h"
2009-10-17 15:51:44 -07:00
/*######
2009-10-17 15:51:44 -07:00
## npc_ranger_lilatha
######*/
2009-10-17 15:51:44 -07:00
2013-07-06 01:00:05 +02:00
enum RangerLilatha
2009-03-22 23:11:55 +01:00
{
SAY_START = 0,
SAY_PROGRESS1 = 1,
SAY_PROGRESS2 = 2,
SAY_PROGRESS3 = 3,
SAY_END1 = 4,
SAY_END2 = 5,
SAY_CAPTAIN_ANSWER = 0,
2009-03-22 23:11:55 +01:00
QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212,
GO_CAGE = 181152,
NPC_CAPTAIN_HELIOS = 16220,
NPC_MUMMIFIED_HEADHUNTER = 16342,
NPC_SHADOWPINE_ORACLE = 16343
2009-03-22 23:11:55 +01:00
};
class npc_ranger_lilatha : public CreatureScript
{
2010-08-08 22:54:58 +06:00
public:
npc_ranger_lilatha() : CreatureScript("npc_ranger_lilatha") { }
2009-10-17 15:51:44 -07:00
2017-08-12 01:40:25 +02:00
struct npc_ranger_lilathaAI : public EscortAI
2009-02-09 08:16:34 -05:00
{
2017-08-12 01:40:25 +02:00
npc_ranger_lilathaAI(Creature* creature) : EscortAI(creature) { }
2009-10-17 15:51:44 -07:00
2017-08-12 01:40:25 +02:00
void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
2009-02-09 08:16:34 -05:00
{
Player* player = GetPlayerForEscort();
if (!player)
2010-08-08 22:54:58 +06:00
return;
2012-03-29 15:44:24 +08:00
switch (waypointId)
2009-05-01 01:06:19 +02:00
{
case 0:
2019-06-03 20:40:34 +02:00
me->SetStandState(UNIT_STAND_STATE_STAND);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
2013-12-23 14:23:49 +01:00
Talk(SAY_START, player);
break;
case 5:
2013-12-23 14:23:49 +01:00
Talk(SAY_PROGRESS1, player);
break;
case 11:
2013-12-23 14:23:49 +01:00
Talk(SAY_PROGRESS2, player);
me->SetFacingTo(4.762841f);
break;
case 18:
{
2013-12-23 14:23:49 +01:00
Talk(SAY_PROGRESS3, player);
2017-05-28 16:34:44 +02:00
TempSummon* Summ1 = me->SummonCreature(NPC_MUMMIFIED_HEADHUNTER, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
TempSummon* Summ2 = me->SummonCreature(NPC_SHADOWPINE_ORACLE, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
Summ1->Attack(me, true);
Summ2->Attack(player, true);
}
2014-03-29 20:58:25 +01:00
AttackStart(Summ1);
}
break;
case 19:
me->SetWalk(false);
break;
case 25:
me->SetWalk(true);
break;
case 30:
2013-03-21 13:07:10 +01:00
player->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
break;
case 32:
me->SetFacingTo(2.978281f);
2013-12-23 14:23:49 +01:00
Talk(SAY_END1, player);
break;
case 33:
me->SetFacingTo(5.858011f);
2013-12-23 14:23:49 +01:00
Talk(SAY_END2, player);
Creature* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
2013-12-23 14:23:49 +01:00
CaptainHelios->AI()->Talk(SAY_CAPTAIN_ANSWER, player);
break;
2009-02-09 08:16:34 -05:00
}
}
2009-10-17 15:51:44 -07:00
void Reset() override
2010-08-08 22:54:58 +06:00
{
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_READY);
}
void QuestAccept(Player* player, Quest const* quest) override
2010-08-08 22:54:58 +06:00
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
Start(true, false, player->GetGUID());
}
2010-08-08 22:54:58 +06:00
}
};
2009-10-17 15:51:44 -07:00
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_ranger_lilathaAI(creature);
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
};
void AddSC_ghostlands()
{
2010-08-08 22:54:58 +06:00
new npc_ranger_lilatha();
}