Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
zone_eastern_plaguelands.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: Eastern_Plaguelands
8
SD%Complete: 100
9
SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched
10
SDCategory: Eastern Plaguelands
11
EndScriptData */
12
13
/* ContentData
14
npc_ghoul_flayer
15
npc_augustus_the_touched
16
npc_darrowshire_spirit
17
npc_tirion_fordring
18
EndContentData */
19
20
#include "
ScriptMgr.h
"
21
#include "
ScriptedCreature.h
"
22
#include "
ScriptedGossip.h
"
23
#include "
Player.h
"
24
#include "
WorldSession.h
"
25
26
class
npc_ghoul_flayer
:
public
CreatureScript
27
{
28
public
:
29
npc_ghoul_flayer
() :
CreatureScript
(
"npc_ghoul_flayer"
) { }
30
31
struct
npc_ghoul_flayerAI
:
public
ScriptedAI
32
{
33
npc_ghoul_flayerAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
34
35
void
Reset
()
OVERRIDE
{ }
36
37
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
38
39
void
JustDied
(
Unit
* killer)
OVERRIDE
40
{
41
if
(killer->GetTypeId() ==
TypeID::TYPEID_PLAYER
)
42
me
->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 60000);
43
}
44
};
45
46
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
47
{
48
return
new
npc_ghoul_flayerAI
(creature);
49
}
50
};
51
52
/*######
53
## npc_augustus_the_touched
54
######*/
55
56
class
npc_augustus_the_touched
:
public
CreatureScript
57
{
58
public
:
59
npc_augustus_the_touched
() :
CreatureScript
(
"npc_augustus_the_touched"
) { }
60
61
bool
OnGossipSelect
(
Player
* player,
Creature
* creature,
uint32
/*sender*/
,
uint32
action)
OVERRIDE
62
{
63
player->PlayerTalkClass->ClearMenus();
64
if
(action ==
GOSSIP_ACTION_TRADE
)
65
player->GetSession()->SendListInventory(creature->GetGUID());
66
return
true
;
67
}
68
69
bool
OnGossipHello
(
Player
* player,
Creature
* creature)
OVERRIDE
70
{
71
if
(creature->IsQuestGiver())
72
player->PrepareQuestMenu(creature->GetGUID());
73
74
if
(creature->IsVendor() && player->GetQuestRewardStatus(6164))
75
player->ADD_GOSSIP_ITEM(
GOSSIP_ICON_VENDOR
,
GOSSIP_TEXT_BROWSE_GOODS
,
GOSSIP_SENDER_MAIN
,
GOSSIP_ACTION_TRADE
);
76
77
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
78
return
true
;
79
}
80
};
81
82
/*######
83
## npc_darrowshire_spirit
84
######*/
85
86
enum
DarrowshireSpirit
87
{
88
SPELL_SPIRIT_SPAWNIN
= 17321
89
};
90
91
class
npc_darrowshire_spirit
:
public
CreatureScript
92
{
93
public
:
94
npc_darrowshire_spirit
() :
CreatureScript
(
"npc_darrowshire_spirit"
) { }
95
96
bool
OnGossipHello
(
Player
* player,
Creature
* creature)
OVERRIDE
97
{
98
player->SEND_GOSSIP_MENU(3873, creature->GetGUID());
99
player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
100
creature->SetFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NOT_SELECTABLE
);
101
return
true
;
102
}
103
104
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
105
{
106
return
new
npc_darrowshire_spiritAI
(creature);
107
}
108
109
struct
npc_darrowshire_spiritAI
:
public
ScriptedAI
110
{
111
npc_darrowshire_spiritAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
112
113
void
Reset
()
OVERRIDE
114
{
115
DoCast
(
me
,
SPELL_SPIRIT_SPAWNIN
);
116
me
->RemoveFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NOT_SELECTABLE
);
117
}
118
119
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
120
};
121
};
122
123
/*######
124
## npc_tirion_fordring
125
######*/
126
127
#define GOSSIP_HELLO "I am ready to hear your tale, Tirion."
128
#define GOSSIP_SELECT1 "Thank you, Tirion. What of your identity?"
129
#define GOSSIP_SELECT2 "That is terrible."
130
#define GOSSIP_SELECT3 "I will, Tirion."
131
132
class
npc_tirion_fordring
:
public
CreatureScript
133
{
134
public
:
135
npc_tirion_fordring
() :
CreatureScript
(
"npc_tirion_fordring"
) { }
136
137
bool
OnGossipSelect
(
Player
* player,
Creature
* creature,
uint32
/*sender*/
,
uint32
action)
OVERRIDE
138
{
139
player->PlayerTalkClass->ClearMenus();
140
switch
(action)
141
{
142
case
GOSSIP_ACTION_INFO_DEF
+1:
143
player->ADD_GOSSIP_ITEM(
GOSSIP_ICON_CHAT
,
GOSSIP_SELECT1
,
GOSSIP_SENDER_MAIN
,
GOSSIP_ACTION_INFO_DEF
+ 2);
144
player->SEND_GOSSIP_MENU(4493, creature->GetGUID());
145
break
;
146
case
GOSSIP_ACTION_INFO_DEF
+2:
147
player->ADD_GOSSIP_ITEM(
GOSSIP_ICON_CHAT
,
GOSSIP_SELECT2
,
GOSSIP_SENDER_MAIN
,
GOSSIP_ACTION_INFO_DEF
+ 3);
148
player->SEND_GOSSIP_MENU(4494, creature->GetGUID());
149
break
;
150
case
GOSSIP_ACTION_INFO_DEF
+3:
151
player->ADD_GOSSIP_ITEM(
GOSSIP_ICON_CHAT
,
GOSSIP_SELECT3
,
GOSSIP_SENDER_MAIN
,
GOSSIP_ACTION_INFO_DEF
+ 4);
152
player->SEND_GOSSIP_MENU(4495, creature->GetGUID());
153
break
;
154
case
GOSSIP_ACTION_INFO_DEF
+4:
155
player->CLOSE_GOSSIP_MENU();
156
player->AreaExploredOrEventHappens(5742);
157
break
;
158
}
159
return
true
;
160
}
161
162
bool
OnGossipHello
(
Player
* player,
Creature
* creature)
OVERRIDE
163
{
164
if
(creature->IsQuestGiver())
165
player->PrepareQuestMenu(creature->GetGUID());
166
167
if
(player->GetQuestStatus(5742) ==
QUEST_STATUS_INCOMPLETE
&& player->getStandState() ==
UNIT_STAND_STATE_SIT
)
168
player->ADD_GOSSIP_ITEM(
GOSSIP_ICON_CHAT
,
GOSSIP_HELLO
,
GOSSIP_SENDER_MAIN
,
GOSSIP_ACTION_INFO_DEF
+1);
169
170
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
171
172
return
true
;
173
}
174
};
175
176
void
AddSC_eastern_plaguelands
()
177
{
178
new
npc_ghoul_flayer
();
179
new
npc_augustus_the_touched
();
180
new
npc_darrowshire_spirit
();
181
new
npc_tirion_fordring
();
182
}
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
GOSSIP_ICON_CHAT
@ GOSSIP_ICON_CHAT
Definition
GossipDef.h:46
GOSSIP_ICON_VENDOR
@ GOSSIP_ICON_VENDOR
Definition
GossipDef.h:47
TypeID::TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
Object.h:55
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
Definition
Object.h:70
Player.h
QUEST_STATUS_INCOMPLETE
@ QUEST_STATUS_INCOMPLETE
Definition
QuestDef.h:89
ScriptMgr.h
ScriptedCreature.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
GOSSIP_ACTION_INFO_DEF
@ GOSSIP_ACTION_INFO_DEF
Definition
ScriptedGossip.h:56
UNIT_STAND_STATE_SIT
@ UNIT_STAND_STATE_SIT
Definition
Unit.h:163
UNIT_FLAG_NOT_SELECTABLE
@ UNIT_FLAG_NOT_SELECTABLE
Definition
Unit.h:650
UNIT_FIELD_FLAGS
@ UNIT_FIELD_FLAGS
Definition
UpdateFields.h:82
WorldSession.h
CreatureAI
Definition
CreatureAI.h:54
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
Player
Definition
Player.h:1289
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
Unit
Definition
Unit.h:1367
npc_augustus_the_touched
Definition
zone_eastern_plaguelands.cpp:57
npc_augustus_the_touched::OnGossipHello
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
Definition
zone_eastern_plaguelands.cpp:69
npc_augustus_the_touched::npc_augustus_the_touched
npc_augustus_the_touched()
Definition
zone_eastern_plaguelands.cpp:59
npc_augustus_the_touched::OnGossipSelect
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
Definition
zone_eastern_plaguelands.cpp:61
npc_darrowshire_spirit
Definition
zone_eastern_plaguelands.cpp:92
npc_darrowshire_spirit::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
zone_eastern_plaguelands.cpp:104
npc_darrowshire_spirit::OnGossipHello
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
Definition
zone_eastern_plaguelands.cpp:96
npc_darrowshire_spirit::npc_darrowshire_spirit
npc_darrowshire_spirit()
Definition
zone_eastern_plaguelands.cpp:94
npc_ghoul_flayer
Definition
zone_eastern_plaguelands.cpp:27
npc_ghoul_flayer::npc_ghoul_flayer
npc_ghoul_flayer()
Definition
zone_eastern_plaguelands.cpp:29
npc_ghoul_flayer::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
zone_eastern_plaguelands.cpp:46
npc_tirion_fordring
Definition
zone_eastern_plaguelands.cpp:133
npc_tirion_fordring::OnGossipSelect
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
Definition
zone_eastern_plaguelands.cpp:137
npc_tirion_fordring::npc_tirion_fordring
npc_tirion_fordring()
Definition
zone_eastern_plaguelands.cpp:135
npc_tirion_fordring::OnGossipHello
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
Definition
zone_eastern_plaguelands.cpp:162
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
npc_darrowshire_spirit::npc_darrowshire_spiritAI
Definition
zone_eastern_plaguelands.cpp:110
npc_darrowshire_spirit::npc_darrowshire_spiritAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
zone_eastern_plaguelands.cpp:119
npc_darrowshire_spirit::npc_darrowshire_spiritAI::npc_darrowshire_spiritAI
npc_darrowshire_spiritAI(Creature *creature)
Definition
zone_eastern_plaguelands.cpp:111
npc_darrowshire_spirit::npc_darrowshire_spiritAI::Reset
void Reset() OVERRIDE
Definition
zone_eastern_plaguelands.cpp:113
npc_ghoul_flayer::npc_ghoul_flayerAI
Definition
zone_eastern_plaguelands.cpp:32
npc_ghoul_flayer::npc_ghoul_flayerAI::npc_ghoul_flayerAI
npc_ghoul_flayerAI(Creature *creature)
Definition
zone_eastern_plaguelands.cpp:33
npc_ghoul_flayer::npc_ghoul_flayerAI::Reset
void Reset() OVERRIDE
Definition
zone_eastern_plaguelands.cpp:35
npc_ghoul_flayer::npc_ghoul_flayerAI::JustDied
void JustDied(Unit *killer) OVERRIDE
Definition
zone_eastern_plaguelands.cpp:39
npc_ghoul_flayer::npc_ghoul_flayerAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
zone_eastern_plaguelands.cpp:37
GOSSIP_HELLO
#define GOSSIP_HELLO
Definition
zone_eastern_plaguelands.cpp:127
DarrowshireSpirit
DarrowshireSpirit
Definition
zone_eastern_plaguelands.cpp:87
SPELL_SPIRIT_SPAWNIN
@ SPELL_SPIRIT_SPAWNIN
Definition
zone_eastern_plaguelands.cpp:88
GOSSIP_SELECT1
#define GOSSIP_SELECT1
Definition
zone_eastern_plaguelands.cpp:128
AddSC_eastern_plaguelands
void AddSC_eastern_plaguelands()
Definition
zone_eastern_plaguelands.cpp:176
GOSSIP_SELECT3
#define GOSSIP_SELECT3
Definition
zone_eastern_plaguelands.cpp:130
GOSSIP_SELECT2
#define GOSSIP_SELECT2
Definition
zone_eastern_plaguelands.cpp:129
src
server
scripts
EasternKingdoms
zone_eastern_plaguelands.cpp
Generated on
for Project SkyFire Core by
1.17.0