TrinityCore
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/* ScriptData
19SDName: Boss_Princess_Theradras
20SD%Complete: 100
21SDComment:
22SDCategory: Maraudon
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "maraudon.h"
27#include "ScriptedCreature.h"
28
30{
35};
36
38{
39public:
40 boss_princess_theradras() : CreatureScript("boss_princess_theradras") { }
41
42 CreatureAI* GetAI(Creature* creature) const override
43 {
44 return GetMaraudonAI<boss_ptheradrasAI>(creature);
45 }
46
47 struct boss_ptheradrasAI : public BossAI
48 {
50 {
51 Initialize();
52 }
53
55 {
56 DustfieldTimer = 8000;
57 BoulderTimer = 2000;
58 ThrashTimer = 5000;
59 RepulsiveGazeTimer = 23000;
60 }
61
66
67 void Reset() override
68 {
70
71 Initialize();
72 }
73
74 void JustDied(Unit* killer) override
75 {
76 BossAI::JustDied(killer);
77
78 me->SummonCreature(12238, 28.1887f, 62.3964f, -123.161f, 4.31096f, TEMPSUMMON_TIMED_DESPAWN, 10min);
79 }
80
81 void UpdateAI(uint32 diff) override
82 {
83 if (!UpdateVictim())
84 return;
85
86 //DustfieldTimer
87 if (DustfieldTimer <= diff)
88 {
90 DustfieldTimer = 14000;
91 }
92 else DustfieldTimer -= diff;
93
94 //BoulderTimer
95 if (BoulderTimer <= diff)
96 {
98 DoCast(target, SPELL_BOULDER);
99 BoulderTimer = 10000;
100 }
101 else BoulderTimer -= diff;
102
103 //RepulsiveGazeTimer
104 if (RepulsiveGazeTimer <= diff)
105 {
107 RepulsiveGazeTimer = 20000;
108 }
109 else RepulsiveGazeTimer -= diff;
110
111 //ThrashTimer
112 if (ThrashTimer <= diff)
113 {
115 ThrashTimer = 18000;
116 }
117 else ThrashTimer -= diff;
118 }
119 };
120};
121
123{
125}
uint32_t uint32
Definition: Define.h:142
@ TEMPSUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:65
Spells
Definition: PlayerAI.cpp:32
@ SPELL_REPULSIVEGAZE
void AddSC_boss_ptheradras()
void JustDied(Unit *) override
void Reset() override
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
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:2025
CreatureAI * GetAI(Creature *creature) const override
@ BOSS_PRINCESS_THERADRAS
Definition: maraudon.h:34