TrinityCore
Loading...
Searching...
No Matches
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
28
36
44
46{
48 {
49 _hpYell = false;
50 }
51
52 void Reset() override
53 {
54 _hpYell = false;
55 _Reset();
56 }
57
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
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
DamageEffectType
void AddSC_boss_bloodmage_thalnos()
TypeID GetTypeId() const
Definition BaseEntity.h:166
void JustEngagedWith(Unit *who) override
EventMap events
Creature *const me
Definition CreatureAI.h:63
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
Definition Unit.h:635
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
@ 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)