TrinityCore
boss_leutenant_drake.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_Luetenant_Drake
20SD%Complete: 70
21SDComment: Missing proper code for patrolling area after being spawned. Script for GO (barrels) quest 10283
22SDCategory: Caverns of Time, Old Hillsbrad Foothills
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "GameObject.h"
27#include "GameObjectAI.h"
28#include "InstanceScript.h"
29#include "MotionMaster.h"
30#include "old_hillsbrad.h"
31#include "ScriptedCreature.h"
32
33/*######
34## boss_lieutenant_drake
35######*/
36
38{
45
50};
51
53{
54 { 2125.84f, 88.2535f, 54.8830f },
55 { 2111.01f, 93.8022f, 52.6356f },
56 { 2106.70f, 114.753f, 53.1965f },
57 { 2107.76f, 138.746f, 52.5109f },
58 { 2114.83f, 160.142f, 52.4738f },
59 { 2125.24f, 178.909f, 52.7283f },
60 { 2151.02f, 208.901f, 53.1551f },
61 { 2177.00f, 233.069f, 52.4409f },
62 { 2190.71f, 227.831f, 53.2742f },
63 { 2178.14f, 214.219f, 53.0779f },
64 { 2154.99f, 202.795f, 52.6446f },
65 { 2132.00f, 191.834f, 52.5709f },
66 { 2117.59f, 166.708f, 52.7686f },
67 { 2093.61f, 139.441f, 52.7616f },
68 { 2086.29f, 104.950f, 52.9246f },
69 { 2094.23f, 81.2788f, 52.6946f },
70 { 2108.70f, 85.3075f, 53.3294f },
71 { 2125.50f, 88.9481f, 54.7953f },
72 { 2128.20f, 70.9763f, 64.4221f }
73};
74
76{
78 {
79 Initialize();
80 }
81
83 {
84 CanPatrol = true;
85 wpId = 0;
86
87 Whirlwind_Timer = 20000;
88 Fear_Timer = 30000;
89 MortalStrike_Timer = 45000;
91 }
92
95
100
101 void Reset() override
102 {
104 Initialize();
105 }
106
107 void JustEngagedWith(Unit* who) override
108 {
111 }
112
113 void KilledUnit(Unit* /*victim*/) override
114 {
115 Talk(SAY_SLAY);
116 }
117
118 void JustDied(Unit* killer) override
119 {
120 BossAI::JustDied(killer);
122 }
123
124 void UpdateAI(uint32 diff) override
125 {
127 if (CanPatrol && wpId == 0)
128 {
130 ++wpId;
131 }
132
133 //Return since we have no target
134 if (!UpdateVictim())
135 return;
136
137 //Whirlwind
138 if (Whirlwind_Timer <= diff)
139 {
141 Whirlwind_Timer = 20000 + rand32() % 5000;
142 } else Whirlwind_Timer -= diff;
143
144 //Fear
145 if (Fear_Timer <= diff)
146 {
149 Fear_Timer = 25000 + rand32() % 10000;
150 } else Fear_Timer -= diff;
151
152 //Mortal Strike
153 if (MortalStrike_Timer <= diff)
154 {
157 MortalStrike_Timer = 20000 + rand32() % 10000;
158 } else MortalStrike_Timer -= diff;
159 }
160};
161
162/*######
163## go_barrel_old_hillsbrad
164######*/
165
167{
168 go_barrel_old_hillsbrad(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
169
171
172 bool OnGossipHello(Player* /*player*/) override
173 {
175 return false;
176
178 return false;
179 }
180};
181
183{
186}
uint32_t uint32
Definition: Define.h:142
@ IN_PROGRESS
@ DONE
uint32 rand32()
Definition: Random.cpp:70
@ SPELL_HAMSTRING
@ SPELL_MORTAL_STRIKE
@ SPELL_FRIGHTENING_SHOUT
@ SPELL_WHIRLWIND
void AddSC_boss_lieutenant_drake()
Position const DrakeWP[]
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
void Reset() override
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
#define RegisterOldHillsbradGameObjectAI(ai_name)
Definition: old_hillsbrad.h:64
#define RegisterOldHillsbradCreatureAI(ai_name)
Definition: old_hillsbrad.h:63
@ DATA_LIEUTENANT_DRAKE
Definition: old_hillsbrad.h:30
@ TYPE_BARREL_DIVERSION
Definition: old_hillsbrad.h:34
void JustEngagedWith(Unit *who) override
boss_lieutenant_drake(Creature *creature)
void JustDied(Unit *killer) override
void UpdateAI(uint32 diff) override
void KilledUnit(Unit *) override
bool OnGossipHello(Player *) override
go_barrel_old_hillsbrad(GameObject *go)