Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_ouro.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
/* ScriptData
7
SDName: Boss_Ouro
8
SD%Complete: 85
9
SDComment: No model for submerging. Currently just invisible.
10
SDCategory: Temple of Ahn'Qiraj
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
temple_of_ahnqiraj.h
"
16
17
enum
Spells
18
{
19
SPELL_SWEEP
= 26103,
20
SPELL_SANDBLAST
= 26102,
21
SPELL_GROUND_RUPTURE
= 26100,
22
SPELL_BIRTH
= 26262,
// The Birth Animation
23
SPELL_DIRTMOUND_PASSIVE
= 26092
24
};
25
26
class
boss_ouro
:
public
CreatureScript
27
{
28
public
:
29
boss_ouro
() :
CreatureScript
(
"boss_ouro"
) { }
30
31
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
32
{
33
return
new
boss_ouroAI
(creature);
34
}
35
36
struct
boss_ouroAI
:
public
ScriptedAI
37
{
38
boss_ouroAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
39
40
uint32
Sweep_Timer
;
41
uint32
SandBlast_Timer
;
42
uint32
Submerge_Timer
;
43
uint32
Back_Timer
;
44
uint32
ChangeTarget_Timer
;
45
uint32
Spawn_Timer
;
46
47
bool
Enrage
;
48
bool
Submerged
;
49
50
void
Reset
()
OVERRIDE
51
{
52
Sweep_Timer
= std::rand() % 10000 + 5000;
53
SandBlast_Timer
= std::rand() % 35000 + 20000;
54
Submerge_Timer
= std::rand() % 150000 + 90000;
55
Back_Timer
= std::rand() % 45000 + 30000;
56
ChangeTarget_Timer
= std::rand() % 8000 + 5000;
57
Spawn_Timer
= std::rand() % 20000 + 10000;
58
59
Enrage
=
false
;
60
Submerged
=
false
;
61
}
62
63
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
64
{
65
DoCastVictim
(
SPELL_BIRTH
);
66
}
67
68
void
UpdateAI
(
uint32
diff)
OVERRIDE
69
{
70
//Return since we have no target
71
if
(!
UpdateVictim
())
72
return
;
73
74
//Sweep_Timer
75
if
(!
Submerged
&&
Sweep_Timer
<= diff)
76
{
77
DoCastVictim
(
SPELL_SWEEP
);
78
Sweep_Timer
= std::rand() % 30000 + 15000;
79
}
80
else
Sweep_Timer
-= diff;
81
82
//SandBlast_Timer
83
if
(!
Submerged
&&
SandBlast_Timer
<= diff)
84
{
85
DoCastVictim
(
SPELL_SANDBLAST
);
86
SandBlast_Timer
= std::rand() % 35000 + 20000;
87
}
88
else
SandBlast_Timer
-= diff;
89
90
//Submerge_Timer
91
if
(!
Submerged
&&
Submerge_Timer
<= diff)
92
{
93
//Cast
94
me
->HandleEmoteCommand(
EMOTE_ONESHOT_SUBMERGE
);
95
me
->SetFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NOT_SELECTABLE
);
96
me
->setFaction(35);
97
DoCast
(
me
,
SPELL_DIRTMOUND_PASSIVE
);
98
99
Submerged
=
true
;
100
Back_Timer
= std::rand() % 45000 + 30000;
101
}
102
else
Submerge_Timer
-= diff;
103
104
//ChangeTarget_Timer
105
if
(
Submerged
&&
ChangeTarget_Timer
<= diff)
106
{
107
Unit
* target = NULL;
108
target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0);
109
110
if
(target)
111
DoTeleportTo
(target->
GetPositionX
(), target->
GetPositionY
(), target->
GetPositionZ
());
112
113
ChangeTarget_Timer
= std::rand() % 20000 + 10000;
114
}
115
else
ChangeTarget_Timer
-= diff;
116
117
//Back_Timer
118
if
(
Submerged
&&
Back_Timer
<= diff)
119
{
120
me
->RemoveFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NOT_SELECTABLE
);
121
me
->setFaction(14);
122
123
DoCastVictim
(
SPELL_GROUND_RUPTURE
);
124
125
Submerged
=
false
;
126
Submerge_Timer
= std::rand() % 120000 + 60000;
127
}
128
else
Back_Timer
-= diff;
129
130
DoMeleeAttackIfReady
();
131
}
132
};
133
};
134
135
void
AddSC_boss_ouro
()
136
{
137
new
boss_ouro
();
138
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ScriptMgr.h
ScriptedCreature.h
EMOTE_ONESHOT_SUBMERGE
@ EMOTE_ONESHOT_SUBMERGE
Definition
SharedDefines.h:2206
UNIT_FLAG_NOT_SELECTABLE
@ UNIT_FLAG_NOT_SELECTABLE
Definition
Unit.h:650
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
UNIT_FIELD_FLAGS
@ UNIT_FIELD_FLAGS
Definition
UpdateFields.h:82
SPELL_GROUND_RUPTURE
@ SPELL_GROUND_RUPTURE
Definition
boss_cthun.cpp:77
SPELL_BIRTH
@ SPELL_BIRTH
Definition
boss_ouro.cpp:22
SPELL_DIRTMOUND_PASSIVE
@ SPELL_DIRTMOUND_PASSIVE
Definition
boss_ouro.cpp:23
SPELL_SWEEP
@ SPELL_SWEEP
Definition
boss_ouro.cpp:19
SPELL_GROUND_RUPTURE
@ SPELL_GROUND_RUPTURE
Definition
boss_ouro.cpp:21
SPELL_SANDBLAST
@ SPELL_SANDBLAST
Definition
boss_ouro.cpp:20
AddSC_boss_ouro
void AddSC_boss_ouro()
Definition
boss_ouro.cpp:135
SPELL_SWEEP
@ SPELL_SWEEP
Definition
boss_randolph_moloch.cpp:27
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
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
boss_ouro
Definition
boss_ouro.cpp:27
boss_ouro::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_ouro.cpp:31
boss_ouro::boss_ouro
boss_ouro()
Definition
boss_ouro.cpp:29
Position::GetPositionZ
float GetPositionZ() const
Definition
Object.h:330
Position::GetPositionX
float GetPositionX() const
Definition
Object.h:328
Position::GetPositionY
float GetPositionY() const
Definition
Object.h:329
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::DoTeleportTo
void DoTeleportTo(float x, float y, float z, uint32 time=0)
Definition
ScriptedCreature.cpp:292
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_ouro::boss_ouroAI
Definition
boss_ouro.cpp:37
boss_ouro::boss_ouroAI::Enrage
bool Enrage
Definition
boss_ouro.cpp:47
boss_ouro::boss_ouroAI::Back_Timer
uint32 Back_Timer
Definition
boss_ouro.cpp:43
boss_ouro::boss_ouroAI::Reset
void Reset() OVERRIDE
Definition
boss_ouro.cpp:50
boss_ouro::boss_ouroAI::Submerge_Timer
uint32 Submerge_Timer
Definition
boss_ouro.cpp:42
boss_ouro::boss_ouroAI::boss_ouroAI
boss_ouroAI(Creature *creature)
Definition
boss_ouro.cpp:38
boss_ouro::boss_ouroAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_ouro.cpp:68
boss_ouro::boss_ouroAI::ChangeTarget_Timer
uint32 ChangeTarget_Timer
Definition
boss_ouro.cpp:44
boss_ouro::boss_ouroAI::Sweep_Timer
uint32 Sweep_Timer
Definition
boss_ouro.cpp:40
boss_ouro::boss_ouroAI::Submerged
bool Submerged
Definition
boss_ouro.cpp:48
boss_ouro::boss_ouroAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_ouro.cpp:63
boss_ouro::boss_ouroAI::Spawn_Timer
uint32 Spawn_Timer
Definition
boss_ouro.cpp:45
boss_ouro::boss_ouroAI::SandBlast_Timer
uint32 SandBlast_Timer
Definition
boss_ouro.cpp:41
temple_of_ahnqiraj.h
src
server
scripts
Kalimdor
TempleOfAhnQiraj
boss_ouro.cpp
Generated on
for Project SkyFire Core by
1.17.0