TrinityCore
boss_ouro.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_Ouro
20SD%Complete: 85
21SDComment: No model for submerging. Currently just invisible.
22SDCategory: Temple of Ahn'Qiraj
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "ScriptedCreature.h"
27#include "temple_of_ahnqiraj.h"
28
30{
31 SPELL_SWEEP = 26103,
34 SPELL_BIRTH = 26262, // The Birth Animation
36};
37
39{
40public:
41 boss_ouro() : CreatureScript("boss_ouro") { }
42
43 CreatureAI* GetAI(Creature* creature) const override
44 {
45 return GetAQ40AI<boss_ouroAI>(creature);
46 }
47
48 struct boss_ouroAI : public BossAI
49 {
50 boss_ouroAI(Creature* creature) : BossAI(creature, DATA_OURO)
51 {
52 Initialize();
53 }
54
56 {
57 Sweep_Timer = urand(5000, 10000);
58 SandBlast_Timer = urand(20000, 35000);
59 Submerge_Timer = urand(90000, 150000);
60 Back_Timer = urand(30000, 45000);
61 ChangeTarget_Timer = urand(5000, 8000);
62 Spawn_Timer = urand(10000, 20000);
63
64 Enrage = false;
65 Submerged = false;
66 }
67
74
75 bool Enrage;
77
78 void Reset() override
79 {
80 Initialize();
81 _Reset();
82 }
83
84 void JustEngagedWith(Unit* who) override
85 {
88 }
89
90 void UpdateAI(uint32 diff) override
91 {
92 //Return since we have no target
93 if (!UpdateVictim())
94 return;
95
96 //Sweep_Timer
97 if (!Submerged && Sweep_Timer <= diff)
98 {
100 Sweep_Timer = urand(15000, 30000);
101 } else Sweep_Timer -= diff;
102
103 //SandBlast_Timer
104 if (!Submerged && SandBlast_Timer <= diff)
105 {
107 SandBlast_Timer = urand(20000, 35000);
108 } else SandBlast_Timer -= diff;
109
110 //Submerge_Timer
111 if (!Submerged && Submerge_Timer <= diff)
112 {
113 //Cast
115 me->SetUninteractible(true);
118
119 Submerged = true;
120 Back_Timer = urand(30000, 45000);
121 } else Submerge_Timer -= diff;
122
123 //ChangeTarget_Timer
124 if (Submerged && ChangeTarget_Timer <= diff)
125 {
127 DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
128
129 ChangeTarget_Timer = urand(10000, 20000);
130 } else ChangeTarget_Timer -= diff;
131
132 //Back_Timer
133 if (Submerged && Back_Timer <= diff)
134 {
135 me->SetUninteractible(false);
137
139
140 Submerged = false;
141 Submerge_Timer = urand(60000, 120000);
142 } else Back_Timer -= diff;
143 }
144 };
145
146};
147
149{
150 new boss_ouro();
151}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
@ EMOTE_ONESHOT_SUBMERGE
@ FACTION_FRIENDLY
@ FACTION_MONSTER
@ SPELL_BIRTH
Definition: boss_ouro.cpp:34
@ SPELL_DIRTMOUND_PASSIVE
Definition: boss_ouro.cpp:35
@ SPELL_SWEEP
Definition: boss_ouro.cpp:31
@ SPELL_GROUND_RUPTURE
Definition: boss_ouro.cpp:33
@ SPELL_SANDBLAST
Definition: boss_ouro.cpp:32
void AddSC_boss_ouro()
Definition: boss_ouro.cpp:148
void JustEngagedWith(Unit *who) 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
void SetFaction(uint32 faction) override
Definition: Unit.h:859
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition: Unit.cpp:1598
CreatureAI * GetAI(Creature *creature) const override
Definition: boss_ouro.cpp:43
void DoTeleportTo(float x, float y, float z, uint32 time=0)
void Reset() override
Definition: boss_ouro.cpp:78
void UpdateAI(uint32 diff) override
Definition: boss_ouro.cpp:90
boss_ouroAI(Creature *creature)
Definition: boss_ouro.cpp:50
void JustEngagedWith(Unit *who) override
Definition: boss_ouro.cpp:84
@ DATA_OURO