Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_the_beast.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
16
23
25{
26public:
27 boss_the_beast() : CreatureScript("boss_the_beast") { }
28
30 {
31 return new boss_thebeastAI(creature);
32 }
33
34 struct boss_thebeastAI : public BossAI
35 {
36 boss_thebeastAI(Creature* creature) : BossAI(creature, DATA_THE_BEAST) { }
37
39 {
40 _Reset();
41 }
42
43 void EnterCombat(Unit* /*who*/) OVERRIDE
44 {
46 events.ScheduleEvent(EVENT_FLAME_BREAK, 12 * IN_MILLISECONDS);
47 events.ScheduleEvent(EVENT_IMMOLATE, 3 * IN_MILLISECONDS);
48 events.ScheduleEvent(EVENT_TERRIFYING_ROAR, 23 * IN_MILLISECONDS);
49 }
50
51 void JustDied(Unit* /*killer*/) OVERRIDE
52 {
53 _JustDied();
54 }
55
57 {
58 if (!UpdateVictim())
59 return;
60
61 events.Update(diff);
62
63 if (me->HasUnitState(UNIT_STATE_CASTING))
64 return;
65
66 while (uint32 eventId = events.ExecuteEvent())
67 {
68 switch (eventId)
69 {
72 events.ScheduleEvent(EVENT_FLAME_BREAK, 10 * IN_MILLISECONDS);
73 break;
74 case EVENT_IMMOLATE:
75 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
76 DoCast(target, SPELL_IMMOLATE);
77 events.ScheduleEvent(EVENT_IMMOLATE, 8 * IN_MILLISECONDS);
78 break;
81 events.ScheduleEvent(EVENT_TERRIFYING_ROAR, 20 * IN_MILLISECONDS);
82 break;
83 }
84 }
86 }
87 };
88};
89
91{
92 new boss_the_beast();
93}
@ IN_MILLISECONDS
Definition Common.h:125
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ DATA_THE_BEAST
@ SPELL_FLAMEBREAK
@ SPELL_IMMOLATE
@ SPELL_TERRIFYINGROAR
void AddSC_boss_thebeast()
@ EVENT_IMMOLATE
@ EVENT_FLAME_BREAK
@ EVENT_TERRIFYING_ROAR
@ SPELL_IMMOLATE
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
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
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
boss_thebeastAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE