Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_auriaya.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 "SpellScript.h"
9#include "ulduar.h"
10
35
43
45{
46 // Auriaya
55
56 // Sanctum Sentry
59
60 // Feral Defender
63};
64
74
80
81#define SENTRY_NUMBER RAID_MODE<uint8>(2, 4)
82
83enum Mis
84{
85 DATA_NINE_LIVES = 30763077,
87};
88
90{
91 public:
92 boss_auriaya() : CreatureScript("boss_auriaya") { }
93
94 struct boss_auriayaAI : public BossAI
95 {
97 {
98 }
99
101 {
102 _Reset();
103 DefenderGUID = 0;
104 defenderLives = 8;
105 crazyCatLady = true;
106 nineLives = false;
107 }
108
109 void EnterCombat(Unit* /*who*/) OVERRIDE
110 {
111 _EnterCombat();
113
114 events.ScheduleEvent(EVENT_SCREECH, std::rand() % 65000 + 45000);
115 events.ScheduleEvent(EVENT_BLAST, std::rand() % 25000 + 20000);
116 events.ScheduleEvent(EVENT_TERRIFYING, std::rand() % 30000 + 20000);
117 events.ScheduleEvent(EVENT_DEFENDER, std::rand() % 55000 + 40000);
118 events.ScheduleEvent(EVENT_SUMMON, std::rand() % 55000 + 45000);
119 events.ScheduleEvent(EVENT_BERSERK, 600000);
120 }
121
123 {
124 if (who->GetTypeId() == TypeID::TYPEID_PLAYER)
125 Talk(SAY_SLAY);
126 }
127
129 {
130 summons.Summon(summoned);
131
132 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
133 {
134 summoned->AI()->AttackStart(target);
135 summoned->AddThreat(target, 250.0f);
136 DoZoneInCombat(summoned);
137 }
138
139 if (summoned->GetEntry() == NPC_FERAL_DEFENDER)
140 {
141 if (!summoned->IsInCombat() && me->GetVictim())
142 summoned->AI()->AttackStart(me->GetVictim());
143 summoned->SetAuraStack(SPELL_FERAL_ESSENCE, summoned, 9);
144 DefenderGUID = summoned->GetGUID();
145 DoZoneInCombat(summoned);
146 }
147 }
148
150 {
151 switch (action)
152 {
155 break;
158 if (!defenderLives)
159 {
161 break;
162 }
163 events.ScheduleEvent(EVENT_RESPAWN_DEFENDER, 30000);
164 break;
165 default:
166 break;
167 }
168 }
169
171 {
172 switch (type)
173 {
174 case DATA_NINE_LIVES:
175 return nineLives ? 1 : 0;
177 return crazyCatLady ? 1 : 0;
178 }
179
180 return 0;
181 }
182
184 {
185 switch (id)
186 {
187 case DATA_NINE_LIVES:
188 nineLives = data ? true : false;
189 break;
191 crazyCatLady = data ? true : false;
192 break;
193 }
194 }
195
196 void JustDied(Unit* /*killer*/) OVERRIDE
197 {
198 _JustDied();
200 }
201
203 {
204 if (!UpdateVictim())
205 return;
206
207 events.Update(diff);
208
209 if (me->HasUnitState(UNIT_STATE_CASTING))
210 return;
211
212 while (uint32 eventId = events.ExecuteEvent())
213 {
214 switch (eventId)
215 {
216 case EVENT_SCREECH:
218 events.ScheduleEvent(EVENT_SCREECH, std::rand() % 60000 + 40000);
219 break;
220 case EVENT_TERRIFYING:
223 events.ScheduleEvent(EVENT_TERRIFYING, std::rand() % 30000 + 20000);
224 break;
225 case EVENT_BLAST:
227 events.ScheduleEvent(EVENT_BLAST, std::rand() % 35000 + 25000);
228 break;
229 case EVENT_DEFENDER:
232 if (Creature* trigger = me->FindNearestCreature(NPC_FERAL_DEFENDER_TRIGGER, 15.0f, true))
233 DoCast(trigger, SPELL_ACTIVATE_DEFENDER, true);
234 break;
237 {
238 Defender->Respawn();
239 if (defenderLives)
240 Defender->SetAuraStack(SPELL_FERAL_ESSENCE, Defender, defenderLives);
241 Defender->SetInCombatWithZone();
242 if (!Defender->IsInCombat())
243 Defender->AI()->AttackStart(me->GetVictim());
244 events.CancelEvent(EVENT_RESPAWN_DEFENDER);
245 }
246 break;
247 case EVENT_SUMMON:
248 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
250 events.ScheduleEvent(EVENT_SUMMON, std::rand() % 45000 + 30000);
251 break;
252 case EVENT_BERSERK:
253 DoCast(me, SPELL_BERSERK, true);
255 events.CancelEvent(EVENT_BERSERK);
256 break;
257 }
258 }
259
261 }
262
263 private:
268 };
269
271 {
272 return GetUlduarAI<boss_auriayaAI>(creature);
273 }
274};
275
277{
278 public:
279 npc_auriaya_seeping_trigger() : CreatureScript("npc_auriaya_seeping_trigger") { }
280
282 {
284 {
285 instance = me->GetInstanceScript();
286 }
287
289 {
290 me->DespawnOrUnsummon(600000);
292 }
293
294 void UpdateAI(uint32 /*diff*/) OVERRIDE
295 {
296 if (instance->GetBossState(BOSS_AURIAYA) != IN_PROGRESS)
297 me->DespawnOrUnsummon();
298 }
299
300 private:
302 };
303
305 {
306 return new npc_auriaya_seeping_triggerAI(creature);
307 }
308};
309
311{
312 public:
313 npc_sanctum_sentry() : CreatureScript("npc_sanctum_sentry") { }
314
316 {
318 {
319 instance = me->GetInstanceScript();
320 }
321
323 {
324 events.ScheduleEvent(EVENT_RIP, std::rand() % 8000 + 4000);
325 events.ScheduleEvent(EVENT_POUNCE, std::rand() % 15000 + 12000);
326 }
327
328 void EnterCombat(Unit* /*who*/) OVERRIDE
329 {
331 }
332
334 {
335 if (!UpdateVictim())
336 return;
337
338 events.Update(diff);
339
340 if (me->HasUnitState(UNIT_STATE_CASTING))
341 return;
342
343 while (uint32 eventId = events.ExecuteEvent())
344 {
345 switch (eventId)
346 {
347 case EVENT_RIP:
349 events.ScheduleEvent(EVENT_RIP, std::rand() % 15000 + 12000);
350 break;
351 case EVENT_POUNCE:
352 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
353 {
354 me->AddThreat(target, 100.0f);
355 me->AI()->AttackStart(target);
357 }
358 events.ScheduleEvent(EVENT_POUNCE, std::rand() % 17000 + 12000);
359 break;
360 default:
361 break;
362 }
363 }
364
366 }
367
368 void JustDied(Unit* /*killer*/) OVERRIDE
369 {
370 if (Creature* Auriaya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_AURIAYA)))
371 Auriaya->AI()->DoAction(ACTION_CRAZY_CAT_LADY);
372 }
373
374 private:
377 };
378
380 {
381 return new npc_sanctum_sentryAI(creature);
382 }
383};
384
386{
387 public:
388 npc_feral_defender() : CreatureScript("npc_feral_defender") { }
389
391 {
393 {
394 instance = me->GetInstanceScript();
395 }
396
398 {
399 events.ScheduleEvent(EVENT_FERAL_POUNCE, 5000);
400 events.ScheduleEvent(EVENT_RUSH, 10000);
401 }
402
404 {
405 if (!UpdateVictim())
406 return;
407
408 events.Update(diff);
409
410 if (me->HasUnitState(UNIT_STATE_CASTING))
411 return;
412
413 while (uint32 eventId = events.ExecuteEvent())
414 {
415 switch (eventId)
416 {
418 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
419 {
420 me->AddThreat(target, 100.0f);
421 me->AI()->AttackStart(target);
422 DoCast(target, SPELL_FERAL_POUNCE);
423 }
424 events.ScheduleEvent(EVENT_FERAL_POUNCE, std::rand() % 12000 + 10000);
425 break;
426 case EVENT_RUSH:
427 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
428 {
429 me->AddThreat(target, 100.0f);
430 me->AI()->AttackStart(target);
431 DoCast(target, SPELL_FERAL_RUSH);
432 }
433 events.ScheduleEvent(EVENT_RUSH, std::rand() % 12000 + 10000);
434 break;
435 default:
436 break;
437 }
438 }
439
441 }
442
443 void JustDied(Unit* /*killer*/) OVERRIDE
444 {
446 if (Creature* Auriaya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_AURIAYA)))
447 Auriaya->AI()->DoAction(ACTION_RESPAWN_DEFENDER);
448 }
449
450 private:
453 };
454
456 {
457 return new npc_feral_defenderAI(creature);
458 }
459};
460
462{
463 public:
464 bool operator()(WorldObject* object) const
465 {
466 if (object->GetEntry() == NPC_SANCTUM_SENTRY)
467 return false;
468
469 return true;
470 }
471};
472
498
525
527{
528 public:
530 {
531 }
532
533 bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
534 {
535 if (!target)
536 return false;
537
538 if (Creature* Auriaya = target->ToCreature())
539 if (Auriaya->AI()->GetData(DATA_NINE_LIVES))
540 return true;
541
542 return false;
543 }
544};
545
547{
548 public:
550 {
551 }
552
553 bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
554 {
555 if (!target)
556 return false;
557
558 if (Creature* Auriaya = target->ToCreature())
559 if (Auriaya->AI()->GetData(DATA_CRAZY_CAT_LADY))
560 return true;
561
562 return false;
563 }
564};
565
std::int32_t int32
Definition Define.h:73
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
@ TYPEID_PLAYER
Definition Object.h:55
@ EFFECT_1
@ EFFECT_0
@ TARGET_UNIT_SRC_AREA_ALLY
@ TARGET_UNIT_SRC_AREA_ENEMY
#define SpellObjectAreaTargetSelectFn(F, I, N)
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_BERSERK
@ SAY_SLAY
AuriayaSpells
@ SPELL_RIP_FLESH
@ SPELL_STRENGHT_PACK
@ SPELL_SUMMON_ESSENCE
@ SPELL_SUMMON_DEFENDER
@ SPELL_SUMMON_SWARMING_GUARDIAN
@ SPELL_SAVAGE_POUNCE
@ SPELL_SENTINEL_BLAST
@ SPELL_FERAL_POUNCE
@ SPELL_DEFENDER_TRIGGER
@ SPELL_ACTIVATE_DEFENDER
@ SPELL_FERAL_RUSH
@ SPELL_TERRIFYING_SCREECH
@ SPELL_BERSERK
@ SPELL_FERAL_ESSENCE
@ SPELL_SEEPING_ESSENCE
@ SPELL_SONIC_SCREECH
@ DATA_NINE_LIVES
@ DATA_CRAZY_CAT_LADY
AuriayaEvents
@ EVENT_BLAST
@ EVENT_RUSH
@ EVENT_TERRIFYING
@ EVENT_ACTIVATE_DEFENDER
@ EVENT_FERAL_POUNCE
@ EVENT_POUNCE
@ EVENT_RIP
@ EVENT_BERSERK
@ EVENT_SCREECH
@ EVENT_RESPAWN_DEFENDER
@ EVENT_DEFENDER
@ EVENT_SUMMON
AuriayaActions
@ ACTION_CRAZY_CAT_LADY
@ ACTION_RESPAWN_DEFENDER
void AddSC_boss_auriaya()
AuriayaYells
@ EMOTE_FEAR
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_SLAY
@ EMOTE_DEFENDER
@ SAY_BERSERK
AuriayaNPCs
@ NPC_SEEPING_TRIGGER
@ NPC_SANCTUM_SENTRY
@ NPC_FERAL_DEFENDER_TRIGGER
@ NPC_FERAL_DEFENDER
#define SAY_DEATH
#define SAY_AGGRO
#define SPELL_BERSERK
@ EVENT_SUMMON
@ EVENT_BLAST
@ EVENT_BERSERK
AchievementCriteriaScript(const char *name)
SummonList summons
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
static Creature * GetCreature(WorldObject const &u, uint64 guid)
uint32 GetEntry() const
Definition Object.h:125
Creature * ToCreature()
Definition Object.h:207
bool operator()(WorldObject *object) const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
SpellScriptLoader(const char *name)
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
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
bool OnCheck(Player *, Unit *target) OVERRIDE
bool OnCheck(Player *, Unit *target) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
PrepareSpellScript(spell_auriaya_sentinel_blast_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
SpellScript * GetSpellScript() const OVERRIDE
Creature * me
ScriptedAI(Creature *creature)
void JustSummoned(Creature *summoned) OVERRIDE
void KilledUnit(Unit *who) OVERRIDE
void JustDied(Unit *) OVERRIDE
void SetData(uint32 id, uint32 data) OVERRIDE
void EnterCombat(Unit *) OVERRIDE
uint32 GetData(uint32 type) const OVERRIDE
void DoAction(int32 action) OVERRIDE
boss_auriayaAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ BOSS_AURIAYA
Definition ulduar.h:26
AI * GetUlduarAI(T *obj)
Definition ulduar.h:336