TrinityCore
Loading...
Searching...
No Matches
boss_ironaya.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
/* ScriptData
19
SDName: Boss_Ironaya
20
SD%Complete: 100
21
SDComment:
22
SDCategory: Uldaman
23
EndScriptData */
24
25
#include "
ScriptMgr.h
"
26
#include "
ScriptedCreature.h
"
27
#include "
uldaman.h
"
28
29
enum
Ironaya
30
{
31
SPELL_ARCINGSMASH
= 8374,
32
SPELL_KNOCKAWAY
= 10101,
33
SPELL_WSTOMP
= 11876
34
};
35
36
struct
boss_ironaya
:
public
BossAI
37
{
38
boss_ironaya
(
Creature
* creature) :
BossAI
(creature,
BOSS_IRONAYA
)
39
{
40
Initialize
();
41
}
42
43
void
Initialize
()
44
{
45
_hasCastKnockaway
=
false
;
46
_hasCastWstomp
=
false
;
47
}
48
49
void
Reset
()
override
50
{
51
_Reset
();
52
Initialize
();
53
}
54
55
void
DamageTaken
(
Unit
*
/*attacker*/
,
uint32
&
/*damage*/
,
DamageEffectType
/*damageType*/
,
SpellInfo
const
*
/*spellInfo = nullptr*/
)
override
56
{
57
if
(!
_hasCastKnockaway
&&
HealthBelowPct
(50) &&
me
->
GetVictim
())
58
{
59
_hasCastKnockaway
=
true
;
60
DoCastVictim
(
SPELL_KNOCKAWAY
,
true
);
61
ResetThreat
(
me
->
GetVictim
(),
me
);
62
}
63
64
if
(!
_hasCastWstomp
&&
HealthBelowPct
(25))
65
{
66
_hasCastWstomp
=
true
;
67
DoCastSelf
(
SPELL_WSTOMP
);
68
}
69
}
70
71
void
JustEngagedWith
(
Unit
* who)
override
72
{
73
_JustEngagedWith
(who);
74
scheduler
.
Schedule
(3s, [
this
](
TaskContext
& task)
75
{
76
DoCastSelf
(
SPELL_ARCINGSMASH
);
77
task.
Repeat
(13s);
78
});
79
}
80
81
void
UpdateAI
(
uint32
diff)
override
82
{
83
if
(!
UpdateVictim
())
84
return
;
85
86
scheduler
.
Update
(diff);
87
}
88
89
private
:
90
bool
_hasCastKnockaway
;
91
bool
_hasCastWstomp
;
92
};
93
94
//This is the actual function called only once durring InitScripts()
95
//It must define all handled functions that are to be run in this script
96
void
AddSC_boss_ironaya
()
97
{
98
RegisterUldamanCreatureAI
(
boss_ironaya
);
99
}
uint32
uint32_t uint32
Definition
Define.h:154
ScriptMgr.h
ScriptedCreature.h
DamageEffectType
DamageEffectType
Definition
UnitDefines.h:154
AddSC_boss_ironaya
void AddSC_boss_ironaya()
Definition
boss_ironaya.cpp:96
Ironaya
Ironaya
Definition
boss_ironaya.cpp:30
SPELL_ARCINGSMASH
@ SPELL_ARCINGSMASH
Definition
boss_ironaya.cpp:31
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_ironaya.cpp:32
SPELL_WSTOMP
@ SPELL_WSTOMP
Definition
boss_ironaya.cpp:33
BossAI
Definition
ScriptedCreature.h:308
BossAI::_JustEngagedWith
void _JustEngagedWith(Unit *who)
Definition
ScriptedCreature.cpp:569
BossAI::scheduler
TaskScheduler scheduler
Definition
ScriptedCreature.h:348
BossAI::_Reset
void _Reset()
Definition
ScriptedCreature.cpp:542
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:244
CreatureAI::me
Creature *const me
Definition
CreatureAI.h:63
Creature
Definition
Creature.h:82
SpellInfo
Definition
SpellInfo.h:324
TaskContext
Definition
TaskScheduler.h:370
TaskContext::Repeat
TaskContext & Repeat(TaskScheduler::duration_t duration)
Definition
TaskScheduler.cpp:319
TaskScheduler::Schedule
TaskScheduler & Schedule(duration_t time, task_handler_t task)
Definition
TaskScheduler.h:265
TaskScheduler::Update
TaskScheduler & Update()
Update the scheduler to the current time.
Definition
TaskScheduler.cpp:38
UnitAI::DoCastSelf
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.h:160
UnitAI::DoCastVictim
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.cpp:180
Unit
Definition
Unit.h:635
Unit::GetVictim
Unit * GetVictim() const
Definition
Unit.h:726
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.cpp:291
ScriptedAI::ResetThreat
void ResetThreat(Unit *victim, Unit *who=nullptr)
Definition
ScriptedCreature.cpp:214
boss_ironaya
Definition
boss_ironaya.cpp:37
boss_ironaya::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
boss_ironaya.cpp:71
boss_ironaya::Initialize
void Initialize()
Definition
boss_ironaya.cpp:43
boss_ironaya::boss_ironaya
boss_ironaya(Creature *creature)
Definition
boss_ironaya.cpp:38
boss_ironaya::Reset
void Reset() override
Definition
boss_ironaya.cpp:49
boss_ironaya::UpdateAI
void UpdateAI(uint32 diff) override
Definition
boss_ironaya.cpp:81
boss_ironaya::_hasCastKnockaway
bool _hasCastKnockaway
Definition
boss_ironaya.cpp:90
boss_ironaya::DamageTaken
void DamageTaken(Unit *, uint32 &, DamageEffectType, SpellInfo const *) override
Definition
boss_ironaya.cpp:55
boss_ironaya::_hasCastWstomp
bool _hasCastWstomp
Definition
boss_ironaya.cpp:91
uldaman.h
BOSS_IRONAYA
@ BOSS_IRONAYA
Definition
uldaman.h:30
RegisterUldamanCreatureAI
#define RegisterUldamanCreatureAI(ai_name)
Definition
uldaman.h:73
server
scripts
EasternKingdoms
Uldaman
boss_ironaya.cpp
Generated on Sun May 10 2026 02:09:08 for TrinityCore by
1.9.8