Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
zone_ghostlands.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Ghostlands
8SD%Complete: 100
9SDComment:
10SDCategory: Ghostlands
11EndScriptData */
12
13/* ContentData
14npc_rathis_tomber
15npc_ranger_lilatha
16EndContentData */
17
18#include "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "ScriptedGossip.h"
21#include "ScriptedEscortAI.h"
22#include "Player.h"
23#include "WorldSession.h"
24
25/*######
26## npc_rathis_tomber
27######*/
28
30{
31public:
32 npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { }
33
34 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
35 {
36 player->PlayerTalkClass->ClearMenus();
37 if (action == GOSSIP_ACTION_TRADE)
38 player->GetSession()->SendListInventory(creature->GetGUID());
39 return true;
40 }
41
42 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
43 {
44 if (creature->IsQuestGiver())
45 player->PrepareQuestMenu(creature->GetGUID());
46
47 if (creature->IsVendor() && player->GetQuestRewardStatus(9152))
48 {
50 player->SEND_GOSSIP_MENU(8432, creature->GetGUID());
51 }
52 else
53 player->SEND_GOSSIP_MENU(8431, creature->GetGUID());
54
55 return true;
56 }
57};
58
59/*######
60## npc_ranger_lilatha
61######*/
62
64{
65 // Yells
73
74 // Quests
76
77 // Gameobjects
78 GO_CAGE = 181152,
79
80 // Creature
82
83 // Factions
85};
86
88{
89public:
90 npc_ranger_lilatha() : CreatureScript("npc_ranger_lilatha") { }
91
93 {
94 npc_ranger_lilathaAI(Creature* creature) : npc_escortAI(creature) { }
95
97 {
98 Player* player = GetPlayerForEscort();
99 if (!player)
100 return;
101
102 switch (waypointId)
103 {
104 case 0:
105 me->SetUInt32Value(UNIT_FIELD_ANIM_TIER, 0);
106 if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
107 Cage->SetGoState(GOState::GO_STATE_ACTIVE);
108 Talk(SAY_START, player);
109 break;
110 case 5:
111 Talk(SAY_PROGRESS1, player);
112 break;
113 case 11:
114 Talk(SAY_PROGRESS2, player);
115 me->SetOrientation(4.762841f);
116 break;
117 case 18:
118 {
119 Talk(SAY_PROGRESS3, player);
120 Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TempSummonType::TEMPSUMMON_DEAD_DESPAWN, 0);
121 Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TempSummonType::TEMPSUMMON_DEAD_DESPAWN, 0);
122 if (Summ1 && Summ2)
123 {
124 Summ1->Attack(me, true);
125 Summ2->Attack(player, true);
126 }
127 me->AI()->AttackStart(Summ1);
128 }
129 break;
130 case 19:
131 me->SetWalk(false);
132 break;
133 case 25:
134 me->SetWalk(true);
135 break;
136 case 30:
138 break;
139 case 32:
140 me->SetOrientation(2.978281f);
141 Talk(SAY_END1, player);
142 break;
143 case 33:
144 me->SetOrientation(5.858011f);
145 Talk(SAY_END2, player);
146 Creature* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
147 if (CaptainHelios)
148 CaptainHelios->AI()->Talk(SAY_CAPTAIN_ANSWER, player);
149 break;
150 }
151 }
152
154 {
155 if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
156 Cage->SetGoState(GOState::GO_STATE_READY);
157 }
158 };
159
160 bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
161 {
162 if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
163 {
164 creature->setFaction(113);
165
166 if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI()))
167 pEscortAI->Start(true, false, player->GetGUID());
168 }
169 return true;
170 }
171
173 {
174 return new npc_ranger_lilathaAI(creature);
175 }
176};
177
179{
180 new npc_rathis_tomber();
181 new npc_ranger_lilatha();
182}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ GO_STATE_ACTIVE
Definition GameObject.h:576
@ GO_STATE_READY
Definition GameObject.h:577
@ GOSSIP_ICON_VENDOR
Definition GossipDef.h:47
@ TEMPSUMMON_DEAD_DESPAWN
Definition Object.h:74
#define CAST_AI(a, b)
#define GOSSIP_TEXT_BROWSE_GOODS
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_TRADE
@ UNIT_FIELD_ANIM_TIER
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
CreatureAI * AI() const
Definition Creature.h:483
CreatureScript(const char *name)
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
bool Attack(Unit *victim, bool meleeAttack)
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnQuestAccept(Player *player, Creature *creature, Quest const *quest) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
Creature * me
Player * GetPlayerForEscort()
npc_escortAI(Creature *creature)
void WaypointReached(uint32 waypointId) OVERRIDE
void AddSC_ghostlands()
RangerLilatha
@ SAY_PROGRESS1
@ SAY_START
@ SAY_PROGRESS3
@ SAY_PROGRESS2
@ SAY_END1
@ SAY_END2
@ GO_CAGE
@ FACTION_SMOON_E
@ QUEST_ESCAPE_FROM_THE_CATACOMBS
@ NPC_CAPTAIN_HELIOS
@ SAY_CAPTAIN_ANSWER