Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_gizrul_the_slavener.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 "blackrock_spire.h"
9#include "TemporarySummon.h"
10
17
19{
20 GIZRUL_PATH = 402450
21};
22
29
31{
32public:
33 boss_gizrul_the_slavener() : CreatureScript("boss_gizrul_the_slavener") { }
34
36 {
38
40 {
41 _Reset();
42 }
43
44 void IsSummonedBy(Unit* /*summoner*/) OVERRIDE
45 {
46 me->GetMotionMaster()->MovePath(GIZRUL_PATH, false);
47 }
48
49 void EnterCombat(Unit* /*who*/) OVERRIDE
50 {
52 events.ScheduleEvent(EVENT_FATAL_BITE, std::rand() % 20000 + 17000);
53 events.ScheduleEvent(EVENT_INFECTED_BITE, std::rand() % 12000 + 10000);
54 }
55
56 void JustDied(Unit* /*killer*/) OVERRIDE
57 {
58 _JustDied();
59 }
60
62 {
63 if (!UpdateVictim())
64 return;
65
66 events.Update(diff);
67
68 if (me->HasUnitState(UNIT_STATE_CASTING))
69 return;
70
71 while (uint32 eventId = events.ExecuteEvent())
72 {
73 switch (eventId)
74 {
77 events.ScheduleEvent(EVENT_FATAL_BITE, std::rand() % 10000 + 8000);
78 break;
81 events.ScheduleEvent(EVENT_FATAL_BITE, std::rand() % 10000 + 8000);
82 break;
83 default:
84 break;
85 }
86 }
88 }
89 };
90
92 {
93 return new boss_gizrul_the_slavenerAI(creature);
94 }
95};
96
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ DATA_GIZRUL_THE_SLAVENER
@ SPELL_FRENZY
void AddSC_boss_gizrul_the_slavener()
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================