TrinityCore
Loading...
Searching...
No Matches
boss_dathrohan_balnazzar.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/*
19 * Timers requires to be revisited
20 */
21
22#include "ScriptMgr.h"
23#include "ScriptedCreature.h"
24#include "stratholme.h"
25
32
34{
35 // Dathrohan
40
42
43 // Balnazzar
46 SPELL_SLEEP = 12098,
47 SPELL_DOMINATION = 17405
48};
49
68
75
76// 10812 - Grand Crusader Dathrohan
78{
80
81 void Reset() override
82 {
84
85 _transformed = false;
86
87 if (me->GetEntry() == NPC_BALNAZZAR)
89
91 }
92
104
105 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
106 {
107 if (!_transformed && me->HealthBelowPctDamaged(40, damage))
108 {
109 _transformed = true;
111 }
112 }
113
114 void JustDied(Unit* killer) override
115 {
116 BossAI::JustDied(killer);
117
120 }
121
122 void UpdateAI(uint32 diff) override
123 {
124 if (!UpdateVictim())
125 return;
126
127 events.Update(diff);
128
130 return;
131
132 while (uint32 eventId = events.ExecuteEvent())
133 {
134 switch (eventId)
135 {
138 events.Repeat(20s, 30s);
139 break;
142 events.Repeat(10s, 20s);
143 break;
146 events.Repeat(10s, 15s);
147 break;
148
149 case EVENT_MIND_BLAST:
151 events.Repeat(10s, 15s);
152 break;
153
156 events.Repeat(10s, 15s);
157 break;
160 events.Repeat(20s, 30s);
161 break;
162 case EVENT_SLEEP:
164 DoCast(target, SPELL_SLEEP);
165 events.Repeat(15s, 20s);
166 break;
167 case EVENT_DOMINATION:
169 DoCast(target, SPELL_DOMINATION);
170 events.Repeat(20s, 25s);
171 break;
172
181 break;
187 break;
191 break;
199 break;
200 default:
201 break;
202 }
203
205 return;
206 }
207
209 }
210
211private:
213};
214
@ EQUIP_UNEQUIP
Definition CreatureAI.h:76
uint32_t uint32
Definition Define.h:133
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
void AddSC_boss_dathrohan_balnazzar()
@ SPELL_BALNAZZAR_TRANSFORM
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
EventMap events
void Reset() override
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetReactState(ReactStates st)
Definition Creature.h:119
bool UpdateEntry(uint32 entry, CreatureData const *data=nullptr, bool updateLevel=true)
Definition Creature.cpp:540
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void CancelEvent(EventId eventId)
Definition EventMap.cpp:151
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
uint32 GetEntry() const
Definition Object.h:81
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:918
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2082
@ BOSS_BALNAZZAR
Definition stratholme.h:33
#define RegisterStratholmeCreatureAI(ai_name)
Definition stratholme.h:140
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
boss_dathrohan_balnazzar(Creature *creature)
void JustEngagedWith(Unit *who) override
void JustDied(Unit *killer) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void UpdateAI(uint32 diff) override