TrinityCore
hyjalAI.h
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#ifndef SC_HYJALAI_H
19#define SC_HYJALAI_H
20
21#include "hyjal.h"
22#include "ScriptedEscortAI.h"
23
24#define HYJAL_AI_MAX_SPELLS 3
25
27{
30
31 //Spells for Jaina
32 SPELL_BRILLIANCE_AURA = 31260, // The database must handle this spell via creature_addon(it should, but is removed in evade..)
36
37 //Thrall spells
40
41 //Tyrande spells
43 SPELL_STARFALL = 20687
44};
45
46struct Wave
47{
48 uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves
49 uint32 WaveTimer; // The timer before the next wave is summoned
50 bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that
51};
52
53const Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base
54{ // Rage Winterchill Wave 1-8
55 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0}, 120000, false},
56 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0}, 120000, false},
57 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0}, 120000, false},
58 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0}, 120000, false},
60 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0}, 120000, false},
63 // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron
64 {{RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true},
65 // Anetheron Wave 1-8
66 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0}, 120000, false},
67 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0}, 120000, false},
70 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0}, 120000, false},
71 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0}, 120000, false},
74 // All 8 Waves are summoned, summon Anatheron
75 {{ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true}
76};
77
78const Wave HordeWaves[]= // Waves that are summoned in the Horde base
79{ // Kaz'Rogal Wave 1-8
85 {{GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 180000, false},
86 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0}, 180000, false},
88 // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor
89 {{KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true},
90 // Azgalor Wave 1-8
99 // All 8 Waves are summoned, summon Azgalor
100 {{AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true}
101};
102
103enum TargetType // Used in the spell cast system for the AI
104{
108};
109
111{
112 ATTACKED = 0, // Used when attacked and set in combat
113 BEGIN = 1, // Used when the event is begun
114 INCOMING = 2, // Used to warn the raid that another wave phase is coming
115 RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned
116 FAILURE = 4, // Used when raid has failed (unsure where to place)
117 SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase
118 DEATH = 6, // Used on death
119};
120
121struct hyjalAI : public EscortAI
122{
123 hyjalAI(Creature* creature);
124
125 void Initialize();
126
127 void Reset() override; // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat
128
129 void EnterEvadeMode(EvadeReason why) override; // Send creature back to spawn location and evade.
130
131 void JustEngagedWith(Unit* who) override; // Used to reset cooldowns for our spells and to inform the raid that we're under attack
132
133 void UpdateAI(uint32 diff) override; // Called to summon waves, check for boss deaths and to cast our spells.
134
135 void JustDied(Unit* killer) override; // Called on death, informs the raid that they have failed.
136
137 void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal
138 {
139 Faction = _faction;
140 }
141
142 void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base.
143
144 void SpawnVeins();
145 void DeSpawnVeins();
146 void JustSummoned(Creature* summoned) override;
147 void SummonedCreatureDespawn(Creature* summoned) override;
148 void HideNearPos(float x, float y);
149 void RespawnNearPos(float x, float y);
150 void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override;
151 void DoOverrun(uint32 faction, const uint32 diff);
152 void MoveInLineOfSight(Unit* who) override;
153
154 void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
155
156 // Summons the next wave, calls SummonCreature
157 void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]);
158
159 void StartEvent(Player* player); // Begins the event by gossip click
160
161 uint32 GetInstanceData(uint32 Event); // Gets instance data for this instance, used to check if raid has gotten past a certain point and can access the next phase
162
163 public:
165
169
176
180 bool Summon;
182 bool Debug;
195 bool DoHide;
200
201 struct Spell
202 {
207
208 private:
210};
211#endif
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
EvadeReason
Definition: UnitAICommon.h:30
Definition: Unit.h:627
TargetType
Definition: hyjalAI.h:104
@ TARGETTYPE_RANDOM
Definition: hyjalAI.h:106
@ TARGETTYPE_SELF
Definition: hyjalAI.h:105
@ TARGETTYPE_VICTIM
Definition: hyjalAI.h:107
const Wave HordeWaves[]
Definition: hyjalAI.h:78
SpellIds
Definition: hyjalAI.h:27
@ SPELL_TELEPORT_VISUAL
Definition: hyjalAI.h:28
@ SPELL_BLIZZARD
Definition: hyjalAI.h:33
@ SPELL_BRILLIANCE_AURA
Definition: hyjalAI.h:32
@ SPELL_SUMMON_ELEMENTALS
Definition: hyjalAI.h:35
@ SPELL_CHAIN_LIGHTNING
Definition: hyjalAI.h:38
@ SPELL_PYROBLAST
Definition: hyjalAI.h:34
@ SPELL_STARFALL
Definition: hyjalAI.h:43
@ SPELL_TRUESHOT_AURA
Definition: hyjalAI.h:42
@ SPELL_SUMMON_DIRE_WOLF
Definition: hyjalAI.h:39
@ SPELL_MASS_TELEPORT
Definition: hyjalAI.h:29
const Wave AllianceWaves[]
Definition: hyjalAI.h:53
YellId
Definition: hyjalAI.h:111
@ ATTACKED
Definition: hyjalAI.h:112
@ BEGIN
Definition: hyjalAI.h:113
@ INCOMING
Definition: hyjalAI.h:114
@ RALLY
Definition: hyjalAI.h:115
@ FAILURE
Definition: hyjalAI.h:116
@ DEATH
Definition: hyjalAI.h:118
@ SUCCESS
Definition: hyjalAI.h:117
#define HYJAL_AI_MAX_SPELLS
Definition: hyjalAI.h:24
@ KAZROGAL
Definition: hyjal.h:76
@ AZGALOR
Definition: hyjal.h:77
@ FEL_STALKER
Definition: hyjal.h:67
@ BANSHEE
Definition: hyjal.h:62
@ ANETHERON
Definition: hyjal.h:75
@ GARGOYLE
Definition: hyjal.h:64
@ GIANT_INFERNAL
Definition: hyjal.h:66
@ FROST_WYRM
Definition: hyjal.h:65
@ ABOMINATION
Definition: hyjal.h:60
@ CRYPT_FIEND
Definition: hyjal.h:63
@ GHOUL
Definition: hyjal.h:61
@ RAGE_WINTERCHILL
Definition: hyjal.h:74
@ NECROMANCER
Definition: hyjal.h:59
Definition: hyjalAI.h:47
uint32 WaveTimer
Definition: hyjalAI.h:49
uint32 Mob[18]
Definition: hyjalAI.h:48
bool IsBoss
Definition: hyjalAI.h:50
uint32 TargetType
Definition: hyjalAI.h:205
uint32 Cooldown
Definition: hyjalAI.h:204
uint32 SpellId
Definition: hyjalAI.h:203
bool Debug
Definition: hyjalAI.h:182
void RespawnNearPos(float x, float y)
Definition: hyjalAI.cpp:923
void SetFaction(uint32 _faction)
Definition: hyjalAI.h:137
bool WaitForTeleport
Definition: hyjalAI.h:188
void SpawnVeins()
Definition: hyjalAI.cpp:651
uint32 RespawnTimer
Definition: hyjalAI.h:193
void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3])
Definition: hyjalAI.cpp:542
bool FirstBossDead
Definition: hyjalAI.h:178
void EnterEvadeMode(EvadeReason why) override
Definition: hyjalAI.cpp:424
uint32 OverrunCounter2
Definition: hyjalAI.h:191
bool Summon
Definition: hyjalAI.h:180
bool DoMassTeleport
Definition: hyjalAI.h:198
uint32 CheckTimer
Definition: hyjalAI.h:172
bool VeinsSpawned[2]
Definition: hyjalAI.h:183
bool DoRespawn
Definition: hyjalAI.h:194
bool SecondBossDead
Definition: hyjalAI.h:179
ObjectGuid BossGUID[2]
Definition: hyjalAI.h:167
uint32 RetreatTimer
Definition: hyjalAI.h:175
bool bRetreat
Definition: hyjalAI.h:181
void StartEvent(Player *player)
Definition: hyjalAI.cpp:592
uint8 InfernalCount
Definition: hyjalAI.h:184
void WaypointReached(uint32 waypointId, uint32) override
Definition: hyjalAI.cpp:930
ObjectGuid VeinGUID[14]
Definition: hyjalAI.h:168
uint32 EnemyCount
Definition: hyjalAI.h:174
uint32 InfernalPoint
Definition: hyjalAI.h:192
void DeSpawnVeins()
Definition: hyjalAI.cpp:679
void SummonedCreatureDespawn(Creature *summoned) override
Definition: hyjalAI.cpp:380
void UpdateAI(uint32 diff) override
Definition: hyjalAI.cpp:709
void Initialize()
Definition: hyjalAI.cpp:340
uint32 MassTeleportTimer
Definition: hyjalAI.h:197
void HideNearPos(float x, float y)
Definition: hyjalAI.cpp:905
SummonList Summons
Definition: hyjalAI.h:185
uint32 NextWaveTimer
Definition: hyjalAI.h:170
bool EventBegun
Definition: hyjalAI.h:177
void Retreat()
Definition: hyjalAI.cpp:620
ObjectGuid PlayerGUID
Definition: hyjalAI.h:166
void JustEngagedWith(Unit *who) override
Definition: hyjalAI.cpp:439
uint32 GetInstanceData(uint32 Event)
Definition: hyjalAI.cpp:615
uint32 OverrunCounter
Definition: hyjalAI.h:190
hyjalAI(Creature *creature)
Definition: hyjalAI.cpp:320
uint32 TeleportTimer
Definition: hyjalAI.h:189
uint32 WaveCount
Definition: hyjalAI.h:171
InstanceScript * instance
Definition: hyjalAI.h:164
void DoOverrun(uint32 faction, const uint32 diff)
Definition: hyjalAI.cpp:977
void Reset() override
Definition: hyjalAI.cpp:385
bool Overrun
Definition: hyjalAI.h:186
uint32 SpellTimer[3]
Definition: hyjalAI.h:209
void SummonCreature(uint32 entry, float Base[4][3])
Definition: hyjalAI.cpp:457
bool Teleported
Definition: hyjalAI.h:187
uint32 Faction
Definition: hyjalAI.h:173
void MoveInLineOfSight(Unit *who) override
Definition: hyjalAI.cpp:449
void JustDied(Unit *killer) override
Definition: hyjalAI.cpp:893
bool DoHide
Definition: hyjalAI.h:195
ObjectGuid DummyGuid
Definition: hyjalAI.h:199
bool IsDummy
Definition: hyjalAI.h:196
void JustSummoned(Creature *summoned) override
Definition: hyjalAI.cpp:375