Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_ironaya.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_Ironaya
8
SD%Complete: 100
9
SDComment:
10
SDCategory: Uldaman
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
16
enum
Ironaya
17
{
18
SAY_AGGRO
= 0,
19
SPELL_ARCINGSMASH
= 8374,
20
SPELL_KNOCKAWAY
= 10101,
21
SPELL_WSTOMP
= 11876,
22
};
23
24
class
boss_ironaya
:
public
CreatureScript
25
{
26
public
:
27
boss_ironaya
() :
CreatureScript
(
"boss_ironaya"
) { }
28
29
struct
boss_ironayaAI
:
public
ScriptedAI
30
{
31
boss_ironayaAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
32
33
uint32
uiArcingTimer
;
34
bool
bHasCastedWstomp
;
35
bool
bHasCastedKnockaway
;
36
37
void
Reset
()
OVERRIDE
38
{
39
uiArcingTimer
= 3000;
40
bHasCastedKnockaway
=
false
;
41
bHasCastedWstomp
=
false
;
42
}
43
44
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
45
{
46
Talk
(
SAY_AGGRO
);
47
}
48
49
void
UpdateAI
(
uint32
uiDiff)
OVERRIDE
50
{
51
//Return since we have no target
52
if
(!
UpdateVictim
())
53
return
;
54
55
//If we are <50% hp do knockaway ONCE
56
if
(!
bHasCastedKnockaway
&&
HealthBelowPct
(50))
57
{
58
DoCastVictim
(
SPELL_KNOCKAWAY
,
true
);
59
60
// current aggro target is knocked away pick new target
61
Unit
* target =
SelectTarget
(
SELECT_TARGET_TOPAGGRO
, 0);
62
63
if
(!target || target ==
me
->GetVictim())
64
target =
SelectTarget
(
SELECT_TARGET_TOPAGGRO
, 1);
65
66
if
(target)
67
me
->TauntApply(target);
68
69
//Shouldn't cast this agian
70
bHasCastedKnockaway
=
true
;
71
}
72
73
//uiArcingTimer
74
if
(
uiArcingTimer
<= uiDiff)
75
{
76
DoCast
(
me
,
SPELL_ARCINGSMASH
);
77
uiArcingTimer
= 13000;
78
}
else
uiArcingTimer
-= uiDiff;
79
80
if
(!
bHasCastedWstomp
&&
HealthBelowPct
(25))
81
{
82
DoCast
(
me
,
SPELL_WSTOMP
);
83
bHasCastedWstomp
=
true
;
84
}
85
86
DoMeleeAttackIfReady
();
87
}
88
};
89
90
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
91
{
92
return
new
boss_ironayaAI
(creature);
93
}
94
};
95
96
//This is the actual function called only once durring InitScripts()
97
//It must define all handled functions that are to be run in this script
98
void
AddSC_boss_ironaya
()
99
{
100
new
boss_ironaya
();
101
}
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
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
AddSC_boss_ironaya
void AddSC_boss_ironaya()
Definition
boss_ironaya.cpp:98
Ironaya
Ironaya
Definition
boss_ironaya.cpp:17
SPELL_ARCINGSMASH
@ SPELL_ARCINGSMASH
Definition
boss_ironaya.cpp:19
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_ironaya.cpp:18
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_ironaya.cpp:20
SPELL_WSTOMP
@ SPELL_WSTOMP
Definition
boss_ironaya.cpp:21
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_overlord_wyrmthalak.cpp:15
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
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_ironaya
Definition
boss_ironaya.cpp:25
boss_ironaya::boss_ironaya
boss_ironaya()
Definition
boss_ironaya.cpp:27
boss_ironaya::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_ironaya.cpp:90
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_ironaya::boss_ironayaAI
Definition
boss_ironaya.cpp:30
boss_ironaya::boss_ironayaAI::Reset
void Reset() OVERRIDE
Definition
boss_ironaya.cpp:37
boss_ironaya::boss_ironayaAI::uiArcingTimer
uint32 uiArcingTimer
Definition
boss_ironaya.cpp:33
boss_ironaya::boss_ironayaAI::bHasCastedKnockaway
bool bHasCastedKnockaway
Definition
boss_ironaya.cpp:35
boss_ironaya::boss_ironayaAI::UpdateAI
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_ironaya.cpp:49
boss_ironaya::boss_ironayaAI::bHasCastedWstomp
bool bHasCastedWstomp
Definition
boss_ironaya.cpp:34
boss_ironaya::boss_ironayaAI::boss_ironayaAI
boss_ironayaAI(Creature *creature)
Definition
boss_ironaya.cpp:31
boss_ironaya::boss_ironayaAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_ironaya.cpp:44
src
server
scripts
EasternKingdoms
Uldaman
boss_ironaya.cpp
Generated on
for Project SkyFire Core by
1.17.0