TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
hyjalAI.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef SC_HYJALAI_H
20 #define SC_HYJALAI_H
21 
22 #include "hyjal.h"
23 #include "ScriptedEscortAI.h"
24 
25 #define HYJAL_AI_MAX_SPELLS 3
26 
28 {
31 
32  //Spells for Jaina
33  SPELL_BRILLIANCE_AURA = 31260, // The database must handle this spell via creature_addon(it should, but is removed in evade..)
34  SPELL_BLIZZARD = 31266,
35  SPELL_PYROBLAST = 31263,
37 
38  //Thrall spells
41 };
42 
43 struct Wave
44 {
45  uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves
46  uint32 WaveTimer; // The timer before the next wave is summoned
47  bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that
48 };
49 
50 const Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base
51 { // Rage Winterchill Wave 1-8
52  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0}, 120000, false},
53  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0}, 120000, false},
54  {{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},
55  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0}, 120000, false},
57  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0}, 120000, false},
60  // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron
61  {{RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true},
62  // Anetheron Wave 1-8
63  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0}, 120000, false},
64  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0}, 120000, false},
67  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0}, 120000, false},
68  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0}, 120000, false},
71  // All 8 Waves are summoned, summon Anatheron
72  {{ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true}
73 };
74 
75 const Wave HordeWaves[]= // Waves that are summoned in the Horde base
76 { // Kaz'Rogal Wave 1-8
82  {{GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 180000, false},
83  {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0}, 180000, false},
85  // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor
86  {{KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true},
87  // Azgalor Wave 1-8
96  // All 8 Waves are summoned, summon Azgalor
97  {{AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true}
98 };
99 
100 enum TargetType // Used in the spell cast system for the AI
101 {
105 };
106 
107 enum YellId
108 {
109  ATTACKED = 0, // Used when attacked and set in combat
110  BEGIN = 1, // Used when the event is begun
111  INCOMING = 2, // Used to warn the raid that another wave phase is coming
112  RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned
113  FAILURE = 4, // Used when raid has failed (unsure where to place)
114  SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase
115  DEATH = 6, // Used on death
116 };
117 
118 struct hyjalAI : public npc_escortAI
119 {
120  hyjalAI(Creature* creature);
121 
122  void Initialize();
123 
124  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
125 
126  void EnterEvadeMode(EvadeReason /*why*/ = EVADE_REASON_OTHER) override; // Send creature back to spawn location and evade.
127 
128  void EnterCombat(Unit* /*who*/) override; // Used to reset cooldowns for our spells and to inform the raid that we're under attack
129 
130  void UpdateAI(uint32 diff) override; // Called to summon waves, check for boss deaths and to cast our spells.
131 
132  void JustDied(Unit* /*killer*/) override; // Called on death, informs the raid that they have failed.
133 
134  void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal
135  {
136  Faction = _faction;
137  }
138 
139  void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base.
140 
141  void SpawnVeins();
142  void DeSpawnVeins();
143  void JustSummoned(Creature* summoned) override;
144  void SummonedCreatureDespawn(Creature* summoned) override;
145  void HideNearPos(float x, float y);
146  void RespawnNearPos(float x, float y);
147  void WaypointReached(uint32 waypointId) override;
148  void DoOverrun(uint32 faction, const uint32 diff);
149  void MoveInLineOfSight(Unit* who) override;
150 
151  void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
152 
153  // Summons the next wave, calls SummonCreature
154  void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]);
155 
156  void StartEvent(Player* player); // Begins the event by gossip click
157 
158  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
159 
160  public:
162 
166 
173 
177  bool Summon;
178  bool bRetreat;
179  bool Debug;
180  bool VeinsSpawned[2];
183  bool Overrun;
191  bool DoRespawn;
192  bool DoHide;
193  bool IsDummy;
197 
198  struct Spell
199  {
204 
205  private:
207  //std::list<uint64> CreatureList;
208 };
209 #endif
210 
bool EventBegun
Definition: hyjalAI.h:174
Definition: hyjal.h:66
#define HYJAL_AI_MAX_SPELLS
Definition: hyjalAI.h:25
Definition: hyjal.h:69
void WaypointReached(uint32 waypointId) override
Definition: hyjalAI.cpp:943
uint32 RespawnTimer
Definition: hyjalAI.h:190
ObjectGuid BossGUID[2]
Definition: hyjalAI.h:164
Definition: hyjal.h:76
SummonList Summons
Definition: hyjalAI.h:182
uint32 TeleportTimer
Definition: hyjalAI.h:186
bool SecondBossDead
Definition: hyjalAI.h:176
Definition: hyjalAI.h:29
Definition: hyjal.h:79
Definition: ScriptedEscortAI.h:52
void MoveInLineOfSight(Unit *who) override
Definition: hyjalAI.cpp:444
uint32 EnemyCount
Definition: hyjalAI.h:171
uint32 Faction
Definition: hyjalAI.h:170
InstanceScript * instance
Definition: hyjalAI.h:161
Definition: hyjal.h:61
void JustSummoned(Creature *summoned) override
Definition: hyjalAI.cpp:373
Definition: hyjalAI.h:34
uint32 NextWaveTimer
Definition: hyjalAI.h:167
Spells
Definition: BattlegroundIC.h:707
void EnterCombat(Unit *) override
Definition: hyjalAI.cpp:434
Faction
Definition: boss_zum_rah.cpp:50
uint32 OverrunCounter2
Definition: hyjalAI.h:188
void SpawnVeins()
Definition: hyjalAI.cpp:645
void JustDied(Unit *) override
Definition: hyjalAI.cpp:886
uint32 RetreatTimer
Definition: hyjalAI.h:172
Definition: hyjal.h:63
Definition: hyjalAI.h:33
EvadeReason
Definition: CreatureAI.h:85
bool FirstBossDead
Definition: hyjalAI.h:175
bool VeinsSpawned[2]
Definition: hyjalAI.h:180
const Wave AllianceWaves[]
Definition: hyjalAI.h:50
const Wave HordeWaves[]
Definition: hyjalAI.h:75
hyjalAI(Creature *creature)
Definition: hyjalAI.cpp:318
Definition: Creature.h:467
void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3])
Definition: hyjalAI.cpp:536
Definition: hyjalAI.h:43
Definition: hyjal.h:62
uint32 MassTeleportTimer
Definition: hyjalAI.h:194
uint32 CheckTimer
Definition: hyjalAI.h:169
bool Overrun
Definition: hyjalAI.h:183
void UpdateAI(uint32 diff) override
Definition: hyjalAI.cpp:703
Definition: hyjalAI.h:114
SpellIds
Definition: stratholme.h:79
bool DoMassTeleport
Definition: hyjalAI.h:195
Definition: hyjalAI.h:30
void DeSpawnVeins()
Definition: hyjalAI.cpp:673
void Initialize()
Definition: hyjalAI.cpp:338
uint32 Mob[18]
Definition: hyjalAI.h:45
ObjectGuid VeinGUID[14]
Definition: hyjalAI.h:165
Definition: hyjalAI.h:118
bool Debug
Definition: hyjalAI.h:179
Definition: CreatureAI.h:90
Definition: hyjalAI.h:103
uint32 TargetType
Definition: hyjalAI.h:202
Definition: hyjalAI.h:39
TargetType
Definition: hyjalAI.h:100
bool Teleported
Definition: hyjalAI.h:184
Definition: hyjal.h:67
Definition: hyjal.h:77
void StartEvent(Player *player)
Definition: hyjalAI.cpp:586
bool bRetreat
Definition: hyjalAI.h:178
bool DoHide
Definition: hyjalAI.h:192
uint32_t uint32
Definition: Define.h:150
bool DoRespawn
Definition: hyjalAI.h:191
G3D::int16 y
Definition: Vector2int16.h:38
Definition: hyjalAI.h:111
Definition: hyjalAI.h:113
bool WaitForTeleport
Definition: hyjalAI.h:185
uint32 Cooldown
Definition: hyjalAI.h:201
uint32 SpellTimer[3]
Definition: hyjalAI.h:206
Definition: hyjalAI.h:198
void DoOverrun(uint32 faction, const uint32 diff)
Definition: hyjalAI.cpp:998
Definition: hyjal.h:78
Definition: hyjal.h:68
uint8 InfernalCount
Definition: hyjalAI.h:181
Definition: hyjalAI.h:110
Definition: hyjalAI.h:109
Definition: hyjalAI.h:40
bool IsDummy
Definition: hyjalAI.h:193
bool Summon
Definition: hyjalAI.h:177
uint32 WaveCount
Definition: hyjalAI.h:168
Definition: hyjal.h:65
Definition: hyjalAI.h:35
void RespawnNearPos(float x, float y)
Definition: hyjalAI.cpp:931
void SetFaction(uint32 _faction)
Definition: hyjalAI.h:134
uint32 WaveTimer
Definition: hyjalAI.h:46
Definition: hyjalAI.h:102
void Retreat()
Definition: hyjalAI.cpp:614
Definition: InstanceScript.h:141
uint8_t uint8
Definition: Define.h:152
YellId
Definition: hyjalAI.h:107
uint32 InfernalPoint
Definition: hyjalAI.h:189
void EnterEvadeMode(EvadeReason=EVADE_REASON_OTHER) override
Definition: hyjalAI.cpp:420
uint32 GetInstanceData(uint32 Event)
Definition: hyjalAI.cpp:609
Definition: ScriptedCreature.h:41
Definition: ObjectGuid.h:189
Definition: hyjalAI.h:104
G3D::int16 x
Definition: Vector2int16.h:37
ObjectGuid DummyGuid
Definition: hyjalAI.h:196
void SummonCreature(uint32 entry, float Base[4][3])
Definition: hyjalAI.cpp:452
Definition: hyjalAI.h:112
void Reset() override
Definition: hyjalAI.cpp:383
Definition: Unit.h:1305
Definition: hyjalAI.h:115
uint32 SpellId
Definition: hyjalAI.h:200
Definition: hyjalAI.h:36
void SummonedCreatureDespawn(Creature *summoned) override
Definition: hyjalAI.cpp:378
void HideNearPos(float x, float y)
Definition: hyjalAI.cpp:907
bool IsBoss
Definition: hyjalAI.h:47
ObjectGuid PlayerGUID
Definition: hyjalAI.h:163
uint32 OverrunCounter
Definition: hyjalAI.h:187
Definition: hyjal.h:64