Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_leutenant_drake.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Boss_Luetenant_Drake
8SD%Complete: 70
9SDComment: Missing proper code for patrolling area after being spawned. Script for GO (barrels) quest 10283
10SDCategory: Caverns of Time, Old Hillsbrad Foothills
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "old_hillsbrad.h"
16#include "ScriptedEscortAI.h"
17
18/*######
19## go_barrel_old_hillsbrad
20######*/
21
23{
24public:
25 go_barrel_old_hillsbrad() : GameObjectScript("go_barrel_old_hillsbrad") { }
26
27 bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
28 {
29 if (InstanceScript* instance = go->GetInstanceScript())
30 {
31 if (instance->GetData(TYPE_BARREL_DIVERSION) == DONE)
32 return false;
33
34 instance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS);
35 }
36
37 return false;
38 }
39};
40
41/*######
42## boss_lieutenant_drake
43######*/
44
59
60struct Location
61{
63 float x;
64 float y;
65 float z;
66};
67
69{
70 {0, 2125.84f, 88.2535f, 54.8830f},
71 {1, 2111.01f, 93.8022f, 52.6356f},
72 {2, 2106.70f, 114.753f, 53.1965f},
73 {3, 2107.76f, 138.746f, 52.5109f},
74 {4, 2114.83f, 160.142f, 52.4738f},
75 {5, 2125.24f, 178.909f, 52.7283f},
76 {6, 2151.02f, 208.901f, 53.1551f},
77 {7, 2177.00f, 233.069f, 52.4409f},
78 {8, 2190.71f, 227.831f, 53.2742f},
79 {9, 2178.14f, 214.219f, 53.0779f},
80 {10, 2154.99f, 202.795f, 52.6446f},
81 {11, 2132.00f, 191.834f, 52.5709f},
82 {12, 2117.59f, 166.708f, 52.7686f},
83 {13, 2093.61f, 139.441f, 52.7616f},
84 {14, 2086.29f, 104.950f, 52.9246f},
85 {15, 2094.23f, 81.2788f, 52.6946f},
86 {16, 2108.70f, 85.3075f, 53.3294f},
87 {17, 2125.50f, 88.9481f, 54.7953f},
88 {18, 2128.20f, 70.9763f, 64.4221f}
89};
90
92{
93public:
94 boss_lieutenant_drake() : CreatureScript("boss_lieutenant_drake") { }
95
97 {
98 return new boss_lieutenant_drakeAI(creature);
99 }
100
102 {
103 boss_lieutenant_drakeAI(Creature* creature) : ScriptedAI(creature) { }
104
107
112
114 {
115 CanPatrol = true;
116 wpId = 0;
117
118 Whirlwind_Timer = 20000;
119 Fear_Timer = 30000;
120 MortalStrike_Timer = 45000;
121 ExplodingShout_Timer = 25000;
122 }
123
124 void EnterCombat(Unit* /*who*/) OVERRIDE
125 {
127 }
128
129 void KilledUnit(Unit* /*victim*/) OVERRIDE
130 {
131 Talk(SAY_SLAY);
132 }
133
134 void JustDied(Unit* /*killer*/) OVERRIDE
135 {
137 }
138
140 {
142 if (CanPatrol && wpId == 0)
143 {
144 me->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
145 ++wpId;
146 }
147
148 //Return since we have no target
149 if (!UpdateVictim())
150 return;
151
152 //Whirlwind
153 if (Whirlwind_Timer <= diff)
154 {
156 Whirlwind_Timer = 20000+rand()%5000;
157 } else Whirlwind_Timer -= diff;
158
159 //Fear
160 if (Fear_Timer <= diff)
161 {
164 Fear_Timer = 25000+rand()%10000;
165 } else Fear_Timer -= diff;
166
167 //Mortal Strike
168 if (MortalStrike_Timer <= diff)
169 {
172 MortalStrike_Timer = 20000+rand()%10000;
173 } else MortalStrike_Timer -= diff;
174
176 }
177 };
178};
179
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ SPELL_WHIRLWIND
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_MORTAL_STRIKE
@ SPELL_FRIGHTENING_SHOUT
@ SPELL_MORTAL_STRIKE
@ SPELL_FRIGHTENING_SHOUT
@ SPELL_WHIRLWIND
static Location DrakeWP[]
void AddSC_boss_lieutenant_drake()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
GameObjectScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipHello(Player *, GameObject *go) OVERRIDE
@ TYPE_BARREL_DIVERSION
float y
Definition chapter5.cpp:210
float z
Definition chapter5.cpp:210
float x
Definition chapter5.cpp:210
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================