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
19SDName: Boss_Ironaya
20SD%Complete: 100
21SDComment:
22SDCategory: Uldaman
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "ScriptedCreature.h"
27#include "uldaman.h"
28
30{
33 SPELL_WSTOMP = 11876
34};
35
36struct boss_ironaya : public BossAI
37{
38 boss_ironaya(Creature* creature) : BossAI(creature, BOSS_IRONAYA)
39 {
40 Initialize();
41 }
42
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 {
58 {
59 _hasCastKnockaway = true;
62 }
63
65 {
66 _hasCastWstomp = true;
68 }
69 }
70
71 void JustEngagedWith(Unit* who) override
72 {
74 scheduler.Schedule(3s, [this](TaskContext task)
75 {
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
89private:
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
97{
99}
uint32_t uint32
Definition: Define.h:142
DamageEffectType
Definition: UnitDefines.h:131
void AddSC_boss_ironaya()
Ironaya
@ SPELL_ARCINGSMASH
@ SPELL_KNOCKAWAY
@ SPELL_WSTOMP
void _JustEngagedWith(Unit *who)
TaskScheduler scheduler
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
Unit * GetVictim() const
Definition: Unit.h:715
bool HealthBelowPct(uint32 pct) const
void ResetThreat(Unit *victim, Unit *who=nullptr)
void JustEngagedWith(Unit *who) override
void Initialize()
boss_ironaya(Creature *creature)
void Reset() override
void UpdateAI(uint32 diff) override
bool _hasCastKnockaway
void DamageTaken(Unit *, uint32 &, DamageEffectType, SpellInfo const *) override
@ BOSS_IRONAYA
Definition: uldaman.h:30
#define RegisterUldamanCreatureAI(ai_name)
Definition: uldaman.h:73