TrinityCore
Loading...
Searching...
No Matches
boss_hydromancer_thespia.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
/* Timers requires update */
19
20
#include "
ScriptMgr.h
"
21
#include "
ScriptedCreature.h
"
22
#include "
SpellInfo.h
"
23
#include "
steam_vault.h
"
24
25
enum
ThespiaTexts
26
{
27
SAY_CLOUD
= 0,
28
SAY_AGGRO
= 1,
29
SAY_SLAY
= 2,
30
SAY_DEATH
= 3
31
};
32
33
enum
ThespiaSpells
34
{
35
SPELL_LIGHTNING_CLOUD
= 25033,
36
SPELL_LUNG_BURST
= 31481,
37
SPELL_ENVELOPING_WINDS
= 31718,
38
39
SPELL_WATER_BOLT_VOLLEY
= 34449
40
};
41
42
enum
ThespiaEvents
43
{
44
EVENT_LIGHTNING_CLOUD
= 1,
45
EVENT_LUNG_BURST
,
46
EVENT_ENVELOPING_WINDS
47
};
48
49
// 17797 - Hydromancer Thespia
50
struct
boss_hydromancer_thespia
:
public
BossAI
51
{
52
boss_hydromancer_thespia
(
Creature
* creature) :
BossAI
(creature,
DATA_HYDROMANCER_THESPIA
) { }
53
54
void
JustEngagedWith
(
Unit
* who)
override
55
{
56
Talk
(
SAY_AGGRO
);
57
BossAI::JustEngagedWith
(who);
58
59
events
.
ScheduleEvent
(
EVENT_LIGHTNING_CLOUD
, 10s, 15s);
60
events
.
ScheduleEvent
(
EVENT_LUNG_BURST
, 7s, 12s);
61
events
.
ScheduleEvent
(
EVENT_ENVELOPING_WINDS
, 10s, 15s);
62
}
63
64
void
OnSpellCast
(
SpellInfo
const
* spell)
override
65
{
66
if
(spell->
Id
==
SPELL_LIGHTNING_CLOUD
)
67
if
(
roll_chance_i
(50))
68
Talk
(
SAY_CLOUD
);
69
}
70
71
void
KilledUnit
(
Unit
* who)
override
72
{
73
if
(who->
GetTypeId
() ==
TYPEID_PLAYER
)
74
Talk
(
SAY_SLAY
);
75
}
76
77
void
JustDied
(
Unit
*
/*killer*/
)
override
78
{
79
Talk
(
SAY_DEATH
);
80
_JustDied
();
81
}
82
83
void
ExecuteEvent
(
uint32
eventId)
override
84
{
85
switch
(eventId)
86
{
87
case
EVENT_LIGHTNING_CLOUD
:
88
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 30.0f,
true
))
89
DoCast
(target,
SPELL_LIGHTNING_CLOUD
);
90
events
.
Repeat
(15s, 25s);
91
break
;
92
case
EVENT_LUNG_BURST
:
93
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 40.0f,
true
))
94
DoCast
(target,
SPELL_LUNG_BURST
);
95
events
.
Repeat
(7s, 12s);
96
break
;
97
case
EVENT_ENVELOPING_WINDS
:
98
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 35.0f,
true
))
99
DoCast
(target,
SPELL_ENVELOPING_WINDS
);
100
events
.
Repeat
(10s, 15s);
101
break
;
102
default
:
103
break
;
104
}
105
}
106
};
107
108
// 17917 - Coilfang Water Elemental
109
struct
npc_coilfang_waterelemental
:
public
ScriptedAI
110
{
111
npc_coilfang_waterelemental
(
Creature
* creature) :
ScriptedAI
(creature) { }
112
113
void
Reset
()
override
114
{
115
_scheduler
.
CancelAll
();
116
}
117
118
void
JustEngagedWith
(
Unit
*
/*who*/
)
override
119
{
120
_scheduler
.
Schedule
(4s, 12s, [
this
](
TaskContext
task)
121
{
122
DoCastSelf
(
SPELL_WATER_BOLT_VOLLEY
);
123
task.
Repeat
(8s, 15s);
124
});
125
}
126
127
void
UpdateAI
(
uint32
diff)
override
128
{
129
if
(!
UpdateVictim
())
130
return
;
131
132
_scheduler
.
Update
(diff);
133
134
DoMeleeAttackIfReady
();
135
}
136
137
private
:
138
TaskScheduler
_scheduler
;
139
};
140
141
void
AddSC_boss_hydromancer_thespia
()
142
{
143
RegisterSteamVaultCreatureAI
(
boss_hydromancer_thespia
);
144
RegisterSteamVaultCreatureAI
(
npc_coilfang_waterelemental
);
145
}
uint32
uint32_t uint32
Definition
Define.h:133
TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
ObjectGuid.h:39
roll_chance_i
bool roll_chance_i(int chance)
Definition
Random.h:59
ScriptMgr.h
ScriptedCreature.h
SpellInfo.h
SelectTargetMethod::Random
@ Random
Talk
Talk
Definition
boss_hadronox.cpp:129
AddSC_boss_hydromancer_thespia
void AddSC_boss_hydromancer_thespia()
Definition
boss_hydromancer_thespia.cpp:141
ThespiaEvents
ThespiaEvents
Definition
boss_hydromancer_thespia.cpp:43
EVENT_LUNG_BURST
@ EVENT_LUNG_BURST
Definition
boss_hydromancer_thespia.cpp:45
EVENT_ENVELOPING_WINDS
@ EVENT_ENVELOPING_WINDS
Definition
boss_hydromancer_thespia.cpp:46
EVENT_LIGHTNING_CLOUD
@ EVENT_LIGHTNING_CLOUD
Definition
boss_hydromancer_thespia.cpp:44
ThespiaTexts
ThespiaTexts
Definition
boss_hydromancer_thespia.cpp:26
SAY_DEATH
@ SAY_DEATH
Definition
boss_hydromancer_thespia.cpp:30
SAY_CLOUD
@ SAY_CLOUD
Definition
boss_hydromancer_thespia.cpp:27
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_hydromancer_thespia.cpp:28
SAY_SLAY
@ SAY_SLAY
Definition
boss_hydromancer_thespia.cpp:29
ThespiaSpells
ThespiaSpells
Definition
boss_hydromancer_thespia.cpp:34
SPELL_LUNG_BURST
@ SPELL_LUNG_BURST
Definition
boss_hydromancer_thespia.cpp:36
SPELL_WATER_BOLT_VOLLEY
@ SPELL_WATER_BOLT_VOLLEY
Definition
boss_hydromancer_thespia.cpp:39
SPELL_ENVELOPING_WINDS
@ SPELL_ENVELOPING_WINDS
Definition
boss_hydromancer_thespia.cpp:37
SPELL_LIGHTNING_CLOUD
@ SPELL_LIGHTNING_CLOUD
Definition
boss_hydromancer_thespia.cpp:35
BossAI
Definition
ScriptedCreature.h:313
BossAI::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
ScriptedCreature.h:334
BossAI::events
EventMap events
Definition
ScriptedCreature.h:349
BossAI::_JustDied
void _JustDied()
Definition
ScriptedCreature.cpp:532
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:240
Creature
Definition
Creature.h:62
EventMap::Repeat
void Repeat(Milliseconds time)
Definition
EventMap.cpp:63
EventMap::ScheduleEvent
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition
EventMap.cpp:36
Object::GetTypeId
TypeID GetTypeId() const
Definition
Object.h:93
SpellInfo
Definition
SpellInfo.h:285
SpellInfo::Id
uint32 Id
Definition
SpellInfo.h:289
TaskContext
Definition
TaskScheduler.h:392
TaskContext::Repeat
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition
TaskScheduler.h:462
TaskScheduler
Definition
TaskScheduler.h:48
TaskScheduler::CancelAll
TaskScheduler & CancelAll()
Definition
TaskScheduler.cpp:45
TaskScheduler::Schedule
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition
TaskScheduler.h:225
TaskScheduler::Update
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition
TaskScheduler.cpp:27
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:54
UnitAI::DoCastSelf
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.h:241
UnitAI::SelectTarget
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition
UnitAI.cpp:96
UnitAI::DoCast
SpellCastResult DoCast(uint32 spellId)
Definition
UnitAI.cpp:106
Unit
Definition
Unit.h:769
steam_vault.h
DATA_HYDROMANCER_THESPIA
@ DATA_HYDROMANCER_THESPIA
Definition
steam_vault.h:30
RegisterSteamVaultCreatureAI
#define RegisterSteamVaultCreatureAI(ai_name)
Definition
steam_vault.h:70
ScriptedAI
Definition
ScriptedCreature.h:132
boss_hydromancer_thespia
Definition
boss_hydromancer_thespia.cpp:51
boss_hydromancer_thespia::ExecuteEvent
void ExecuteEvent(uint32 eventId) override
Definition
boss_hydromancer_thespia.cpp:83
boss_hydromancer_thespia::boss_hydromancer_thespia
boss_hydromancer_thespia(Creature *creature)
Definition
boss_hydromancer_thespia.cpp:52
boss_hydromancer_thespia::KilledUnit
void KilledUnit(Unit *who) override
Definition
boss_hydromancer_thespia.cpp:71
boss_hydromancer_thespia::OnSpellCast
void OnSpellCast(SpellInfo const *spell) override
Definition
boss_hydromancer_thespia.cpp:64
boss_hydromancer_thespia::JustDied
void JustDied(Unit *) override
Definition
boss_hydromancer_thespia.cpp:77
boss_hydromancer_thespia::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
boss_hydromancer_thespia.cpp:54
npc_coilfang_waterelemental
Definition
boss_hydromancer_thespia.cpp:110
npc_coilfang_waterelemental::npc_coilfang_waterelemental
npc_coilfang_waterelemental(Creature *creature)
Definition
boss_hydromancer_thespia.cpp:111
npc_coilfang_waterelemental::UpdateAI
void UpdateAI(uint32 diff) override
Definition
boss_hydromancer_thespia.cpp:127
npc_coilfang_waterelemental::JustEngagedWith
void JustEngagedWith(Unit *) override
Definition
boss_hydromancer_thespia.cpp:118
npc_coilfang_waterelemental::Reset
void Reset() override
Definition
boss_hydromancer_thespia.cpp:113
npc_coilfang_waterelemental::_scheduler
TaskScheduler _scheduler
Definition
boss_hydromancer_thespia.cpp:138
server
scripts
Outland
CoilfangReservoir
SteamVault
boss_hydromancer_thespia.cpp
Generated on Sun May 10 2026 02:30:24 for TrinityCore by
1.9.8