Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
magisters_terrace.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: Magisters_Terrace
8SD%Complete: 100
9SDComment: Quest support: 11490(post-event)
10SDCategory: Magisters Terrace
11EndScriptData */
12
13/* ContentData
14npc_kalecgos
15EndContentData */
16
17#include "ScriptMgr.h"
18#include "ScriptedCreature.h"
19#include "ScriptedGossip.h"
20#include "Player.h"
21#include "SpellInfo.h"
22
23/*######
24## npc_kalecgos
25######*/
26
32
34{
35 NPC_KAEL = 24848 //human form entry
36};
37
38enum Misc
39{
41};
42
43const float afKaelLandPoint[] = {225.045f, -276.236f, -5.434f};
44
45#define GOSSIP_ITEM_KAEL_1 "Who are you?"
46#define GOSSIP_ITEM_KAEL_2 "What can we do to assist you?"
47#define GOSSIP_ITEM_KAEL_3 "What brings you to the Sunwell?"
48#define GOSSIP_ITEM_KAEL_4 "You're not alone here?"
49#define GOSSIP_ITEM_KAEL_5 "What would Kil'jaeden want with a mortal woman?"
50
51// This is friendly keal that appear after used Orb.
52// If we assume DB handle summon, summon appear somewhere outside the platform where Orb is
54{
55public:
56 npc_kalecgos() : CreatureScript("npc_kalecgos") { }
57
58 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
59 {
60 player->PlayerTalkClass->ClearMenus();
61 switch (action)
62 {
65 player->SEND_GOSSIP_MENU(12500, creature->GetGUID());
66 break;
69 player->SEND_GOSSIP_MENU(12502, creature->GetGUID());
70 break;
73 player->SEND_GOSSIP_MENU(12606, creature->GetGUID());
74 break;
77 player->SEND_GOSSIP_MENU(12607, creature->GetGUID());
78 break;
80 player->SEND_GOSSIP_MENU(12608, creature->GetGUID());
81 break;
82 }
83
84 return true;
85 }
86
87 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
88 {
89 if (creature->IsQuestGiver())
90 player->PrepareQuestMenu(creature->GetGUID());
91
93 player->SEND_GOSSIP_MENU(12498, creature->GetGUID());
94
95 return true;
96 }
97
99 {
100 return new npc_kalecgosAI(creature);
101 }
102
104 {
105 npc_kalecgosAI(Creature* creature) : ScriptedAI(creature) { }
106
108
110 {
112
113 // we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here
114 if (me->GetEntry() != NPC_KAEL)
115 me->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]);
116 }
117
118 void MovementInform(uint32 uiType, uint32 uiPointId) OVERRIDE
119 {
120 if (uiType != POINT_MOTION_TYPE)
121 return;
122
123 if (uiPointId == POINT_ID_LAND)
125 }
126
127 // some targeting issues with the spell, so use this workaround as temporary solution
129 {
130 Map* map = me->GetMap();
131
132 if (!map || map->IsHeroic())
133 return;
134
135 Map::PlayerList const &lList = map->GetPlayers();
136
137 if (lList.isEmpty())
138 return;
139
140 SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_ORB_KILL_CREDIT);
141
142 for (Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i)
143 {
144 if (Player* player = i->GetSource())
145 {
146 if (spell && spell->Effects[0].MiscValue)
147 player->KilledMonsterCredit(spell->Effects[0].MiscValue, 0);
148 }
149 }
150 }
151
153 {
155 {
156 if (m_uiTransformTimer <= uiDiff)
157 {
160
161 // Transform and update entry, now ready for quest/read gossip
163 me->UpdateEntry(NPC_KAEL);
164
166 } else m_uiTransformTimer -= uiDiff;
167 }
168 }
169 };
170};
171
173{
174 new npc_kalecgos();
175}
@ IN_MILLISECONDS
Definition Common.h:125
@ MINUTE
Definition Common.h:119
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:46
@ POINT_MOTION_TYPE
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
#define sSpellMgr
Definition SpellMgr.h:744
Creatures
CreatureScript(const char *name)
bool isEmpty() const
Definition LinkedList.h:86
Definition Map.h:238
MapRefManager PlayerList
Definition Map.h:406
bool IsHeroic() const
Definition Map.cpp:3044
PlayerList const & GetPlayers() const
Definition Map.h:407
iterator end()
iterator begin()
LinkedListHead::Iterator< MapReference const > const_iterator
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
Definition SpellInfo.h:255
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
const float afKaelLandPoint[]
#define GOSSIP_ITEM_KAEL_2
#define GOSSIP_ITEM_KAEL_1
@ POINT_ID_LAND
#define GOSSIP_ITEM_KAEL_5
@ SPELL_ORB_KILL_CREDIT
@ SPELL_TRANSFORM_TO_KAEL
#define GOSSIP_ITEM_KAEL_3
#define GOSSIP_ITEM_KAEL_4
void AddSC_magisters_terrace()
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
void MovementInform(uint32 uiType, uint32 uiPointId) OVERRIDE