TrinityCore
Loading...
Searching...
No Matches
boss_celebras_the_cursed.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#include "ScriptMgr.h"
19#include "maraudon.h"
20#include "ScriptedCreature.h"
21
28
33
34// 12225 - Celebras the Cursed
36{
37 boss_celebras_the_cursed(Creature* creature) : ScriptedAI(creature) { }
38
39 void Reset() override
40 {
42 }
43
44 void JustEngagedWith(Unit* /*who*/) override
45 {
47 .SetValidator([this]
48 {
50 })
51 .Schedule(0s, 6s, [this](TaskContext task)
52 {
54 task.Repeat(4s, 8s);
55 })
56 .Schedule(0s, 5s, [this](TaskContext task)
57 {
59 task.Repeat(20s);
60 })
61 .Schedule(30s, [this](TaskContext task)
62 {
64 task.Repeat(20s);
65 });
66 }
67
72
73 void UpdateAI(uint32 diff) override
74 {
75 if (!UpdateVictim())
76 return;
77
78 _scheduler.Update(diff, [this]
79 {
81 });
82 }
83
84private:
86};
87
uint32_t uint32
Definition Define.h:133
@ TEMPSUMMON_MANUAL_DESPAWN
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ NPC_CELEBRAS_THE_REDEEMED
void AddSC_boss_celebras_the_cursed()
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
TaskScheduler & CancelAll()
TaskScheduler & Update(success_t const &callback=EmptyCallback)
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:769
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1992
#define RegisterMaraudonCreatureAI(ai_name)
Definition maraudon.h:31
float GetPositionZ() const
Definition Position.h:81
float GetPositionX() const
Definition Position.h:79
float GetPositionY() const
Definition Position.h:80
boss_celebras_the_cursed(Creature *creature)
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override