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{
39
40 void JustEngagedWith(Unit* who) override
41 {
43
45 .Schedule(20s, 25s, [this](TaskContext& task)
46 {
48 task.Repeat(20s, 25s);
49 })
50 .Schedule(20s, 30s, [this](TaskContext& task)
51 {
53 DoCast(target, SPELL_BOULDER);
54 task.Repeat(15s, 25s);
55 })
56 .Schedule(10s, 20s, [this](TaskContext& task)
57 {
59 task.Repeat(10s, 20s);
60 })
61 .Schedule(25s, 35s, [this](TaskContext& task)
62 {
64 task.Repeat(30s, 40s);
65 });
66 }
67
68 void JustDied(Unit* killer) override
69 {
70 BossAI::JustDied(killer);
71
72 me->SummonCreature(NPC_ZAETARS_SPIRIT, 28.1887f, 62.3964f, -123.161f, 4.31096f, TEMPSUMMON_MANUAL_DESPAWN);
73 }
74
75 void UpdateAI(uint32 diff) override
76 {
77 if (!UpdateVictim())
78 return;
79
80 scheduler.Update(diff);
81 }
82};
83
uint32_t uint32
Definition Define.h:154
@ TEMPSUMMON_MANUAL_DESPAWN
void AddSC_boss_ptheradras()
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
TaskScheduler scheduler
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
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:1403
@ BOSS_PRINCESS_THERADRAS
Definition maraudon.h:34
#define RegisterMaraudonCreatureAI(ai_name)
Definition maraudon.h:53
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
void JustDied(Unit *killer) override
boss_princess_theradras(Creature *creature)