TrinityCore
boss_instructor_malicia.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/* ScriptData
19SDName: Boss_instructormalicia
20SD%Complete: 100
21SDComment:
22SDCategory: Scholomance
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "scholomance.h"
27#include "ScriptedCreature.h"
28
30{
34 SPELL_RENEW = 10929,
36};
37
39{
45};
46
48{
49 public: boss_instructor_malicia() : CreatureScript("boss_instructor_malicia") { }
50
52 {
54 {
55 Initialize();
56 }
57
59 {
60 FlashCounter = 0;
61 TouchCounter = 0;
62 }
63
66
67 void Reset() override
68 {
69 _Reset();
70 Initialize();
71 }
72
73 void JustEngagedWith(Unit* who) override
74 {
81 }
82
83 void UpdateAI(uint32 diff) override
84 {
85 if (!UpdateVictim())
86 return;
87
88 events.Update(diff);
89
91 return;
92
93 while (uint32 eventId = events.ExecuteEvent())
94 {
95 switch (eventId)
96 {
100 break;
101 case EVENT_CORRUPTION:
104 break;
105 case EVENT_RENEW:
108 break;
109 case EVENT_FLASHHEAL:
110 //5 Flashheals will be cast
112 if (FlashCounter < 2)
113 {
115 ++FlashCounter;
116 }
117 else
118 {
119 FlashCounter=0;
121 }
122 break;
124 //3 Healing Touch will be cast
126 if (TouchCounter < 2)
127 {
129 ++TouchCounter;
130 }
131 else
132 {
133 TouchCounter=0;
135 }
136 break;
137 default:
138 break;
139 }
140
142 return;
143 }
144 }
145 };
146
147 CreatureAI* GetAI(Creature* creature) const override
148 {
149 return GetScholomanceAI<boss_instructormaliciaAI>(creature);
150 }
151};
152
154{
156}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_HEALINGTOUCH
@ SPELL_CALLOFGRAVES
void AddSC_boss_instructormalicia()
@ EVENT_CALLOFGRAVES
@ EVENT_HEALINGTOUCH
void JustEngagedWith(Unit *who) override
EventMap events
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
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
CreatureAI * GetAI(Creature *creature) const override
@ DATA_INSTRUCTORMALICIA
Definition: scholomance.h:29