Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
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
7
SDName: Ghostlands
8
SD%Complete: 100
9
SDComment:
10
SDCategory: Ghostlands
11
EndScriptData */
12
13
/* ContentData
14
npc_rathis_tomber
15
npc_ranger_lilatha
16
EndContentData */
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
29
class
npc_rathis_tomber
:
public
CreatureScript
30
{
31
public
:
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
{
49
player->ADD_GOSSIP_ITEM(
GOSSIP_ICON_VENDOR
,
GOSSIP_TEXT_BROWSE_GOODS
,
GOSSIP_SENDER_MAIN
,
GOSSIP_ACTION_TRADE
);
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
63
enum
RangerLilatha
64
{
65
// Yells
66
SAY_START
= 0,
67
SAY_PROGRESS1
= 1,
68
SAY_PROGRESS2
= 2,
69
SAY_PROGRESS3
= 3,
70
SAY_END1
= 4,
71
SAY_END2
= 5,
72
SAY_CAPTAIN_ANSWER
= 0,
73
74
// Quests
75
QUEST_ESCAPE_FROM_THE_CATACOMBS
= 9212,
76
77
// Gameobjects
78
GO_CAGE
= 181152,
79
80
// Creature
81
NPC_CAPTAIN_HELIOS
= 16220,
82
83
// Factions
84
FACTION_SMOON_E
= 1603
85
};
86
87
class
npc_ranger_lilatha
:
public
CreatureScript
88
{
89
public
:
90
npc_ranger_lilatha
() :
CreatureScript
(
"npc_ranger_lilatha"
) { }
91
92
struct
npc_ranger_lilathaAI
:
public
npc_escortAI
93
{
94
npc_ranger_lilathaAI
(
Creature
* creature) :
npc_escortAI
(creature) { }
95
96
void
WaypointReached
(
uint32
waypointId)
OVERRIDE
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:
137
player->
GroupEventHappens
(
QUEST_ESCAPE_FROM_THE_CATACOMBS
,
me
);
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
153
void
Reset
()
OVERRIDE
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
172
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
173
{
174
return
new
npc_ranger_lilathaAI
(creature);
175
}
176
};
177
178
void
AddSC_ghostlands
()
179
{
180
new
npc_rathis_tomber
();
181
new
npc_ranger_lilatha
();
182
}
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
GOState::GO_STATE_ACTIVE
@ GO_STATE_ACTIVE
Definition
GameObject.h:576
GOState::GO_STATE_READY
@ GO_STATE_READY
Definition
GameObject.h:577
GOSSIP_ICON_VENDOR
@ GOSSIP_ICON_VENDOR
Definition
GossipDef.h:47
TempSummonType::TEMPSUMMON_DEAD_DESPAWN
@ TEMPSUMMON_DEAD_DESPAWN
Definition
Object.h:74
Player.h
ScriptMgr.h
ScriptedCreature.h
CAST_AI
#define CAST_AI(a, b)
Definition
ScriptedCreature.h:14
ScriptedEscortAI.h
ScriptedGossip.h
GOSSIP_TEXT_BROWSE_GOODS
#define GOSSIP_TEXT_BROWSE_GOODS
Definition
ScriptedGossip.h:13
GOSSIP_SENDER_MAIN
@ GOSSIP_SENDER_MAIN
Definition
ScriptedGossip.h:58
GOSSIP_ACTION_TRADE
@ GOSSIP_ACTION_TRADE
Definition
ScriptedGossip.h:44
UNIT_FIELD_ANIM_TIER
@ UNIT_FIELD_ANIM_TIER
Definition
UpdateFields.h:96
WorldSession.h
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
Creature
Definition
Creature.h:427
Creature::AI
CreatureAI * AI() const
Definition
Creature.h:483
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
GameObject
Definition
GameObject.h:629
Player
Definition
Player.h:1289
Player::GroupEventHappens
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
Definition
PlayerQuestState.cpp:1593
Quest
Definition
QuestDef.h:255
Unit::Attack
bool Attack(Unit *victim, bool meleeAttack)
Definition
UnitCombatState.cpp:74
npc_ranger_lilatha
Definition
zone_ghostlands.cpp:88
npc_ranger_lilatha::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
zone_ghostlands.cpp:172
npc_ranger_lilatha::npc_ranger_lilatha
npc_ranger_lilatha()
Definition
zone_ghostlands.cpp:90
npc_ranger_lilatha::OnQuestAccept
bool OnQuestAccept(Player *player, Creature *creature, Quest const *quest) OVERRIDE
Definition
zone_ghostlands.cpp:160
npc_rathis_tomber
Definition
zone_ghostlands.cpp:30
npc_rathis_tomber::npc_rathis_tomber
npc_rathis_tomber()
Definition
zone_ghostlands.cpp:32
npc_rathis_tomber::OnGossipHello
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
Definition
zone_ghostlands.cpp:42
npc_rathis_tomber::OnGossipSelect
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
Definition
zone_ghostlands.cpp:34
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
npc_escortAI
Definition
ScriptedEscortAI.h:41
npc_escortAI::GetPlayerForEscort
Player * GetPlayerForEscort()
Definition
ScriptedEscortAI.h:97
npc_escortAI::npc_escortAI
npc_escortAI(Creature *creature)
Definition
ScriptedEscortAI.cpp:24
npc_ranger_lilatha::npc_ranger_lilathaAI
Definition
zone_ghostlands.cpp:93
npc_ranger_lilatha::npc_ranger_lilathaAI::Reset
void Reset() OVERRIDE
Definition
zone_ghostlands.cpp:153
npc_ranger_lilatha::npc_ranger_lilathaAI::npc_ranger_lilathaAI
npc_ranger_lilathaAI(Creature *creature)
Definition
zone_ghostlands.cpp:94
npc_ranger_lilatha::npc_ranger_lilathaAI::WaypointReached
void WaypointReached(uint32 waypointId) OVERRIDE
Definition
zone_ghostlands.cpp:96
AddSC_ghostlands
void AddSC_ghostlands()
Definition
zone_ghostlands.cpp:178
RangerLilatha
RangerLilatha
Definition
zone_ghostlands.cpp:64
SAY_PROGRESS1
@ SAY_PROGRESS1
Definition
zone_ghostlands.cpp:67
SAY_START
@ SAY_START
Definition
zone_ghostlands.cpp:66
SAY_PROGRESS3
@ SAY_PROGRESS3
Definition
zone_ghostlands.cpp:69
SAY_PROGRESS2
@ SAY_PROGRESS2
Definition
zone_ghostlands.cpp:68
SAY_END1
@ SAY_END1
Definition
zone_ghostlands.cpp:70
SAY_END2
@ SAY_END2
Definition
zone_ghostlands.cpp:71
GO_CAGE
@ GO_CAGE
Definition
zone_ghostlands.cpp:78
FACTION_SMOON_E
@ FACTION_SMOON_E
Definition
zone_ghostlands.cpp:84
QUEST_ESCAPE_FROM_THE_CATACOMBS
@ QUEST_ESCAPE_FROM_THE_CATACOMBS
Definition
zone_ghostlands.cpp:75
NPC_CAPTAIN_HELIOS
@ NPC_CAPTAIN_HELIOS
Definition
zone_ghostlands.cpp:81
SAY_CAPTAIN_ANSWER
@ SAY_CAPTAIN_ANSWER
Definition
zone_ghostlands.cpp:72
src
server
scripts
EasternKingdoms
zone_ghostlands.cpp
Generated on
for Project SkyFire Core by
1.17.0