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
22
enum
Text
23
{
24
YELL_AGGRO
= 0,
25
YELL_KILL
= 1,
26
YELL_EVOLVED_ZEALOT
= 2,
27
YELL_DEATH
= 3,
28
EMOTE_EVOLVED_ZEALOT
= 4
29
};
30
31
enum
Spells
32
{
33
SPELL_EVOLUTION
= 75610,
34
SPELL_DRAIN_ESSENSE
= 75645,
35
SPELL_SHADOW_POWER
= 35322,
36
H_SPELL_SHADOW_POWER
= 39193
37
};
38
39
enum
Events
40
{
41
// Out of combat events
42
EVENT_DRAIN_ESSENSE
= 1,
43
EVENT_STOP_DRAIN_ESSENSE
= 2,
44
EVENT_EVOLUTION
= 3
45
// Combat events
46
};
47
48
class
boss_corla
:
public
CreatureScript
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
;
61
events
.
ScheduleEvent
(
EVENT_DRAIN_ESSENSE
, 2s);
62
}
63
64
void
JustEngagedWith
(
Unit
* who)
override
65
{
66
BossAI::JustEngagedWith
(who);
67
Talk
(
YELL_AGGRO
);
68
events
.
Reset
();
69
combatPhase
=
true
;
70
}
71
72
void
KilledUnit
(
Unit
* who)
override
73
{
74
if
(who->
GetTypeId
() ==
TYPEID_PLAYER
)
75
Talk
(
YELL_KILL
);
76
}
77
78
void
JustDied
(
Unit
*
/*killer*/
)
override
79
{
80
_JustDied
();
81
Talk
(
YELL_DEATH
);
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
{
94
case
EVENT_DRAIN_ESSENSE
:
95
DoCast
(
me
,
SPELL_DRAIN_ESSENSE
);
96
events
.
ScheduleEvent
(
EVENT_STOP_DRAIN_ESSENSE
, 15s);
97
break
;
98
case
EVENT_STOP_DRAIN_ESSENSE
:
99
me
->
InterruptSpell
(
CURRENT_CHANNELED_SPELL
);
100
events
.
ScheduleEvent
(
EVENT_EVOLUTION
, 2s);
101
break
;
102
case
EVENT_EVOLUTION
:
103
DoCast
(
me
,
SPELL_EVOLUTION
);
104
events
.
ScheduleEvent
(
EVENT_DRAIN_ESSENSE
, 2s);
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
124
void
AddSC_boss_corla
()
125
{
126
new
boss_corla
();
127
}
uint32
uint32_t uint32
Definition
Define.h:154
TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
ObjectGuid.h:44
Spells
Spells
Definition
PlayerAI.cpp:32
ScriptMgr.h
ScriptedCreature.h
CURRENT_CHANNELED_SPELL
@ CURRENT_CHANNELED_SPELL
Definition
Unit.h:611
blackrock_caverns.h
DATA_CORLA
@ DATA_CORLA
Definition
blackrock_caverns.h:32
Text
Text
Definition
boss_ascendant_lord_obsidius.cpp:23
H_SPELL_SHADOW_POWER
@ H_SPELL_SHADOW_POWER
Definition
boss_corla.cpp:36
SPELL_EVOLUTION
@ SPELL_EVOLUTION
Definition
boss_corla.cpp:33
SPELL_SHADOW_POWER
@ SPELL_SHADOW_POWER
Definition
boss_corla.cpp:35
SPELL_DRAIN_ESSENSE
@ SPELL_DRAIN_ESSENSE
Definition
boss_corla.cpp:34
AddSC_boss_corla
void AddSC_boss_corla()
Definition
boss_corla.cpp:124
YELL_AGGRO
@ YELL_AGGRO
Definition
boss_corla.cpp:24
EMOTE_EVOLVED_ZEALOT
@ EMOTE_EVOLVED_ZEALOT
Definition
boss_corla.cpp:28
YELL_EVOLVED_ZEALOT
@ YELL_EVOLVED_ZEALOT
Definition
boss_corla.cpp:26
YELL_KILL
@ YELL_KILL
Definition
boss_corla.cpp:25
YELL_DEATH
@ YELL_DEATH
Definition
boss_corla.cpp:27
EVENT_STOP_DRAIN_ESSENSE
@ EVENT_STOP_DRAIN_ESSENSE
Definition
boss_corla.cpp:43
EVENT_DRAIN_ESSENSE
@ EVENT_DRAIN_ESSENSE
Definition
boss_corla.cpp:42
EVENT_EVOLUTION
@ EVENT_EVOLUTION
Definition
boss_corla.cpp:44
Events
Events
Definition
boss_garothi_worldbreaker.cpp:101
Talk
Talk
Definition
boss_hadronox.cpp:130
BaseEntity::GetTypeId
TypeID GetTypeId() const
Definition
BaseEntity.h:166
BossAI
Definition
ScriptedCreature.h:313
BossAI::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
ScriptedCreature.h:334
BossAI::events
EventMap events
Definition
ScriptedCreature.h:351
BossAI::_JustDied
void _JustDied()
Definition
ScriptedCreature.cpp:570
BossAI::_Reset
void _Reset()
Definition
ScriptedCreature.cpp:557
CreatureAI
Definition
CreatureAI.h:61
CreatureAI::me
Creature *const me
Definition
CreatureAI.h:63
CreatureScript
Definition
ScriptMgr.h:441
Creature
Definition
Creature.h:82
EventMap::Update
void Update(uint32 time)
Definition
EventMap.h:77
EventMap::ExecuteEvent
EventId ExecuteEvent()
Definition
EventMap.cpp:77
EventMap::ScheduleEvent
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition
EventMap.cpp:40
EventMap::Reset
void Reset()
Definition
EventMap.cpp:25
UnitAI::DoCast
SpellCastResult DoCast(uint32 spellId)
Definition
UnitAI.cpp:81
Unit
Definition
Unit.h:647
Unit::InterruptSpell
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={}, ObjectGuid const &interrupter=ObjectGuid::Empty)
Definition
Unit.cpp:3158
boss_corla
Definition
boss_corla.cpp:49
boss_corla::boss_corla
boss_corla()
Definition
boss_corla.cpp:51
boss_corla::GetAI
CreatureAI * GetAI(Creature *creature) const override
Definition
boss_corla.cpp:118
boss_corla::boss_corlaAI
Definition
boss_corla.cpp:54
boss_corla::boss_corlaAI::combatPhase
bool combatPhase
Definition
boss_corla.cpp:115
boss_corla::boss_corlaAI::JustDied
void JustDied(Unit *) override
Definition
boss_corla.cpp:78
boss_corla::boss_corlaAI::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
boss_corla.cpp:64
boss_corla::boss_corlaAI::Reset
void Reset() override
Definition
boss_corla.cpp:57
boss_corla::boss_corlaAI::KilledUnit
void KilledUnit(Unit *who) override
Definition
boss_corla.cpp:72
boss_corla::boss_corlaAI::boss_corlaAI
boss_corlaAI(Creature *creature)
Definition
boss_corla.cpp:55
boss_corla::boss_corlaAI::UpdateAI
void UpdateAI(uint32 diff) override
Definition
boss_corla.cpp:84
server
scripts
EasternKingdoms
BlackrockMountain
BlackrockCaverns
boss_corla.cpp
Generated by
1.9.8