TrinityCore
Loading...
Searching...
No Matches
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/* Missing proper code for patrolling area after being spawned */
19
20#include "ScriptMgr.h"
21#include "GameObject.h"
22#include "GameObjectAI.h"
23#include "InstanceScript.h"
24#include "MotionMaster.h"
25#include "old_hillsbrad.h"
26#include "ScriptedEscortAI.h"
27
37
45
53
55{
56 { 2125.84f, 88.2535f, 54.8830f },
57 { 2111.01f, 93.8022f, 52.6356f },
58 { 2106.70f, 114.753f, 53.1965f },
59 { 2107.76f, 138.746f, 52.5109f },
60 { 2114.83f, 160.142f, 52.4738f },
61 { 2125.24f, 178.909f, 52.7283f },
62 { 2151.02f, 208.901f, 53.1551f },
63 { 2177.00f, 233.069f, 52.4409f },
64 { 2190.71f, 227.831f, 53.2742f },
65 { 2178.14f, 214.219f, 53.0779f },
66 { 2154.99f, 202.795f, 52.6446f },
67 { 2132.00f, 191.834f, 52.5709f },
68 { 2117.59f, 166.708f, 52.7686f },
69 { 2093.61f, 139.441f, 52.7616f },
70 { 2086.29f, 104.950f, 52.9246f },
71 { 2094.23f, 81.2788f, 52.6946f },
72 { 2108.70f, 85.3075f, 53.3294f },
73 { 2125.50f, 88.9481f, 54.7953f },
74 { 2128.20f, 70.9763f, 64.4221f }
75};
76
77// 17848 - Lieutenant Drake
79{
81 {
82 Initialize();
83 }
84
86 {
87 CanPatrol = true;
88 wpId = 0;
89 }
90
93
94 void Reset() override
95 {
97 Initialize();
98 }
99
109
110 void KilledUnit(Unit* /*victim*/) override
111 {
112 Talk(SAY_SLAY);
113 }
114
115 void JustDied(Unit* killer) override
116 {
117 BossAI::JustDied(killer);
119 }
120
121 void UpdateAI(uint32 diff) override
122 {
124 if (CanPatrol && wpId == 0)
125 {
127 ++wpId;
128 }
129
130 if (!UpdateVictim())
131 return;
132
133 events.Update(diff);
134
136 return;
137
138 while (uint32 eventId = events.ExecuteEvent())
139 {
140 switch (eventId)
141 {
142 case EVENT_WHIRLWIND:
144 events.Repeat(20s, 25s);
145 break;
146 case EVENT_HAMSTRING:
148 events.Repeat(15s, 20s);
149 break;
153 events.Repeat(20s, 30s);
154 break;
158 events.Repeat(25s, 35s);
159 break;
160 default:
161 break;
162 }
163
165 return;
166 }
167
169 }
170};
171
173{
174 go_barrel_old_hillsbrad(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
175
177
178 bool OnGossipHello(Player* /*player*/) override
179 {
181 return false;
182
184 return false;
185 }
186};
187
uint32_t uint32
Definition Define.h:133
@ IN_PROGRESS
@ DONE
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ EVENT_WHIRLWIND
@ EVENT_FRIGHTENING_SHOUT
@ EVENT_HAMSTRING
@ EVENT_MORTAL_STRIKE
void AddSC_boss_lieutenant_drake()
Position const DrakeWP[]
@ SPELL_HAMSTRING
@ SPELL_MORTAL_STRIKE
@ SPELL_FRIGHTENING_SHOUT
@ SPELL_WHIRLWIND
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
EventMap events
void Reset() override
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:769
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:55
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
#define RegisterOldHillsbradGameObjectAI(ai_name)
#define RegisterOldHillsbradCreatureAI(ai_name)
@ DATA_LIEUTENANT_DRAKE
@ TYPE_BARREL_DIVERSION
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