Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
black_temple.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
/*
7
Name: Black_Temple
8
Complete: 100%
9
Comment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus.
10
*/
11
12
#include "
ScriptMgr.h
"
13
#include "
ScriptedCreature.h
"
14
#include "
ScriptedGossip.h
"
15
#include "
black_temple.h
"
16
#include "
Player.h
"
17
18
enum
Spells
19
{
20
// Spirit of Olum
21
SPELL_TELEPORT
= 41566,
22
// Wrathbone Flayer
23
SPELL_CLEAVE
= 15496,
24
SPELL_IGNORED
= 39544,
25
SPELL_SUMMON_CHANNEL
= 40094
26
};
27
28
enum
Creatures
29
{
30
NPC_BLOOD_MAGE
= 22945,
31
NPC_DEATHSHAPER
= 22882
32
};
33
34
enum
Events
35
{
36
// Wrathbone Flayer
37
EVENT_GET_CHANNELERS
= 1,
38
EVENT_SET_CHANNELERS
= 2,
39
EVENT_CLEAVE
= 3,
40
EVENT_IGNORED
= 4,
41
};
42
43
// ########################################################
44
// Spirit of Olum
45
// ########################################################
46
47
class
npc_spirit_of_olum
:
public
CreatureScript
48
{
49
public
:
50
npc_spirit_of_olum
() :
CreatureScript
(
"npc_spirit_of_olum"
) { }
51
52
struct
npc_spirit_of_olumAI
:
public
ScriptedAI
53
{
54
npc_spirit_of_olumAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
55
56
void
sGossipSelect
(
Player
* player,
uint32
/*sender*/
,
uint32
action)
OVERRIDE
57
{
58
if
(action == 1)
59
{
60
player->CLOSE_GOSSIP_MENU();
61
player->InterruptNonMeleeSpells(
false
);
62
player->CastSpell(player,
SPELL_TELEPORT
,
false
);
63
}
64
}
65
};
66
67
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
68
{
69
return
new
npc_spirit_of_olumAI
(creature);
70
}
71
};
72
73
// ########################################################
74
// Wrathbone Flayer
75
// ########################################################
76
77
class
npc_wrathbone_flayer
:
public
CreatureScript
78
{
79
public
:
80
npc_wrathbone_flayer
() :
CreatureScript
(
"npc_wrathbone_flayer"
) { }
81
82
struct
npc_wrathbone_flayerAI
:
public
ScriptedAI
83
{
84
npc_wrathbone_flayerAI
(
Creature
* creature) :
ScriptedAI
(creature)
85
{
86
instance
= creature->
GetInstanceScript
();
87
}
88
89
void
Reset
()
OVERRIDE
90
{
91
events
.ScheduleEvent(
EVENT_GET_CHANNELERS
, 3000);
92
enteredCombat
=
false
;
93
}
94
95
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
{ }
96
97
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
98
{
99
events
.ScheduleEvent(
EVENT_CLEAVE
, 5000);
100
events
.ScheduleEvent(
EVENT_IGNORED
, 7000);
101
enteredCombat
=
true
;
102
}
103
104
void
UpdateAI
(
uint32
diff)
OVERRIDE
105
{
106
if
(!
enteredCombat
)
107
{
108
events
.Update(diff);
109
110
while
(
uint32
eventId =
events
.ExecuteEvent())
111
{
112
switch
(eventId)
113
{
114
case
EVENT_GET_CHANNELERS
:
115
{
116
std::list<Creature*> BloodMageList;
117
me
->GetCreatureListWithEntryInGrid(BloodMageList,
NPC_BLOOD_MAGE
, 15.0f);
118
119
if
(!BloodMageList.empty())
120
for
(std::list<Creature*>::const_iterator itr = BloodMageList.begin(); itr != BloodMageList.end(); ++itr)
121
{
122
bloodmage
.push_back((*itr)->GetGUID());
123
if
((*itr)->isDead())
124
(*itr)->Respawn();
125
}
126
127
std::list<Creature*> DeathShaperList;
128
me
->GetCreatureListWithEntryInGrid(DeathShaperList,
NPC_DEATHSHAPER
, 15.0f);
129
130
if
(!DeathShaperList.empty())
131
for
(std::list<Creature*>::const_iterator itr = DeathShaperList.begin(); itr != DeathShaperList.end(); ++itr)
132
{
133
deathshaper
.push_back((*itr)->GetGUID());
134
if
((*itr)->isDead())
135
(*itr)->Respawn();
136
}
137
138
events
.ScheduleEvent(
EVENT_SET_CHANNELERS
, 3000);
139
140
break
;
141
}
142
case
EVENT_SET_CHANNELERS
:
143
{
144
for
(std::list<uint64>::const_iterator itr =
bloodmage
.begin(); itr !=
bloodmage
.end(); ++itr)
145
if
(
Creature
*
bloodmage
= (
Unit::GetCreature
(*
me
, *itr)))
146
bloodmage
->AI()->DoCast(
SPELL_SUMMON_CHANNEL
);
147
148
for
(std::list<uint64>::const_iterator itr =
deathshaper
.begin(); itr !=
deathshaper
.end(); ++itr)
149
if
(
Creature
*
deathshaper
= (
Unit::GetCreature
(*
me
, *itr)))
150
deathshaper
->AI()->DoCast(
SPELL_SUMMON_CHANNEL
);
151
152
events
.ScheduleEvent(
EVENT_SET_CHANNELERS
, 12000);
153
154
break
;
155
}
156
default
:
157
break
;
158
}
159
}
160
}
161
162
if
(!
UpdateVictim
())
163
return
;
164
165
events
.Update(diff);
166
167
while
(
uint32
eventId =
events
.ExecuteEvent())
168
{
169
switch
(eventId)
170
{
171
case
EVENT_CLEAVE
:
172
DoCastVictim
(
SPELL_CLEAVE
);
173
events
.ScheduleEvent(
EVENT_CLEAVE
, std::rand() % 2000 + 1000);
174
break
;
175
case
EVENT_IGNORED
:
176
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
177
DoCast
(target,
SPELL_IGNORED
);
178
events
.ScheduleEvent(
EVENT_IGNORED
, 10000);
179
break
;
180
default
:
181
break
;
182
}
183
}
184
DoMeleeAttackIfReady
();
185
}
186
187
private
:
188
InstanceScript
*
instance
;
189
EventMap
events
;
190
std::list<uint64>
bloodmage
;
191
std::list<uint64>
deathshaper
;
192
bool
enteredCombat
;
193
};
194
195
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
196
{
197
return
new
npc_wrathbone_flayerAI
(creature);
198
}
199
};
200
201
void
AddSC_black_temple
()
202
{
203
new
npc_spirit_of_olum
();
204
new
npc_wrathbone_flayer
();
205
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
Player.h
ScriptMgr.h
ScriptedCreature.h
ScriptedGossip.h
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Creatures
Creatures
Definition
alterac_valley.cpp:28
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
alterac_valley.cpp:12
Events
Events
Definition
alterac_valley.cpp:40
EVENT_CLEAVE
@ EVENT_CLEAVE
Definition
alterac_valley.cpp:42
AddSC_black_temple
void AddSC_black_temple()
Definition
black_temple.cpp:201
NPC_BLOOD_MAGE
@ NPC_BLOOD_MAGE
Definition
black_temple.cpp:30
NPC_DEATHSHAPER
@ NPC_DEATHSHAPER
Definition
black_temple.cpp:31
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
black_temple.cpp:23
SPELL_TELEPORT
@ SPELL_TELEPORT
Definition
black_temple.cpp:21
SPELL_SUMMON_CHANNEL
@ SPELL_SUMMON_CHANNEL
Definition
black_temple.cpp:25
SPELL_IGNORED
@ SPELL_IGNORED
Definition
black_temple.cpp:24
EVENT_GET_CHANNELERS
@ EVENT_GET_CHANNELERS
Definition
black_temple.cpp:37
EVENT_SET_CHANNELERS
@ EVENT_SET_CHANNELERS
Definition
black_temple.cpp:38
EVENT_CLEAVE
@ EVENT_CLEAVE
Definition
black_temple.cpp:39
EVENT_IGNORED
@ EVENT_IGNORED
Definition
black_temple.cpp:40
black_temple.h
SPELL_TELEPORT
@ SPELL_TELEPORT
Definition
boss_majordomo_executus.cpp:38
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
EventMap
Definition
CreatureAIImpl.h:304
InstanceScript
Definition
InstanceScript.h:123
Player
Definition
Player.h:1289
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::SelectTarget
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition
UnitAI.cpp:66
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
Unit::GetCreature
static Creature * GetCreature(WorldObject &object, uint64 guid)
Definition
Unit.cpp:4905
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
npc_spirit_of_olum
Definition
black_temple.cpp:48
npc_spirit_of_olum::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
black_temple.cpp:67
npc_spirit_of_olum::npc_spirit_of_olum
npc_spirit_of_olum()
Definition
black_temple.cpp:50
npc_wrathbone_flayer
Definition
black_temple.cpp:78
npc_wrathbone_flayer::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
black_temple.cpp:195
npc_wrathbone_flayer::npc_wrathbone_flayer
npc_wrathbone_flayer()
Definition
black_temple.cpp:80
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
npc_spirit_of_olum::npc_spirit_of_olumAI
Definition
black_temple.cpp:53
npc_spirit_of_olum::npc_spirit_of_olumAI::npc_spirit_of_olumAI
npc_spirit_of_olumAI(Creature *creature)
Definition
black_temple.cpp:54
npc_spirit_of_olum::npc_spirit_of_olumAI::sGossipSelect
void sGossipSelect(Player *player, uint32, uint32 action) OVERRIDE
Definition
black_temple.cpp:56
npc_wrathbone_flayer::npc_wrathbone_flayerAI
Definition
black_temple.cpp:83
npc_wrathbone_flayer::npc_wrathbone_flayerAI::bloodmage
std::list< uint64 > bloodmage
Definition
black_temple.cpp:190
npc_wrathbone_flayer::npc_wrathbone_flayerAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
black_temple.cpp:95
npc_wrathbone_flayer::npc_wrathbone_flayerAI::instance
InstanceScript * instance
Definition
black_temple.cpp:188
npc_wrathbone_flayer::npc_wrathbone_flayerAI::deathshaper
std::list< uint64 > deathshaper
Definition
black_temple.cpp:191
npc_wrathbone_flayer::npc_wrathbone_flayerAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
black_temple.cpp:97
npc_wrathbone_flayer::npc_wrathbone_flayerAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
black_temple.cpp:104
npc_wrathbone_flayer::npc_wrathbone_flayerAI::enteredCombat
bool enteredCombat
Definition
black_temple.cpp:192
npc_wrathbone_flayer::npc_wrathbone_flayerAI::events
EventMap events
Definition
black_temple.cpp:189
npc_wrathbone_flayer::npc_wrathbone_flayerAI::Reset
void Reset() OVERRIDE
Definition
black_temple.cpp:89
npc_wrathbone_flayer::npc_wrathbone_flayerAI::npc_wrathbone_flayerAI
npc_wrathbone_flayerAI(Creature *creature)
Definition
black_temple.cpp:84
src
server
scripts
Outland
BlackTemple
black_temple.cpp
Generated on
for Project SkyFire Core by
1.17.0