TrinityCore
Loading...
Searching...
No Matches
boss_magmus.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 "blackrock_depths.h"
20#include "InstanceScript.h"
21#include "ScriptedCreature.h"
22
24{
26 SPELL_WARSTOMP = 24375
27};
28
34
36{
38 PHASE_TWO = 2
39};
40
42{
43 public:
44 boss_magmus() : CreatureScript("boss_magmus") { }
45
46 struct boss_magmusAI : public BossAI
47 {
48 boss_magmusAI(Creature* creature) : BossAI(creature, BOSS_MAGMUS) { }
49
56
57 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
58 {
60 {
63 }
64 }
65
66 void UpdateAI(uint32 diff) override
67 {
68 if (!UpdateVictim())
69 return;
70
71 events.Update(diff);
72
73 while (uint32 eventId = events.ExecuteEvent())
74 {
75 switch (eventId)
76 {
80 break;
81 case EVENT_WARSTOMP:
84 break;
85 default:
86 break;
87 }
88 }
89 }
90
91 void JustDied(Unit* /*killer*/) override
92 {
93 _JustDied();
96 }
97 };
98
99 CreatureAI* GetAI(Creature* creature) const override
100 {
101 return GetBlackrockDepthsAI<boss_magmusAI>(creature);
102 }
103};
104
110
112{
113public:
114 npc_ironhand_guardian() : CreatureScript("npc_ironhand_guardian") { }
115
117 {
119 {
121 _active = false;
122 }
123
124 void Reset() override
125 {
126 _events.Reset();
127 }
128
129 void UpdateAI(uint32 diff) override
130 {
131 if (!_active)
132 {
134 return;
135 // Once the boss is engaged, the guardians will stay activated until the next instance reset
137 _active = true;
138 }
139
140 _events.Update(diff);
141
142 while (uint32 eventId = _events.ExecuteEvent())
143 {
144 if (eventId == EVENT_GOUTOFFLAME)
145 {
147 _events.Repeat(16s, 21s);
148 }
149 }
150 }
151
152 private:
156 };
157
158 CreatureAI* GetAI(Creature* creature) const override
159 {
160 return GetBlackrockDepthsAI<npc_ironhand_guardianAI>(creature);
161 }
162};
163
165{
166 new boss_magmus();
168}
uint32_t uint32
Definition Define.h:154
@ NOT_STARTED
Spells
Definition PlayerAI.cpp:32
DamageEffectType
@ BOSS_MAGMUS
@ DATA_THRONE_DOOR
void AddSC_boss_magmus()
@ SPELL_FIERYBURST
@ SPELL_WARSTOMP
@ PHASE_ONE
@ PHASE_TWO
@ EVENT_WARSTOMP
@ EVENT_FIERY_BURST
IronhandGuardian
@ EVENT_GOUTOFFLAME
@ SPELL_GOUTOFFLAME
InstanceScript *const instance
void _JustEngagedWith(Unit *who)
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
bool IsInPhase(uint8 phase) const
Definition EventMap.h:222
void SetPhase(uint8 phase)
Definition EventMap.cpp:32
void Reset()
Definition EventMap.cpp:25
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
virtual ObjectGuid GetGuidData(uint32 type) const override
EncounterState GetBossState(uint32 id) const
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
Definition Unit.h:635
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
InstanceScript * GetInstanceScript() const
Definition Object.cpp:396
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
void JustDied(Unit *) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
boss_magmusAI(Creature *creature)
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override