Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_firemaw.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 "blackwing_lair.h"
9
16
23
25{
26public:
27 boss_firemaw() : CreatureScript("boss_firemaw") { }
28
29 struct boss_firemawAI : public BossAI
30 {
31 boss_firemawAI(Creature* creature) : BossAI(creature, BOSS_FIREMAW) { }
32
33 void EnterCombat(Unit* /*who*/) OVERRIDE
34 {
35 if (instance && instance->GetBossState(BOSS_BROODLORD) != DONE)
36 {
38 return;
39 }
41
42 events.ScheduleEvent(EVENT_SHADOWFLAME, std::rand() % 20000 + 10000);
43 events.ScheduleEvent(EVENT_WINGBUFFET, 30000);
44 events.ScheduleEvent(EVENT_FLAMEBUFFET, 5000);
45 }
46
48 {
49 if (!UpdateVictim())
50 return;
51
52 events.Update(diff);
53
54 if (me->HasUnitState(UNIT_STATE_CASTING))
55 return;
56
57 while (uint32 eventId = events.ExecuteEvent())
58 {
59 switch (eventId)
60 {
63 events.ScheduleEvent(EVENT_SHADOWFLAME, std::rand() % 20000 + 10000);
64 break;
67 if (DoGetThreat(me->GetVictim()))
68 DoModifyThreatPercent(me->GetVictim(), -75);
69 events.ScheduleEvent(EVENT_WINGBUFFET, 30000);
70 break;
73 events.ScheduleEvent(EVENT_FLAMEBUFFET, 5000);
74 break;
75 }
76 }
77
79 }
80 };
81
83 {
84 return new boss_firemawAI(creature);
85 }
86};
87
89{
90 new boss_firemaw();
91}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ DONE
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ BOSS_FIREMAW
@ BOSS_BROODLORD
@ SPELL_SHADOWFLAME
@ SPELL_WINGBUFFET
@ EVENT_WINGBUFFET
@ EVENT_SHADOWFLAME
@ SPELL_FLAMEBUFFET
@ SPELL_SHADOWFLAME
@ SPELL_WINGBUFFET
void AddSC_boss_firemaw()
@ EVENT_WINGBUFFET
@ EVENT_SHADOWFLAME
@ EVENT_FLAMEBUFFET
InstanceScript *const instance
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
float DoGetThreat(Unit *unit)
void DoModifyThreatPercent(Unit *unit, int32 pct)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
boss_firemawAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE