Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
the_eye.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: The_Eye
8
SD%Complete: 100
9
SDComment:
10
SDCategory: Tempest Keep, The Eye
11
EndScriptData */
12
13
/* ContentData
14
npc_crystalcore_devastator
15
EndContentData */
16
17
#include "
ScriptMgr.h
"
18
#include "
ScriptedCreature.h
"
19
#include "
the_eye.h
"
20
21
enum
Spells
22
{
23
SPELL_COUNTERCHARGE
= 35035,
24
SPELL_KNOCKAWAY
= 22893,
25
};
26
27
class
npc_crystalcore_devastator
:
public
CreatureScript
28
{
29
public
:
30
npc_crystalcore_devastator
() :
CreatureScript
(
"npc_crystalcore_devastator"
) { }
31
32
struct
npc_crystalcore_devastatorAI
:
public
ScriptedAI
33
{
34
npc_crystalcore_devastatorAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
35
36
uint32
Knockaway_Timer
;
37
uint32
Countercharge_Timer
;
38
39
void
Reset
()
OVERRIDE
40
{
41
Countercharge_Timer
= 9000;
42
Knockaway_Timer
= 25000;
43
}
44
45
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
46
47
void
UpdateAI
(
uint32
diff)
OVERRIDE
48
{
49
if
(!
UpdateVictim
())
50
return
;
51
52
//Check if we have a current target
53
//Knockaway_Timer
54
if
(
Knockaway_Timer
<= diff)
55
{
56
DoCastVictim
(
SPELL_KNOCKAWAY
,
true
);
57
58
// current aggro target is knocked away pick new target
59
Unit
* target =
SelectTarget
(
SELECT_TARGET_TOPAGGRO
, 0);
60
61
if
(!target || target ==
me
->GetVictim())
62
target =
SelectTarget
(
SELECT_TARGET_TOPAGGRO
, 1);
63
64
if
(target)
65
me
->TauntApply(target);
66
67
Knockaway_Timer
= 23000;
68
}
69
else
70
Knockaway_Timer
-= diff;
71
72
//Countercharge_Timer
73
if
(
Countercharge_Timer
<= diff)
74
{
75
DoCast
(
me
,
SPELL_COUNTERCHARGE
);
76
Countercharge_Timer
= 45000;
77
}
78
else
79
Countercharge_Timer
-= diff;
80
81
DoMeleeAttackIfReady
();
82
}
83
};
84
85
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
86
{
87
return
new
npc_crystalcore_devastatorAI
(creature);
88
}
89
};
90
void
AddSC_the_eye
()
91
{
92
new
npc_crystalcore_devastator
();
93
}
94
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
SELECT_TARGET_TOPAGGRO
@ SELECT_TARGET_TOPAGGRO
Definition
UnitAI.h:24
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_overlord_wyrmthalak.cpp:15
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
npc_crystalcore_devastator
Definition
the_eye.cpp:28
npc_crystalcore_devastator::npc_crystalcore_devastator
npc_crystalcore_devastator()
Definition
the_eye.cpp:30
npc_crystalcore_devastator::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
the_eye.cpp:85
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
npc_crystalcore_devastator::npc_crystalcore_devastatorAI
Definition
the_eye.cpp:33
npc_crystalcore_devastator::npc_crystalcore_devastatorAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
the_eye.cpp:45
npc_crystalcore_devastator::npc_crystalcore_devastatorAI::npc_crystalcore_devastatorAI
npc_crystalcore_devastatorAI(Creature *creature)
Definition
the_eye.cpp:34
npc_crystalcore_devastator::npc_crystalcore_devastatorAI::Countercharge_Timer
uint32 Countercharge_Timer
Definition
the_eye.cpp:37
npc_crystalcore_devastator::npc_crystalcore_devastatorAI::Knockaway_Timer
uint32 Knockaway_Timer
Definition
the_eye.cpp:36
npc_crystalcore_devastator::npc_crystalcore_devastatorAI::Reset
void Reset() OVERRIDE
Definition
the_eye.cpp:39
npc_crystalcore_devastator::npc_crystalcore_devastatorAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
the_eye.cpp:47
SPELL_COUNTERCHARGE
@ SPELL_COUNTERCHARGE
Definition
the_eye.cpp:23
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
the_eye.cpp:24
AddSC_the_eye
void AddSC_the_eye()
Definition
the_eye.cpp:90
the_eye.h
src
server
scripts
Outland
TempestKeep
Eye
the_eye.cpp
Generated on
for Project SkyFire Core by
1.17.0