TrinityCore
boss_bloodmage_thalnos.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 "scarlet_monastery.h"
19#include "ScriptedCreature.h"
20#include "ScriptMgr.h"
21
23{
26 SAY_KILL = 2
27};
28
30{
34 SPELL_FIRENOVA = 16079
35};
36
38{
43};
44
46{
48 {
49 _hpYell = false;
50 }
51
52 void Reset() override
53 {
54 _hpYell = false;
55 _Reset();
56 }
57
58 void JustEngagedWith(Unit* who) override
59 {
66 }
67
68 void KilledUnit(Unit* victim) override
69 {
70 if (victim->GetTypeId() == TYPEID_PLAYER)
72 }
73
74 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
75 {
76 if (!_hpYell && me->HealthBelowPctDamaged(35, damage))
77 {
79 _hpYell = true;
80 }
81 }
82
83 void ExecuteEvent(uint32 eventId) override
84 {
85 switch (eventId)
86 {
89 events.Repeat(10s, 15s);
90 break;
93 events.Repeat(2s);
94 break;
97 events.Repeat(30s);
98 break;
99 case EVENT_FIRE_NOVA:
101 events.Repeat(40s);
102 break;
103 default:
104 break;
105 }
106 }
107
108private:
110};
111
113{
115}
uint32_t uint32
Definition: Define.h:142
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
DamageEffectType
Definition: UnitDefines.h:131
void AddSC_boss_bloodmage_thalnos()
BloodmageThalnosEvents
@ EVENT_FLAME_SHOCK
@ EVENT_FLAME_SPIKE
@ EVENT_SHADOW_BOLT
BloodmageThalnosSpells
@ SPELL_FLAMESPIKE
@ SPELL_SHADOWBOLT
@ SPELL_FLAMESHOCK
void JustEngagedWith(Unit *who) override
EventMap events
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
TypeID GetTypeId() const
Definition: Object.h:173
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
@ DATA_BLOODMAGE_THALNOS
#define RegisterScarletMonasteryCreatureAI(ai)
void JustEngagedWith(Unit *who) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void ExecuteEvent(uint32 eventId) override
void KilledUnit(Unit *victim) override
boss_bloodmage_thalnos(Creature *creature)