TrinityCore
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:142
ScriptMgr.h
ScriptedCreature.h
DamageEffectType
DamageEffectType
Definition:
UnitDefines.h:131
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:312
BossAI::_JustEngagedWith
void _JustEngagedWith(Unit *who)
Definition:
ScriptedCreature.cpp:569
BossAI::scheduler
TaskScheduler scheduler
Definition:
ScriptedCreature.h:352
BossAI::_Reset
void _Reset()
Definition:
ScriptedCreature.cpp:541
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition:
CreatureAI.cpp:245
CreatureAI::me
Creature *const me
Definition:
CreatureAI.h:61
Creature
Definition:
Creature.h:70
SpellInfo
Definition:
SpellInfo.h:321
TaskContext
Definition:
TaskScheduler.h:392
TaskContext::Repeat
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
Definition:
TaskScheduler.h:470
TaskScheduler::Schedule
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
Definition:
TaskScheduler.h:225
TaskScheduler::Update
TaskScheduler & Update(success_t const &callback=nullptr)
Definition:
TaskScheduler.cpp:27
UnitAI::DoCastSelf
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition:
UnitAI.h:159
UnitAI::DoCastVictim
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition:
UnitAI.cpp:180
Unit
Definition:
Unit.h:627
Unit::GetVictim
Unit * GetVictim() const
Definition:
Unit.h:715
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition:
ScriptedCreature.cpp:293
ScriptedAI::ResetThreat
void ResetThreat(Unit *victim, Unit *who=nullptr)
Definition:
ScriptedCreature.cpp:216
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 Thu Mar 14 2024 23:39:27 for TrinityCore by
1.9.4