Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_krikthir_the_gatewatcher.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/*
7 * Comment: Find in the future best timers and the event is not implemented.
8 */
9
10#include "ScriptMgr.h"
11#include "ScriptedCreature.h"
12#include "azjol_nerub.h"
13
15{
20 SPELL_FRENZY = 28747, //maybe 53361
21 SPELL_SUMMON_SKITTERING_SWARMER = 52438, //AOE Effect 140, maybe 52439
22 SPELL_SUMMON_SKITTERING_SWARMER_1 = 52439, //Summon 3x 28735
25 SPELL_CHARGE = 16979, //maybe is another spell
31 SPELL_STRIKE = 52532,
32 SPELL_CLEAVE = 49806,
33 SPELL_ENRAGE = 52470,
36 SPELL_WEB_WRAP = 52086, //the spell is not working properly
41};
42
49
59
61{
62 { 566.164f, 682.087f, 769.079f, 2.21657f },
63 { 529.042f, 706.941f, 777.298f, 1.0821f },
64 { 489.975f, 671.239f, 772.131f, 0.261799f },
65 { 488.556f, 692.95f, 771.764f, 4.88692f },
66 { 553.34f, 640.387f, 777.419f, 1.20428f },
67 { 517.486f, 706.398f, 777.335f, 5.35816f },
68 { 504.01f, 637.693f, 777.479f, 0.506145f },
69 { 552.625f, 706.408f, 777.177f, 3.4383f }
70};
71
73{
74public:
75 boss_krik_thir() : CreatureScript("boss_krik_thir") { }
76
78 {
79 boss_krik_thirAI(Creature* creature) : ScriptedAI(creature)
80 {
81 instance = creature->GetInstanceScript();
82 }
83
85
89
98
99 void EnterCombat(Unit* /*who*/) OVERRIDE
100 {
102 Summon();
104
105 if (instance)
107 }
108
109 void Summon()
110 {
127 }
128
130 {
131 if (!UpdateVictim())
132 return;
133
134 if (uiSummonTimer <= diff)
135 {
136 Summon();
138 } else uiSummonTimer -= diff;
139
140 if (uiMindFlayTimer <= diff)
141 {
144 } else uiMindFlayTimer -= diff;
145
146 if (uiCurseFatigueTimer <= diff)
147 {
148 //WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically."
149 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
151 if (Unit* tankTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
152 DoCast(tankTarget, SPELL_CURSE_OF_FATIGUE);
153
155 } else uiCurseFatigueTimer -= diff;
156
157 if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
158 DoCast(me, SPELL_FRENZY, true);
159
161 }
162 void JustDied(Unit* /*killer*/) OVERRIDE
163 {
165
166 if (instance)
168 }
169
171 {
172 if (victim->GetTypeId() != TypeID::TYPEID_PLAYER)
173 return;
174
175 Talk(SAY_SLAY);
176 }
177
179 {
180 summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
181 }
182 };
183
185 {
186 return new boss_krik_thirAI(creature);
187 }
188};
189
191{
192public:
193 npc_skittering_infector() : CreatureScript("npc_skittering_infector") { }
194
196 {
198
199 void JustDied(Unit* /*killer*/) OVERRIDE
200 {
201 //The spell is not working propperly
203 }
204 };
205
207 {
208 return new npc_skittering_infectorAI(creature);
209 }
210};
211
213{
214public:
215 npc_anub_ar_skirmisher() : CreatureScript("npc_anub_ar_skirmisher") { }
216
218 {
220
223
229
231 {
232 if (!UpdateVictim())
233 return;
234
235 if (uiChargeTimer <= diff)
236 {
237 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
238 {
240 me->AddThreat(target, 1.0f);
241 DoCast(target, SPELL_CHARGE, true);
242 }
244 } else uiChargeTimer -= diff;
245
246 if (uiBackstabTimer <= diff)
247 {
250 } else uiBackstabTimer -= diff;
251
253 }
254 };
255
257 {
258 return new npc_anub_ar_skirmisherAI(creature);
259 }
260};
261
263{
264public:
265 npc_anub_ar_shadowcaster() : CreatureScript("npc_anub_ar_shadowcaster") { }
266
268 {
270
273
279
281 {
282 if (!UpdateVictim())
283 return;
284
285 if (uiShadowBoltTimer <= diff)
286 {
287 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
288 DoCast(target, SPELL_SHADOW_BOLT, true);
290 } else uiShadowBoltTimer -= diff;
291
292 if (uiShadowNovaTimer <= diff)
293 {
296 } else uiShadowNovaTimer -= diff;
297
299 }
300 };
301
303 {
304 return new npc_anub_ar_shadowcasterAI(creature);
305 }
306};
307
309{
310public:
311 npc_anub_ar_warrior() : CreatureScript("npc_anub_ar_warrior") { }
312
314 {
315 npc_anub_ar_warriorAI(Creature* creature) : ScriptedAI(creature){ }
316
319
325
327 {
328 if (!UpdateVictim())
329 return;
330
331 if (uiStrikeTimer <= diff)
332 {
335 } else uiStrikeTimer -= diff;
336
337 if (uiCleaveTimer <= diff)
338 {
341 } else uiCleaveTimer -= diff;
342
344 }
345 };
346
348 {
349 return new npc_anub_ar_warriorAI(creature);
350 }
351};
352
354{
355public:
356 npc_watcher_gashra() : CreatureScript("npc_watcher_gashra") { }
357
359 {
360 npc_watcher_gashraAI(Creature* creature) : ScriptedAI(creature) { }
361
364
370
371 void EnterCombat(Unit* /*who*/) OVERRIDE
372 {
373 DoCast(me, SPELL_ENRAGE, true);
374 }
375
377 {
378 if (!UpdateVictim())
379 return;
380
381 if (uiWebWrapTimer <= diff)
382 {
383 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
384 DoCast(target, SPELL_WEB_WRAP, true);
386 } else uiWebWrapTimer -= diff;
387
388 if (uiInfectedBiteTimer <= diff)
389 {
392 } else uiInfectedBiteTimer -= diff;
393
395 }
396 };
397
399 {
400 return new npc_watcher_gashraAI(creature);
401 }
402};
403
405{
406public:
407 npc_watcher_narjil() : CreatureScript("npc_watcher_narjil") { }
408
410 {
411 npc_watcher_narjilAI(Creature* creature) : ScriptedAI(creature) { }
412
416
423
425 {
426 if (!UpdateVictim())
427 return;
428
429 if (uiWebWrapTimer <= diff)
430 {
431 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
432 DoCast(target, SPELL_WEB_WRAP, true);
434 } else uiWebWrapTimer -= diff;
435
436 if (uiInfectedBiteTimer <= diff)
437 {
440 } else uiInfectedBiteTimer -= diff;
441
442 if (uiBindingWebsTimer <= diff)
443 {
446 } else uiBindingWebsTimer -= diff;
447
449 }
450 };
451
453 {
454 return new npc_watcher_narjilAI(creature);
455 }
456};
457
459{
460public:
461 npc_watcher_silthik() : CreatureScript("npc_watcher_silthik") { }
462
464 {
465 npc_watcher_silthikAI(Creature* creature) : ScriptedAI(creature) { }
466
470
477
479 {
480 if (!UpdateVictim())
481 return;
482
483 if (uiWebWrapTimer <= diff)
484 {
485 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
486 DoCast(target, SPELL_WEB_WRAP, true);
487
489 } else uiWebWrapTimer -= diff;
490
491 if (uiInfectedBiteTimer <= diff)
492 {
495 } else uiInfectedBiteTimer -= diff;
496
497 if (uiPoisonSprayTimer <= diff)
498 {
501 } else uiPoisonSprayTimer -= diff;
502
504 }
505 };
506
508 {
509 return new npc_watcher_silthikAI(creature);
510 }
511};
512
514{
515 public:
517 {
518 }
519
520 bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
521 {
522 if (!target)
523 return false;
524
525 InstanceScript* instance = target->GetInstanceScript();
526 if (!instance)
527 return false;
528
529 for (uint8 n = 0; n < 3; ++n)
530 {
531 if (Creature* watcher = ObjectAccessor::GetCreature(*target, instance->GetData64(DATA_WATCHER_GASHRA + n)))
532 if (!watcher->IsAlive())
533 return false;
534 }
535
536 return true;
537 }
538};
539
@ 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
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition Object.h:55
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_CLEAVE
@ SPELL_ENRAGE
@ SPELL_CHARGE
@ DATA_WATCHER_GASHRA
Definition azjol_nerub.h:21
@ DATA_KRIKTHIR_THE_GATEWATCHER
Definition azjol_nerub.h:16
@ SAY_SLAY
@ SAY_SWARM
const Position SpawnPoint[2]
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_MIND_FLAY
@ SPELL_FRENZY
@ SPELL_SHADOW_NOVA
@ SPELL_SHADOW_BOLT
void AddSC_boss_krik_thir()
@ NPC_SKITTERING_SWARMER_CONTROLLER
@ SPELL_SUMMON_SKITTERING_SWARMER_1
const Position SpawnPoint[]
AchievementCriteriaScript(const char *name)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
static Creature * GetCreature(WorldObject const &u, uint64 guid)
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
virtual uint64 GetData64(uint32) const
Definition ZoneScript.h:32
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
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void JustSummoned(Creature *summoned) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================