TrinityCore
Loading...
Searching...
No Matches
boss_princess_theradras.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
29
34
35// 12201 - Princess Theradras
37{
38 boss_princess_theradras(Creature* creature) : ScriptedAI(creature) { }
39
40 void Reset() override
41 {
43 }
44
45 void JustEngagedWith(Unit* /*who*/) override
46 {
48 .SetValidator([this]
49 {
51 })
52 .Schedule(20s, 25s, [this](TaskContext task)
53 {
55 task.Repeat(20s, 25s);
56 })
57 .Schedule(20s, 30s, [this](TaskContext task)
58 {
60 DoCast(target, SPELL_BOULDER);
61 task.Repeat(15s, 25s);
62 })
63 .Schedule(10s, 20s, [this](TaskContext task)
64 {
66 task.Repeat(10s, 20s);
67 })
68 .Schedule(25s, 35s, [this](TaskContext task)
69 {
71 task.Repeat(30s, 40s);
72 });
73 }
74
75 void JustDied(Unit* /*killer*/) override
76 {
77 me->SummonCreature(NPC_ZAETARS_SPIRIT, 28.1887f, 62.3964f, -123.161f, 4.31096f, TEMPSUMMON_MANUAL_DESPAWN);
78 }
79
80 void UpdateAI(uint32 diff) override
81 {
82 if (!UpdateVictim())
83 return;
84
85 _scheduler.Update(diff, [this]
86 {
88 });
89 }
90
91private:
93};
94
uint32_t uint32
Definition Define.h:133
@ TEMPSUMMON_MANUAL_DESPAWN
@ UNIT_STATE_CASTING
Definition Unit.h:235
void AddSC_boss_ptheradras()
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
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
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
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override
boss_princess_theradras(Creature *creature)