Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_kurinnaxx.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
#include "
ObjectMgr.h
"
7
#include "
ScriptMgr.h
"
8
#include "
ScriptedCreature.h
"
9
#include "
ruins_of_ahnqiraj.h
"
10
#include "
CreatureTextMgr.h
"
11
12
enum
Spells
13
{
14
SPELL_MORTALWOUND
= 25646,
15
SPELL_SANDTRAP
= 25648,
16
SPELL_ENRAGE
= 26527,
17
SPELL_SUMMON_PLAYER
= 26446,
18
SPELL_TRASH
= 3391,
// Should perhaps be triggered by an aura? Couldn't find any though
19
SPELL_WIDE_SLASH
= 25814
20
};
21
22
enum
Events
23
{
24
EVENT_MORTAL_WOUND
= 1,
25
EVENT_SANDTRAP
= 2,
26
EVENT_TRASH
= 3,
27
EVENT_WIDE_SLASH
= 4
28
};
29
30
enum
Texts
31
{
32
SAY_KURINAXX_DEATH
= 5,
// Yelled by Ossirian the Unscarred
33
};
34
35
class
boss_kurinnaxx
:
public
CreatureScript
36
{
37
public
:
38
boss_kurinnaxx
() :
CreatureScript
(
"boss_kurinnaxx"
) { }
39
40
struct
boss_kurinnaxxAI
:
public
BossAI
41
{
42
boss_kurinnaxxAI
(
Creature
* creature) :
BossAI
(creature,
DATA_KURINNAXX
)
43
{
44
}
45
46
void
Reset
()
OVERRIDE
47
{
48
_Reset
();
49
_enraged
=
false
;
50
events
.ScheduleEvent(
EVENT_MORTAL_WOUND
, 8000);
51
events
.ScheduleEvent(
EVENT_SANDTRAP
, std::rand() % 15000 + 5000);
52
events
.ScheduleEvent(
EVENT_TRASH
, 1000);
53
events
.ScheduleEvent(
EVENT_WIDE_SLASH
, 11000);
54
}
55
56
void
DamageTaken
(
Unit
*
/*attacker*/
,
uint32
&
/*damage*/
)
OVERRIDE
57
{
58
if
(!
_enraged
&&
HealthBelowPct
(30))
59
{
60
DoCast
(
me
,
SPELL_ENRAGE
);
61
_enraged
=
true
;
62
}
63
}
64
65
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
66
{
67
_JustDied
();
68
if
(
Creature
* Ossirian =
me
->GetMap()->GetCreature(
instance
->GetData64(
DATA_OSSIRIAN
)))
69
sCreatureTextMgr
->SendChat(Ossirian,
SAY_KURINAXX_DEATH
, 0,
ChatMsg::CHAT_MSG_ADDON
,
Language::LANG_ADDON
,
TEXT_RANGE_ZONE
);
70
}
71
72
void
UpdateAI
(
uint32
diff)
OVERRIDE
73
{
74
if
(!
UpdateVictim
())
75
return
;
76
77
events
.Update(diff);
78
79
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
80
return
;
81
82
while
(
uint32
eventId =
events
.ExecuteEvent())
83
{
84
switch
(eventId)
85
{
86
case
EVENT_MORTAL_WOUND
:
87
DoCastVictim
(
SPELL_MORTALWOUND
);
88
events
.ScheduleEvent(
EVENT_MORTAL_WOUND
, 8000);
89
break
;
90
case
EVENT_SANDTRAP
:
91
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
92
target->CastSpell(target,
SPELL_SANDTRAP
,
true
);
93
else
if
(
Unit
* victim =
me
->GetVictim())
94
victim->CastSpell(victim,
SPELL_SANDTRAP
,
true
);
95
events
.ScheduleEvent(
EVENT_SANDTRAP
, std::rand() % 15000 + 5000);
96
break
;
97
case
EVENT_WIDE_SLASH
:
98
DoCast
(
me
,
SPELL_WIDE_SLASH
);
99
events
.ScheduleEvent(
EVENT_WIDE_SLASH
, 11000);
100
break
;
101
case
EVENT_TRASH
:
102
DoCast
(
me
,
SPELL_TRASH
);
103
events
.ScheduleEvent(
EVENT_WIDE_SLASH
, 16000);
104
break
;
105
default
:
106
break
;
107
}
108
}
109
110
DoMeleeAttackIfReady
();
111
}
112
private
:
113
bool
_enraged
;
114
};
115
116
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
117
{
118
return
new
boss_kurinnaxxAI
(creature);
119
}
120
};
121
122
void
AddSC_boss_kurinnaxx
()
123
{
124
new
boss_kurinnaxx
();
125
}
Spells
Spells
Definition
BattlegroundIC.h:645
CreatureTextMgr.h
sCreatureTextMgr
#define sCreatureTextMgr
Definition
CreatureTextMgr.h:104
TEXT_RANGE_ZONE
@ TEXT_RANGE_ZONE
Definition
CreatureTextMgr.h:34
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ObjectMgr.h
ScriptMgr.h
ScriptedCreature.h
ChatMsg::CHAT_MSG_ADDON
@ CHAT_MSG_ADDON
Definition
SharedDefines.h:3663
Language::LANG_ADDON
@ LANG_ADDON
Definition
SharedDefines.h:838
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
alterac_valley.cpp:14
Events
Events
Definition
alterac_valley.cpp:40
Texts
Texts
Definition
boss_alizabal.cpp:13
SPELL_TRASH
@ SPELL_TRASH
Definition
boss_ayamiss.cpp:16
EVENT_TRASH
@ EVENT_TRASH
Definition
boss_ayamiss.cpp:30
AddSC_boss_kurinnaxx
void AddSC_boss_kurinnaxx()
Definition
boss_kurinnaxx.cpp:122
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
boss_kurinnaxx.cpp:16
SPELL_SUMMON_PLAYER
@ SPELL_SUMMON_PLAYER
Definition
boss_kurinnaxx.cpp:17
SPELL_WIDE_SLASH
@ SPELL_WIDE_SLASH
Definition
boss_kurinnaxx.cpp:19
SPELL_MORTALWOUND
@ SPELL_MORTALWOUND
Definition
boss_kurinnaxx.cpp:14
SPELL_SANDTRAP
@ SPELL_SANDTRAP
Definition
boss_kurinnaxx.cpp:15
SPELL_TRASH
@ SPELL_TRASH
Definition
boss_kurinnaxx.cpp:18
SAY_KURINAXX_DEATH
@ SAY_KURINAXX_DEATH
Definition
boss_kurinnaxx.cpp:32
EVENT_TRASH
@ EVENT_TRASH
Definition
boss_kurinnaxx.cpp:26
EVENT_MORTAL_WOUND
@ EVENT_MORTAL_WOUND
Definition
boss_kurinnaxx.cpp:24
EVENT_SANDTRAP
@ EVENT_SANDTRAP
Definition
boss_kurinnaxx.cpp:25
EVENT_WIDE_SLASH
@ EVENT_WIDE_SLASH
Definition
boss_kurinnaxx.cpp:27
EVENT_MORTAL_WOUND
@ EVENT_MORTAL_WOUND
Definition
boss_temporus.cpp:35
BossAI::instance
InstanceScript *const instance
Definition
ScriptedCreature.h:383
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
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
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_kurinnaxx
Definition
boss_kurinnaxx.cpp:36
boss_kurinnaxx::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_kurinnaxx.cpp:116
boss_kurinnaxx::boss_kurinnaxx
boss_kurinnaxx()
Definition
boss_kurinnaxx.cpp:38
ruins_of_ahnqiraj.h
DATA_OSSIRIAN
@ DATA_OSSIRIAN
Definition
ruins_of_ahnqiraj.h:16
DATA_KURINNAXX
@ DATA_KURINNAXX
Definition
ruins_of_ahnqiraj.h:11
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
boss_kurinnaxx::boss_kurinnaxxAI
Definition
boss_kurinnaxx.cpp:41
boss_kurinnaxx::boss_kurinnaxxAI::_enraged
bool _enraged
Definition
boss_kurinnaxx.cpp:113
boss_kurinnaxx::boss_kurinnaxxAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_kurinnaxx.cpp:65
boss_kurinnaxx::boss_kurinnaxxAI::Reset
void Reset() OVERRIDE
Definition
boss_kurinnaxx.cpp:46
boss_kurinnaxx::boss_kurinnaxxAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_kurinnaxx.cpp:72
boss_kurinnaxx::boss_kurinnaxxAI::DamageTaken
void DamageTaken(Unit *, uint32 &) OVERRIDE
Definition
boss_kurinnaxx.cpp:56
boss_kurinnaxx::boss_kurinnaxxAI::boss_kurinnaxxAI
boss_kurinnaxxAI(Creature *creature)
Definition
boss_kurinnaxx.cpp:42
src
server
scripts
Kalimdor
RuinsOfAhnQiraj
boss_kurinnaxx.cpp
Generated on
for Project SkyFire Core by
1.17.0