Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
7SDName: Eastern_Plaguelands
8SD%Complete: 100
9SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched
10SDCategory: Eastern Plaguelands
11EndScriptData */
12
13/* ContentData
14npc_ghoul_flayer
15npc_augustus_the_touched
16npc_darrowshire_spirit
17npc_tirion_fordring
18EndContentData */
19
20#include "ScriptMgr.h"
21#include "ScriptedCreature.h"
22#include "ScriptedGossip.h"
23#include "Player.h"
24#include "WorldSession.h"
25
27{
28public:
29 npc_ghoul_flayer() : CreatureScript("npc_ghoul_flayer") { }
30
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
47 {
48 return new npc_ghoul_flayerAI(creature);
49 }
50};
51
52/*######
53## npc_augustus_the_touched
54######*/
55
57{
58public:
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))
76
77 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
78 return true;
79 }
80};
81
82/*######
83## npc_darrowshire_spirit
84######*/
85
90
92{
93public:
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
105 {
106 return new npc_darrowshire_spiritAI(creature);
107 }
108
110 {
112
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
133{
134public:
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 {
144 player->SEND_GOSSIP_MENU(4493, creature->GetGUID());
145 break;
148 player->SEND_GOSSIP_MENU(4494, creature->GetGUID());
149 break;
152 player->SEND_GOSSIP_MENU(4495, creature->GetGUID());
153 break;
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)
169
170 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
171
172 return true;
173 }
174};
175
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:46
@ GOSSIP_ICON_VENDOR
Definition GossipDef.h:47
@ TYPEID_PLAYER
Definition Object.h:55
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:89
#define GOSSIP_TEXT_BROWSE_GOODS
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_TRADE
@ GOSSIP_ACTION_INFO_DEF
@ UNIT_STAND_STATE_SIT
Definition Unit.h:163
@ UNIT_FLAG_NOT_SELECTABLE
Definition Unit.h:650
@ UNIT_FIELD_FLAGS
CreatureScript(const char *name)
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Definition Unit.h:1367
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
Creature * me
ScriptedAI(Creature *creature)
#define GOSSIP_HELLO
#define GOSSIP_SELECT1
void AddSC_eastern_plaguelands()
#define GOSSIP_SELECT3
#define GOSSIP_SELECT2