Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_gal_darah.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#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
8#include "gundrak.h"
9
10//Spells
25
26//Yells
36
38{
41};
42
48
49enum Misc
50{
52};
53
55{
56public:
57 boss_gal_darah() : CreatureScript("boss_gal_darah") { }
58
60 {
61 return new boss_gal_darahAI(creature);
62 }
63
65 {
66 boss_gal_darahAI(Creature* creature) : ScriptedAI(creature)
67 {
68 instance = creature->GetInstanceScript();
69 }
70
78 std::list<uint64> impaledList;
80
82
84
86
88
112
113 void EnterCombat(Unit* /*who*/) OVERRIDE
114 {
116
117 if (instance)
119 }
120
122 {
123 if (!UpdateVictim())
124 return;
125
126 switch (Phase)
127 {
128 case TROLL:
129 if (uiPhaseCounter == 2)
130 {
131 if (uiTransformationTimer <= diff)
132 {
133 me->SetDisplayId(DISPLAY_RHINO);
134 Phase = RHINO;
135 uiPhaseCounter = 0;
139 me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
140 me->SetReactState(REACT_AGGRESSIVE);
141 }
142 else
143 {
144 uiTransformationTimer -= diff;
145
147 {
150 me->SetReactState(REACT_PASSIVE);
151 }
152 }
153 }
154 else
155 {
156 if (uiStampedeTimer <= diff)
157 {
161 } else uiStampedeTimer -= diff;
162
163 if (uiWhirlingSlashTimer <= diff)
164 {
168 } else uiWhirlingSlashTimer -= diff;
169 }
170 break;
171 case RHINO:
172 if (uiPhaseCounter == 2)
173 {
174 if (uiTransformationTimer <= diff)
175 {
176 me->SetDisplayId(DISPLAY_TROLL);
177 Phase = TROLL;
178 uiPhaseCounter = 0;
182 me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
183 me->SetReactState(REACT_AGGRESSIVE);
184 }
185 else
186 {
187 uiTransformationTimer -= diff;
188
190 {
193 me->SetReactState(REACT_PASSIVE);
194 }
195 }
196 }
197 else
198 {
199 if (uiPunctureTimer <= diff)
200 {
203 } else uiPunctureTimer -= diff;
204
205 if (uiEnrageTimer <= diff)
206 {
209 } else uiEnrageTimer -= diff;
210
211 if (uiStompTimer <= diff)
212 {
215 } else uiStompTimer -= diff;
216
217 if (uiImpalingChargeTimer <= diff)
218 {
219 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
220 {
222 CheckAchievement(target->GetGUID());
223 }
226 } else uiImpalingChargeTimer -= diff;
227 }
228 break;
229 }
230
232 }
233
234 // 5 UNIQUE party members
236 {
237 bool playerExists = false;
238 for (std::list<uint64>::iterator itr = impaledList.begin(); itr != impaledList.end(); ++itr)
239 if (guid != *itr)
240 playerExists = true;
241
242 if (playerExists)
243 ++shareTheLove;
244
245 impaledList.push_back(guid);
246 }
247
249 {
250 if (type == DATA_SHARE_THE_LOVE)
251 return shareTheLove;
252
253 return 0;
254 }
255
256 void JustDied(Unit* /*killer*/) OVERRIDE
257 {
259
260 if (instance)
262 }
263
265 {
266 if (victim->GetTypeId() != TypeID::TYPEID_PLAYER)
267 return;
268
269 Talk(SAY_SLAY);
270 }
271 };
272};
273
275{
276 public:
277 achievement_share_the_love() : AchievementCriteriaScript("achievement_share_the_love") { }
278
279 bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
280 {
281 if (!target)
282 return false;
283
284 if (Creature* GalDarah = target->ToCreature())
285 if (GalDarah->AI()->GetData(DATA_SHARE_THE_LOVE) >= 5)
286 return true;
287
288 return false;
289 }
290};
291
@ IN_MILLISECONDS
Definition Common.h:125
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition Object.h:55
@ UNIT_STATE_ROOT
Definition Unit.h:522
@ UNIT_STATE_STUNNED
Definition Unit.h:515
@ REACT_PASSIVE
Definition Unit.h:1156
@ REACT_AGGRESSIVE
Definition Unit.h:1158
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_ENRAGE
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
@ DATA_SHARE_THE_LOVE
@ SAY_DEATH
@ SAY_SUMMON_RHINO
@ SAY_AGGRO
@ SAY_TRANSFORM_1
@ SAY_SLAY
@ SAY_TRANSFORM_2
@ SPELL_STOMP
@ H_SPELL_WHIRLING_SLASH
@ H_SPELL_PUNCTURE
@ SPELL_ENRAGE
@ H_SPELL_ENRAGE
@ SPELL_IMPALING_CHARGE
@ SPELL_STAMPEDE
@ H_SPELL_IMPALING_CHARGE
@ SPELL_PUNCTURE
@ SPELL_WHIRLING_SLASH
@ H_SPELL_STOMP
void AddSC_boss_gal_darah()
@ DISPLAY_RHINO
@ DISPLAY_TROLL
CombatPhase
@ TROLL
@ RHINO
@ SPELL_STOMP
Definition chapter5.cpp:158
AchievementCriteriaScript(const char *name)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
Creature * ToCreature()
Definition Object.h:207
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
bool OnCheck(Player *, Unit *target) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_GAL_DARAH_EVENT
Definition gundrak.h:14
Creature * me
ScriptedAI(Creature *creature)
void KilledUnit(Unit *victim) OVERRIDE
uint32 GetData(uint32 type) const OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================