TrinityCore
Loading...
Searching...
No Matches
boss_corla.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 "ScriptedCreature.h"
20#include "blackrock_caverns.h"
21
30
38
40{
41 // Out of combat events
45 // Combat events
46};
47
49{
50 public:
51 boss_corla(): CreatureScript("boss_corla") { }
52
53 struct boss_corlaAI : public BossAI
54 {
55 boss_corlaAI(Creature* creature) : BossAI(creature, DATA_CORLA) { }
56
57 void Reset() override
58 {
59 _Reset();
60 combatPhase = false;
62 }
63
64 void JustEngagedWith(Unit* who) override
65 {
68 events.Reset();
69 combatPhase = true;
70 }
71
72 void KilledUnit(Unit* who) override
73 {
74 if (who->GetTypeId() == TYPEID_PLAYER)
76 }
77
78 void JustDied(Unit* /*killer*/) override
79 {
80 _JustDied();
82 }
83
84 void UpdateAI(uint32 diff) override
85 {
86 events.Update(diff);
87
88 if (!combatPhase)
89 {
90 while (uint32 eventId = events.ExecuteEvent())
91 {
92 switch (eventId)
93 {
97 break;
101 break;
102 case EVENT_EVOLUTION:
105 break;
106 default:
107 break;
108 }
109 }
110 return;
111 }
112 }
113
114 private:
115 bool combatPhase = false;
116 };
117
118 CreatureAI* GetAI(Creature* creature) const override
119 {
120 return GetBlackrockCavernsAI<boss_corlaAI>(creature);
121 }
122};
123
125{
126 new boss_corla();
127}
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:599
@ DATA_CORLA
@ H_SPELL_SHADOW_POWER
@ SPELL_EVOLUTION
@ SPELL_SHADOW_POWER
@ SPELL_DRAIN_ESSENSE
void AddSC_boss_corla()
@ YELL_AGGRO
@ EMOTE_EVOLVED_ZEALOT
@ YELL_EVOLVED_ZEALOT
@ YELL_KILL
@ YELL_DEATH
@ EVENT_STOP_DRAIN_ESSENSE
@ EVENT_DRAIN_ESSENSE
@ EVENT_EVOLUTION
TypeID GetTypeId() const
Definition BaseEntity.h:166
void JustEngagedWith(Unit *who) override
EventMap events
Creature *const me
Definition CreatureAI.h:63
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition Unit.cpp:3159
CreatureAI * GetAI(Creature *creature) const override
void JustDied(Unit *) override
void JustEngagedWith(Unit *who) override
void Reset() override
void KilledUnit(Unit *who) override
boss_corlaAI(Creature *creature)
void UpdateAI(uint32 diff) override