TrinityCore
boss_mordresh_fire_eye.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "razorfen_downs.h"
20#include "ScriptedCreature.h"
21
22enum Say
23{
27 SAY_AGGRO = 3
28};
29
31{
33 SPELL_FIRE_NOVA = 12470
34};
35
37{
44};
45
47{
48public:
49 boss_mordresh_fire_eye() : CreatureScript("boss_mordresh_fire_eye") { }
50
52 {
54
55 void Reset() override
56 {
57 _Reset();
59 }
60
61 void JustEngagedWith(Unit* who) override
62 {
64 events.Reset();
68 }
69
70 void JustDied(Unit* /*killer*/) override
71 {
72 _JustDied();
73 }
74
75 void UpdateAI(uint32 diff) override
76 {
77 events.Update(diff);
78
79 if (!UpdateVictim())
80 {
81 while (uint32 eventId = events.ExecuteEvent())
82 {
83 switch (eventId)
84 {
85 case EVENT_OOC_1:
88 break;
89 case EVENT_OOC_2:
92 break;
93 case EVENT_OOC_3:
96 break;
97 case EVENT_OOC_4:
100 break;
101 }
102 }
103 return;
104 }
105
107 return;
108
109 while (uint32 eventId = events.ExecuteEvent())
110 {
111 switch (eventId)
112 {
113 case EVENT_FIREBALL:
115 events.ScheduleEvent(EVENT_FIREBALL, 2400ms, 3800ms);
116 break;
117 case EVENT_FIRE_NOVA:
120 break;
121 }
122
124 return;
125 }
126 }
127 };
128
129 CreatureAI* GetAI(Creature* creature) const override
130 {
131 return GetRazorfenDownsAI<boss_mordresh_fire_eyeAI>(creature);
132 }
133};
134
136{
138}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ EMOTE_ONESHOT_EXCLAMATION
@ UNIT_STATE_CASTING
Definition: Unit.h:270
void AddSC_boss_mordresh_fire_eye()
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void Reset()
Definition: EventMap.cpp:21
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition: Unit.cpp:1598
CreatureAI * GetAI(Creature *creature) const override
@ DATA_MORDRESH_FIRE_EYE