Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
zone_bloodmyst_isle.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: Bloodmyst_Isle
8SD%Complete: 80
9SDComment: Quest support: 9670, 9756(gossip items text needed).
10SDCategory: Bloodmyst Isle
11EndScriptData */
12
13/* ContentData
14npc_webbed_creature
15npc_captured_sunhawk_agent
16EndContentData */
17
18#include "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "ScriptedGossip.h"
21#include "Player.h"
22
23/*######
24## npc_webbed_creature
25######*/
26
27//possible creatures to be spawned
28uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
29
31{
32public:
33 npc_webbed_creature() : CreatureScript("npc_webbed_creature") { }
34
36 {
37 return new npc_webbed_creatureAI(creature);
38 }
39
41 {
42 npc_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) { }
43
44 void Reset() OVERRIDE { }
45
46 void EnterCombat(Unit* /*who*/) OVERRIDE { }
47
48 void JustDied(Unit* killer) OVERRIDE
49 {
50 uint32 spawnCreatureID = 0;
51
52 switch (std::rand() % 2)
53 {
54 case 0:
55 spawnCreatureID = 17681;
56 if (Player* player = killer->ToPlayer())
57 player->KilledMonsterCredit(spawnCreatureID, 0);
58 break;
59 case 1:
60 case 2:
61 spawnCreatureID = possibleSpawns[std::rand() % 30];
62 break;
63 }
64
65 if (spawnCreatureID)
66 me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
67 }
68 };
69};
70
71/*######
72## npc_captured_sunhawk_agent
73######*/
74
75#define C_SUNHAWK_TRIGGER 17974
76
77#define GOSSIP_HELLO_CSA "[PH] "
78#define GOSSIP_SELECT_CSA1 "[PH] "
79#define GOSSIP_SELECT_CSA2 "[PH] "
80#define GOSSIP_SELECT_CSA3 "[PH] "
81#define GOSSIP_SELECT_CSA4 "[PH] "
82#define GOSSIP_SELECT_CSA5 "[PH] "
83
85{
86public:
87 npc_captured_sunhawk_agent() : CreatureScript("npc_captured_sunhawk_agent") { }
88
89 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
90 {
91 player->PlayerTalkClass->ClearMenus();
92 switch (action)
93 {
96 player->SEND_GOSSIP_MENU(9137, creature->GetGUID());
97 break;
100 player->SEND_GOSSIP_MENU(9138, creature->GetGUID());
101 break;
104 player->SEND_GOSSIP_MENU(9139, creature->GetGUID());
105 break;
108 player->SEND_GOSSIP_MENU(9140, creature->GetGUID());
109 break;
112 player->SEND_GOSSIP_MENU(9141, creature->GetGUID());
113 break;
115 player->CLOSE_GOSSIP_MENU();
116 player->TalkedToCreature(C_SUNHAWK_TRIGGER, creature->GetGUID());
117 break;
118 }
119 return true;
120 }
121
122 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
123 {
124 if (player->HasAura(31609) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
125 {
127 player->SEND_GOSSIP_MENU(9136, creature->GetGUID());
128 }
129 else
130 player->SEND_GOSSIP_MENU(9134, creature->GetGUID());
131
132 return true;
133 }
134};
135
136/*######
137## Quest 9667: Saving Princess Stillpine
138######*/
139
148
150{
151public:
152 go_princess_stillpines_cage() : GameObjectScript("go_princess_stillpines_cage") { }
153
155 {
156 go->SetGoState(GOState::GO_STATE_READY);
157 if (Creature* stillpine = go->FindNearestCreature(NPC_PRINCESS_STILLPINE, 25, true))
158 {
159 stillpine->GetMotionMaster()->MovePoint(1, go->GetPositionX(), go->GetPositionY()-15, go->GetPositionZ());
160 player->KilledMonsterCredit(NPC_PRINCESS_STILLPINE, stillpine->GetGUID());
161 }
162 return true;
163 }
164};
165
167{
168public:
169 npc_princess_stillpine() : CreatureScript("npc_princess_stillpine") { }
170
172 {
174
176 {
177 if (type == POINT_MOTION_TYPE && id == 1)
178 {
180 me->DespawnOrUnsummon();
181 }
182 }
183 };
184
186 {
187 return new npc_princess_stillpineAI(creature);
188 }
189};
190
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ GO_STATE_READY
Definition GameObject.h:577
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:46
@ POINT_MOTION_TYPE
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:71
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:89
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
CreatureScript(const char *name)
GameObjectScript(const char *name)
Player * ToPlayer()
Definition Object.h:204
Definition Unit.h:1367
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2801
bool OnGossipHello(Player *player, GameObject *go) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
ScriptedAI(Creature *creature)
void MovementInform(uint32 type, uint32 id) OVERRIDE
#define GOSSIP_SELECT_CSA3
#define GOSSIP_SELECT_CSA1
#define GOSSIP_SELECT_CSA5
#define GOSSIP_SELECT_CSA2
#define C_SUNHAWK_TRIGGER
void AddSC_bloodmyst_isle()
#define GOSSIP_SELECT_CSA4
uint32 const possibleSpawns[32]
#define GOSSIP_HELLO_CSA
@ GO_PRINCESS_STILLPINES_CAGE
@ QUEST_SAVING_PRINCESS_STILLPINE
@ NPC_PRINCESS_STILLPINE
@ SPELL_OPENING_PRINCESS_STILLPINE_CREDIT