Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_shirrak_the_dead_watcher.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
Name: Boss_Shirrak_the_dead_watcher
8
%Complete: 80
9
Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented
10
Category: Auchindoun, Auchenai Crypts
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
Player.h
"
16
17
enum
Spells
18
{
19
SPELL_INHIBITMAGIC
= 32264,
20
SPELL_ATTRACTMAGIC
= 32265,
21
SPELL_CARNIVOROUSBITE
= 36383,
22
23
SPELL_FIERY_BLAST
= 32302,
24
25
SPELL_FOCUS_FIRE_VISUAL
= 42075
//need to find better visual
26
};
27
28
enum
Say
29
{
30
EMOTE_FOCUSED
= 0
31
};
32
33
enum
Creatures
34
{
35
NPC_FOCUS_FIRE
= 18374
36
};
37
38
class
boss_shirrak_the_dead_watcher
:
public
CreatureScript
39
{
40
public
:
41
boss_shirrak_the_dead_watcher
() :
CreatureScript
(
"boss_shirrak_the_dead_watcher"
) { }
42
43
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
44
{
45
return
new
boss_shirrak_the_dead_watcherAI
(creature);
46
}
47
48
struct
boss_shirrak_the_dead_watcherAI
:
public
ScriptedAI
49
{
50
boss_shirrak_the_dead_watcherAI
(
Creature
* creature) :
ScriptedAI
(creature)
51
{
52
}
53
54
uint32
Inhibitmagic_Timer
;
55
uint32
Attractmagic_Timer
;
56
uint32
Carnivorousbite_Timer
;
57
uint32
FocusFire_Timer
;
58
59
uint64
FocusedTargetGUID
;
60
61
void
Reset
()
OVERRIDE
62
{
63
Inhibitmagic_Timer
= 0;
64
Attractmagic_Timer
= 28000;
65
Carnivorousbite_Timer
= 10000;
66
FocusFire_Timer
= 17000;
67
FocusedTargetGUID
= 0;
68
}
69
70
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
71
{ }
72
73
void
JustSummoned
(
Creature
* summoned)
OVERRIDE
74
{
75
if
(summoned && summoned->GetEntry() ==
NPC_FOCUS_FIRE
)
76
{
77
summoned->CastSpell(summoned,
SPELL_FOCUS_FIRE_VISUAL
,
false
);
78
summoned->setFaction(
me
->getFaction());
79
summoned->SetLevel(
me
->getLevel());
80
summoned->AddUnitState(
UNIT_STATE_ROOT
);
81
82
if
(
Unit
* pFocusedTarget =
Unit::GetUnit
(*
me
,
FocusedTargetGUID
))
83
summoned->AI()->AttackStart(pFocusedTarget);
84
}
85
}
86
87
void
UpdateAI
(
uint32
diff)
OVERRIDE
88
{
89
//Inhibitmagic_Timer
90
if
(
Inhibitmagic_Timer
<= diff)
91
{
92
float
dist;
93
Map
* map =
me
->GetMap();
94
Map::PlayerList
const
&PlayerList = map->
GetPlayers
();
95
for
(
Map::PlayerList::const_iterator
i = PlayerList.
begin
(); i != PlayerList.
end
(); ++i)
96
if
(
Player
* i_pl = i->GetSource())
97
if
(i_pl->IsAlive() && (dist = i_pl->IsWithinDist(
me
, 45)))
98
{
99
i_pl->RemoveAurasDueToSpell(
SPELL_INHIBITMAGIC
);
100
me
->AddAura(
SPELL_INHIBITMAGIC
, i_pl);
101
if
(dist < 35)
102
me
->AddAura(
SPELL_INHIBITMAGIC
, i_pl);
103
if
(dist < 25)
104
me
->AddAura(
SPELL_INHIBITMAGIC
, i_pl);
105
if
(dist < 15)
106
me
->AddAura(
SPELL_INHIBITMAGIC
, i_pl);
107
}
108
Inhibitmagic_Timer
= 3000+(rand()%1000);
109
}
else
Inhibitmagic_Timer
-= diff;
110
111
//Return since we have no target
112
if
(!
UpdateVictim
())
113
return
;
114
115
//Attractmagic_Timer
116
if
(
Attractmagic_Timer
<= diff)
117
{
118
DoCast
(
me
,
SPELL_ATTRACTMAGIC
);
119
Attractmagic_Timer
= 30000;
120
Carnivorousbite_Timer
= 1500;
121
}
else
Attractmagic_Timer
-= diff;
122
123
//Carnivorousbite_Timer
124
if
(
Carnivorousbite_Timer
<= diff)
125
{
126
DoCast
(
me
,
SPELL_CARNIVOROUSBITE
);
127
Carnivorousbite_Timer
= 10000;
128
}
else
Carnivorousbite_Timer
-= diff;
129
130
//FocusFire_Timer
131
if
(
FocusFire_Timer
<= diff)
132
{
133
// Summon Focus Fire & Emote
134
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 1);
135
if
(target && target->
GetTypeId
() ==
TypeID::TYPEID_PLAYER
&& target->
IsAlive
())
136
{
137
FocusedTargetGUID
= target->
GetGUID
();
138
me
->SummonCreature(
NPC_FOCUS_FIRE
, target->
GetPositionX
(), target->
GetPositionY
(), target->
GetPositionZ
(), 0,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 5500);
139
Talk
(
EMOTE_FOCUSED
, target);
140
}
141
FocusFire_Timer
= 15000+(rand()%5000);
142
}
else
FocusFire_Timer
-= diff;
143
144
DoMeleeAttackIfReady
();
145
}
146
};
147
};
148
149
class
npc_focus_fire
:
public
CreatureScript
150
{
151
public
:
152
npc_focus_fire
() :
CreatureScript
(
"npc_focus_fire"
) { }
153
154
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
155
{
156
return
new
npc_focus_fireAI
(creature);
157
}
158
159
struct
npc_focus_fireAI
:
public
ScriptedAI
160
{
161
npc_focus_fireAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
162
163
uint32
FieryBlast_Timer
;
164
bool
fiery1
,
fiery2
;
165
166
void
Reset
()
OVERRIDE
167
{
168
FieryBlast_Timer
= 3000+(rand()%1000);
169
fiery1
=
fiery2
=
true
;
170
}
171
172
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
173
{ }
174
175
void
UpdateAI
(
uint32
diff)
OVERRIDE
176
{
177
//Return since we have no target
178
if
(!
UpdateVictim
())
179
return
;
180
181
//FieryBlast_Timer
182
if
(
fiery2
&&
FieryBlast_Timer
<= diff)
183
{
184
DoCast
(
me
,
SPELL_FIERY_BLAST
);
185
186
if
(
fiery1
)
fiery1
=
false
;
187
else
if
(
fiery2
)
fiery2
=
false
;
188
189
FieryBlast_Timer
= 1000;
190
}
else
FieryBlast_Timer
-= diff;
191
192
DoMeleeAttackIfReady
();
193
}
194
};
195
};
196
197
void
AddSC_boss_shirrak_the_dead_watcher
()
198
{
199
new
boss_shirrak_the_dead_watcher
();
200
new
npc_focus_fire
();
201
}
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
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
Definition
Object.h:70
Player.h
ScriptMgr.h
ScriptedCreature.h
UNIT_STATE_ROOT
@ UNIT_STATE_ROOT
Definition
Unit.h:522
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Creatures
Creatures
Definition
alterac_valley.cpp:28
Say
Say
Definition
boss_broodlord_lashlayer.cpp:11
AddSC_boss_shirrak_the_dead_watcher
void AddSC_boss_shirrak_the_dead_watcher()
Definition
boss_shirrak_the_dead_watcher.cpp:197
NPC_FOCUS_FIRE
@ NPC_FOCUS_FIRE
Definition
boss_shirrak_the_dead_watcher.cpp:35
SPELL_CARNIVOROUSBITE
@ SPELL_CARNIVOROUSBITE
Definition
boss_shirrak_the_dead_watcher.cpp:21
SPELL_INHIBITMAGIC
@ SPELL_INHIBITMAGIC
Definition
boss_shirrak_the_dead_watcher.cpp:19
SPELL_ATTRACTMAGIC
@ SPELL_ATTRACTMAGIC
Definition
boss_shirrak_the_dead_watcher.cpp:20
SPELL_FIERY_BLAST
@ SPELL_FIERY_BLAST
Definition
boss_shirrak_the_dead_watcher.cpp:23
SPELL_FOCUS_FIRE_VISUAL
@ SPELL_FOCUS_FIRE_VISUAL
Definition
boss_shirrak_the_dead_watcher.cpp:25
EMOTE_FOCUSED
@ EMOTE_FOCUSED
Definition
boss_shirrak_the_dead_watcher.cpp:30
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
Map
Definition
Map.h:238
Map::PlayerList
MapRefManager PlayerList
Definition
Map.h:406
Map::GetPlayers
PlayerList const & GetPlayers() const
Definition
Map.h:407
MapRefManager::end
iterator end()
Definition
MapRefManager.h:25
MapRefManager::begin
iterator begin()
Definition
MapRefManager.h:24
MapRefManager::const_iterator
LinkedListHead::Iterator< MapReference const > const_iterator
Definition
MapRefManager.h:17
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
Unit::IsAlive
bool IsAlive() const
Definition
Unit.h:2032
Unit::GetUnit
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition
Unit.cpp:4895
boss_shirrak_the_dead_watcher
Definition
boss_shirrak_the_dead_watcher.cpp:39
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcher
boss_shirrak_the_dead_watcher()
Definition
boss_shirrak_the_dead_watcher.cpp:41
boss_shirrak_the_dead_watcher::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_shirrak_the_dead_watcher.cpp:43
npc_focus_fire
Definition
boss_shirrak_the_dead_watcher.cpp:150
npc_focus_fire::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_shirrak_the_dead_watcher.cpp:154
npc_focus_fire::npc_focus_fire
npc_focus_fire()
Definition
boss_shirrak_the_dead_watcher.cpp:152
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::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI
Definition
boss_shirrak_the_dead_watcher.cpp:49
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::FocusFire_Timer
uint32 FocusFire_Timer
Definition
boss_shirrak_the_dead_watcher.cpp:57
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::JustSummoned
void JustSummoned(Creature *summoned) OVERRIDE
Definition
boss_shirrak_the_dead_watcher.cpp:73
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::Attractmagic_Timer
uint32 Attractmagic_Timer
Definition
boss_shirrak_the_dead_watcher.cpp:55
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_shirrak_the_dead_watcher.cpp:70
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_shirrak_the_dead_watcher.cpp:87
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::Inhibitmagic_Timer
uint32 Inhibitmagic_Timer
Definition
boss_shirrak_the_dead_watcher.cpp:54
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::boss_shirrak_the_dead_watcherAI
boss_shirrak_the_dead_watcherAI(Creature *creature)
Definition
boss_shirrak_the_dead_watcher.cpp:50
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::Reset
void Reset() OVERRIDE
Definition
boss_shirrak_the_dead_watcher.cpp:61
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::Carnivorousbite_Timer
uint32 Carnivorousbite_Timer
Definition
boss_shirrak_the_dead_watcher.cpp:56
boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcherAI::FocusedTargetGUID
uint64 FocusedTargetGUID
Definition
boss_shirrak_the_dead_watcher.cpp:59
npc_focus_fire::npc_focus_fireAI
Definition
boss_shirrak_the_dead_watcher.cpp:160
npc_focus_fire::npc_focus_fireAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_shirrak_the_dead_watcher.cpp:172
npc_focus_fire::npc_focus_fireAI::FieryBlast_Timer
uint32 FieryBlast_Timer
Definition
boss_shirrak_the_dead_watcher.cpp:163
npc_focus_fire::npc_focus_fireAI::npc_focus_fireAI
npc_focus_fireAI(Creature *creature)
Definition
boss_shirrak_the_dead_watcher.cpp:161
npc_focus_fire::npc_focus_fireAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_shirrak_the_dead_watcher.cpp:175
npc_focus_fire::npc_focus_fireAI::fiery2
bool fiery2
Definition
boss_shirrak_the_dead_watcher.cpp:164
npc_focus_fire::npc_focus_fireAI::fiery1
bool fiery1
Definition
boss_shirrak_the_dead_watcher.cpp:164
npc_focus_fire::npc_focus_fireAI::Reset
void Reset() OVERRIDE
Definition
boss_shirrak_the_dead_watcher.cpp:166
src
server
scripts
Outland
Auchindoun
AuchenaiCrypts
boss_shirrak_the_dead_watcher.cpp
Generated on
for Project SkyFire Core by
1.17.0