Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_omor_the_unscarred.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_Omar_The_Unscarred
8
SD%Complete: 90
9
SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper.
10
SDCategory: Hellfire Citadel, Hellfire Ramparts
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
Player.h
"
16
#include "
hellfire_ramparts.h
"
17
18
enum
Says
19
{
20
SAY_AGGRO
= 0,
21
SAY_SUMMON
= 1,
22
SAY_CURSE
= 2,
23
SAY_KILL_1
= 3,
24
SAY_DIE
= 4,
25
SAY_WIPE
= 5
26
};
27
28
enum
Spells
29
{
30
SPELL_ORBITAL_STRIKE
= 30637,
31
SPELL_SHADOW_WHIP
= 30638,
32
SPELL_TREACHEROUS_AURA
= 30695,
33
H_SPELL_BANE_OF_TREACHERY
= 37566,
34
SPELL_DEMONIC_SHIELD
= 31901,
35
SPELL_SHADOW_BOLT
= 30686,
36
H_SPELL_SHADOW_BOLT
= 39297,
37
SPELL_SUMMON_FIENDISH_HOUND
= 30707
38
};
39
40
class
boss_omor_the_unscarred
:
public
CreatureScript
41
{
42
public
:
43
boss_omor_the_unscarred
() :
CreatureScript
(
"boss_omor_the_unscarred"
) { }
44
45
struct
boss_omor_the_unscarredAI
:
public
BossAI
46
{
47
boss_omor_the_unscarredAI
(
Creature
* creature) :
BossAI
(creature,
DATA_OMOR_THE_UNSCARRED
)
48
{
49
SetCombatMovement
(
false
);
50
}
51
52
void
Reset
()
OVERRIDE
53
{
54
Talk
(
SAY_WIPE
);
55
56
OrbitalStrike_Timer
= 25000;
57
ShadowWhip_Timer
= 2000;
58
Aura_Timer
= 10000;
59
DemonicShield_Timer
= 1000;
60
Shadowbolt_Timer
= 2000;
61
Summon_Timer
= 10000;
62
SummonedCount
= 0;
63
PlayerGUID
= 0;
64
CanPullBack
=
false
;
65
66
_Reset
();
67
}
68
69
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
70
{
71
_EnterCombat
();
72
Talk
(
SAY_AGGRO
);
73
}
74
75
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
76
{
77
if
(rand()%2)
78
return
;
79
80
Talk
(
SAY_KILL_1
);
81
}
82
83
void
JustSummoned
(
Creature
* summoned)
OVERRIDE
84
{
85
Talk
(
SAY_SUMMON
);
86
87
if
(
Unit
* random =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
88
summoned->AI()->AttackStart(random);
89
90
++
SummonedCount
;
91
}
92
93
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
94
{
95
Talk
(
SAY_DIE
);
96
_JustDied
();
97
}
98
99
void
UpdateAI
(
uint32
diff)
OVERRIDE
100
{
101
if
(!
UpdateVictim
())
102
return
;
103
104
//only two may be wrong, perhaps increase timer and spawn periodically instead.
105
if
(
SummonedCount
< 2)
106
{
107
if
(
Summon_Timer
<= diff)
108
{
109
me
->InterruptNonMeleeSpells(
false
);
110
DoCast
(
me
,
SPELL_SUMMON_FIENDISH_HOUND
);
111
Summon_Timer
= 15000+rand()%15000;
112
}
113
else
114
Summon_Timer
-= diff;
115
}
116
117
if
(
CanPullBack
)
118
{
119
if
(
ShadowWhip_Timer
<= diff)
120
{
121
if
(
Player
* temp =
ObjectAccessor::GetPlayer
(*
me
,
PlayerGUID
))
122
{
123
//if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted)
124
if
(temp->HasUnitMovementFlag(
MOVEMENTFLAG_FALLING_FAR
))
125
{
126
me
->InterruptNonMeleeSpells(
false
);
127
DoCast
(temp,
SPELL_SHADOW_WHIP
);
128
}
129
}
130
PlayerGUID
= 0;
131
ShadowWhip_Timer
= 2000;
132
CanPullBack
=
false
;
133
}
134
else
135
ShadowWhip_Timer
-= diff;
136
}
137
else
138
if
(
OrbitalStrike_Timer
<= diff)
139
{
140
Unit
* temp = NULL;
141
if
(
me
->IsWithinMeleeRange(
me
->GetVictim()))
142
temp =
me
->GetVictim();
143
else
temp =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0);
144
145
if
(temp && temp->
GetTypeId
() ==
TypeID::TYPEID_PLAYER
)
146
{
147
DoCast
(temp,
SPELL_ORBITAL_STRIKE
);
148
OrbitalStrike_Timer
= 14000+rand()%2000;
149
PlayerGUID
= temp->
GetGUID
();
150
151
if
(
PlayerGUID
)
152
CanPullBack
=
true
;
153
}
154
}
155
else
156
OrbitalStrike_Timer
-= diff;
157
158
if
(
HealthBelowPct
(20))
159
{
160
if
(
DemonicShield_Timer
<= diff)
161
{
162
DoCast
(
me
,
SPELL_DEMONIC_SHIELD
);
163
DemonicShield_Timer
= 15000;
164
}
165
else
166
DemonicShield_Timer
-= diff;
167
}
168
169
if
(
Aura_Timer
<= diff)
170
{
171
Talk
(
SAY_CURSE
);
172
173
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
174
{
175
DoCast
(target,
SPELL_TREACHEROUS_AURA
);
176
Aura_Timer
= 8000+rand()%8000;
177
}
178
}
179
else
180
Aura_Timer
-= diff;
181
182
if
(
Shadowbolt_Timer
<= diff)
183
{
184
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
185
{
186
if
(target)
187
target =
me
->GetVictim();
188
189
DoCast
(target,
SPELL_SHADOW_BOLT
);
190
Shadowbolt_Timer
= 4000+rand()%2500;
191
}
192
}
193
else
194
Shadowbolt_Timer
-= diff;
195
196
DoMeleeAttackIfReady
();
197
}
198
199
private
:
200
uint32
OrbitalStrike_Timer
;
201
uint32
ShadowWhip_Timer
;
202
uint32
Aura_Timer
;
203
uint32
DemonicShield_Timer
;
204
uint32
Shadowbolt_Timer
;
205
uint32
Summon_Timer
;
206
uint32
SummonedCount
;
207
uint64
PlayerGUID
;
208
bool
CanPullBack
;
209
};
210
211
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
212
{
213
return
new
boss_omor_the_unscarredAI
(creature);
214
}
215
};
216
217
void
AddSC_boss_omor_the_unscarred
()
218
{
219
new
boss_omor_the_unscarred
();
220
}
221
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
uint64
std::uint64_t uint64
Definition
Define.h:76
TypeID::TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
Object.h:55
Player.h
ScriptMgr.h
ScriptedCreature.h
MOVEMENTFLAG_FALLING_FAR
@ MOVEMENTFLAG_FALLING_FAR
Definition
Unit.h:735
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
SAY_WIPE
@ SAY_WIPE
Definition
boss_blood_queen_lana_thel.cpp:25
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SPELL_SHADOW_BOLT
@ SPELL_SHADOW_BOLT
Definition
boss_gehennas.cpp:22
Says
Says
Definition
boss_halycon.cpp:17
SAY_DIE
@ SAY_DIE
Definition
boss_kelidan_the_breaker.cpp:29
SAY_WIPE
@ SAY_WIPE
Definition
boss_omor_the_unscarred.cpp:25
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_omor_the_unscarred.cpp:20
SAY_CURSE
@ SAY_CURSE
Definition
boss_omor_the_unscarred.cpp:22
SAY_KILL_1
@ SAY_KILL_1
Definition
boss_omor_the_unscarred.cpp:23
SAY_DIE
@ SAY_DIE
Definition
boss_omor_the_unscarred.cpp:24
SAY_SUMMON
@ SAY_SUMMON
Definition
boss_omor_the_unscarred.cpp:21
SPELL_TREACHEROUS_AURA
@ SPELL_TREACHEROUS_AURA
Definition
boss_omor_the_unscarred.cpp:32
SPELL_ORBITAL_STRIKE
@ SPELL_ORBITAL_STRIKE
Definition
boss_omor_the_unscarred.cpp:30
H_SPELL_BANE_OF_TREACHERY
@ H_SPELL_BANE_OF_TREACHERY
Definition
boss_omor_the_unscarred.cpp:33
SPELL_SUMMON_FIENDISH_HOUND
@ SPELL_SUMMON_FIENDISH_HOUND
Definition
boss_omor_the_unscarred.cpp:37
SPELL_SHADOW_BOLT
@ SPELL_SHADOW_BOLT
Definition
boss_omor_the_unscarred.cpp:35
SPELL_SHADOW_WHIP
@ SPELL_SHADOW_WHIP
Definition
boss_omor_the_unscarred.cpp:31
SPELL_DEMONIC_SHIELD
@ SPELL_DEMONIC_SHIELD
Definition
boss_omor_the_unscarred.cpp:34
AddSC_boss_omor_the_unscarred
void AddSC_boss_omor_the_unscarred()
Definition
boss_omor_the_unscarred.cpp:217
H_SPELL_SHADOW_BOLT
@ H_SPELL_SHADOW_BOLT
Definition
boss_salramm_the_fleshcrafter.cpp:24
SAY_SUMMON
@ SAY_SUMMON
Definition
boss_urok_doomhowl.cpp:19
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
BossAI::_JustDied
void _JustDied()
Definition
ScriptedCreature.cpp:474
BossAI::_Reset
void _Reset()
Definition
ScriptedCreature.cpp:462
BossAI::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
ObjectAccessor::GetPlayer
static Player * GetPlayer(WorldObject const &, uint64 guid)
Definition
ObjectAccessor.cpp:219
Object::GetGUID
uint64 GetGUID() const
Definition
Object.h:119
Object::GetTypeId
TypeID GetTypeId() const
Definition
Object.h:131
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
Unit
Definition
Unit.h:1367
boss_omor_the_unscarred
Definition
boss_omor_the_unscarred.cpp:41
boss_omor_the_unscarred::boss_omor_the_unscarred
boss_omor_the_unscarred()
Definition
boss_omor_the_unscarred.cpp:43
boss_omor_the_unscarred::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_omor_the_unscarred.cpp:211
hellfire_ramparts.h
DATA_OMOR_THE_UNSCARRED
@ DATA_OMOR_THE_UNSCARRED
Definition
hellfire_ramparts.h:14
ScriptedAI::SetCombatMovement
void SetCombatMovement(bool allowMovement)
Definition
ScriptedCreature.cpp:394
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
boss_omor_the_unscarred::boss_omor_the_unscarredAI
Definition
boss_omor_the_unscarred.cpp:46
boss_omor_the_unscarred::boss_omor_the_unscarredAI::ShadowWhip_Timer
uint32 ShadowWhip_Timer
Definition
boss_omor_the_unscarred.cpp:201
boss_omor_the_unscarred::boss_omor_the_unscarredAI::Reset
void Reset() OVERRIDE
Definition
boss_omor_the_unscarred.cpp:52
boss_omor_the_unscarred::boss_omor_the_unscarredAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_omor_the_unscarred.cpp:75
boss_omor_the_unscarred::boss_omor_the_unscarredAI::boss_omor_the_unscarredAI
boss_omor_the_unscarredAI(Creature *creature)
Definition
boss_omor_the_unscarred.cpp:47
boss_omor_the_unscarred::boss_omor_the_unscarredAI::CanPullBack
bool CanPullBack
Definition
boss_omor_the_unscarred.cpp:208
boss_omor_the_unscarred::boss_omor_the_unscarredAI::Aura_Timer
uint32 Aura_Timer
Definition
boss_omor_the_unscarred.cpp:202
boss_omor_the_unscarred::boss_omor_the_unscarredAI::SummonedCount
uint32 SummonedCount
Definition
boss_omor_the_unscarred.cpp:206
boss_omor_the_unscarred::boss_omor_the_unscarredAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_omor_the_unscarred.cpp:99
boss_omor_the_unscarred::boss_omor_the_unscarredAI::JustSummoned
void JustSummoned(Creature *summoned) OVERRIDE
Definition
boss_omor_the_unscarred.cpp:83
boss_omor_the_unscarred::boss_omor_the_unscarredAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_omor_the_unscarred.cpp:93
boss_omor_the_unscarred::boss_omor_the_unscarredAI::OrbitalStrike_Timer
uint32 OrbitalStrike_Timer
Definition
boss_omor_the_unscarred.cpp:200
boss_omor_the_unscarred::boss_omor_the_unscarredAI::PlayerGUID
uint64 PlayerGUID
Definition
boss_omor_the_unscarred.cpp:207
boss_omor_the_unscarred::boss_omor_the_unscarredAI::Shadowbolt_Timer
uint32 Shadowbolt_Timer
Definition
boss_omor_the_unscarred.cpp:204
boss_omor_the_unscarred::boss_omor_the_unscarredAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_omor_the_unscarred.cpp:69
boss_omor_the_unscarred::boss_omor_the_unscarredAI::Summon_Timer
uint32 Summon_Timer
Definition
boss_omor_the_unscarred.cpp:205
boss_omor_the_unscarred::boss_omor_the_unscarredAI::DemonicShield_Timer
uint32 DemonicShield_Timer
Definition
boss_omor_the_unscarred.cpp:203
src
server
scripts
Outland
HellfireCitadel
HellfireRamparts
boss_omor_the_unscarred.cpp
Generated on
for Project SkyFire Core by
1.17.0