Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
hyjalAI.h
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#ifndef SC_HYJALAI_H
7#define SC_HYJALAI_H
8
9#include "hyjal.h"
10#include "ScriptedEscortAI.h"
11
12#define HYJAL_AI_MAX_SPELLS 3
13
15{
18
19 //Spells for Jaina
20 SPELL_BRILLIANCE_AURA = 31260, // The database must handle this spell via creature_addon(it should, but is removed in evade..)
24
25 //Thrall spells
28};
29
30struct Wave
31{
32 uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves
33 uint32 WaveTimer; // The timer before the next wave is summoned
34 bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that
35};
36
37const Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base
38{ // Rage Winterchill Wave 1-8
39 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0}, 120000, false},
40 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0}, 120000, false},
41 {{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},
42 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0}, 120000, false},
44 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0}, 120000, false},
47 // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron
48 {{RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true},
49 // Anetheron Wave 1-8
50 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0}, 120000, false},
51 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0}, 120000, false},
54 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0}, 120000, false},
55 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0}, 120000, false},
58 // All 8 Waves are summoned, summon Anatheron
59 {{ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true}
60};
61
62const Wave HordeWaves[]= // Waves that are summoned in the Horde base
63{ // Kaz'Rogal Wave 1-8
69 {{GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 180000, false},
70 {{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0}, 180000, false},
72 // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor
73 {{KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true},
74 // Azgalor Wave 1-8
83 // All 8 Waves are summoned, summon Azgalor
84 {{AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, true}
85};
86
87enum TargetType // Used in the spell cast system for the AI
88{
92};
93
95{
96 ATTACKED = 0, // Used when attacked and set in combat
97 BEGIN = 1, // Used when the event is begun
98 INCOMING = 2, // Used to warn the raid that another wave phase is coming
99 RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned
100 FAILURE = 4, // Used when raid has failed (unsure where to place)
101 SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase
102 DEATH = 6, // Used on death
103};
104
105struct hyjalAI : public npc_escortAI
106{
107 hyjalAI(Creature* creature);
108
109 void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat
110
111 void EnterEvadeMode(); // Send creature back to spawn location and evade.
112
113 void EnterCombat(Unit* /*who*/); // Used to reset cooldowns for our spells and to inform the raid that we're under attack
114
115 void UpdateAI(uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells.
116
117 void JustDied(Unit* /*killer*/); // Called on death, informs the raid that they have failed.
118
119 void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal
120 {
121 Faction = _faction;
122 }
123
124 void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base.
125
126 void SpawnVeins();
127 void DeSpawnVeins();
128 void JustSummoned(Creature* summoned);
129 void SummonedCreatureDespawn(Creature* summoned);
130 void HideNearPos(float x, float y);
131 void RespawnNearPos(float x, float y);
132 void WaypointReached(uint32 waypointId);
133 void DoOverrun(uint32 faction, const uint32 diff);
134 void MoveInLineOfSight(Unit* who);
135
136 void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
137
138 // Summons the next wave, calls SummonCreature
139 void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]);
140
141 void StartEvent(Player* player); // Begins the event by gossip click
142
143 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
144
145 public:
147
151
158
162 bool Summon;
164 bool Debug;
177 bool DoHide;
182
189
190 private:
192 //std::list<uint64> CreatureList;
193};
194#endif
195
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
@ SPELL_CHAIN_LIGHTNING
@ SPELL_TELEPORT_VISUAL
Definition chapter5.cpp:145
Definition Unit.h:1367
@ KAZROGAL
Definition hyjal.h:64
@ AZGALOR
Definition hyjal.h:65
@ FEL_STALKER
Definition hyjal.h:55
@ BANSHEE
Definition hyjal.h:50
@ ANETHERON
Definition hyjal.h:63
@ GARGOYLE
Definition hyjal.h:52
@ GIANT_INFERNAL
Definition hyjal.h:54
@ FROST_WYRM
Definition hyjal.h:53
@ ABOMINATION
Definition hyjal.h:48
@ CRYPT_FIEND
Definition hyjal.h:51
@ GHOUL
Definition hyjal.h:49
@ RAGE_WINTERCHILL
Definition hyjal.h:62
@ NECROMANCER
Definition hyjal.h:47
TargetType
Definition hyjalAI.h:88
@ TARGETTYPE_RANDOM
Definition hyjalAI.h:90
@ TARGETTYPE_SELF
Definition hyjalAI.h:89
@ TARGETTYPE_VICTIM
Definition hyjalAI.h:91
const Wave HordeWaves[]
Definition hyjalAI.h:62
@ SPELL_BRILLIANCE_AURA
Definition hyjalAI.h:20
@ SPELL_SUMMON_ELEMENTALS
Definition hyjalAI.h:23
@ SPELL_SUMMON_DIRE_WOLF
Definition hyjalAI.h:27
@ SPELL_MASS_TELEPORT
Definition hyjalAI.h:17
const Wave AllianceWaves[]
Definition hyjalAI.h:37
YellId
Definition hyjalAI.h:95
@ ATTACKED
Definition hyjalAI.h:96
@ BEGIN
Definition hyjalAI.h:97
@ INCOMING
Definition hyjalAI.h:98
@ RALLY
Definition hyjalAI.h:99
@ FAILURE
Definition hyjalAI.h:100
@ DEATH
Definition hyjalAI.h:102
@ SUCCESS
Definition hyjalAI.h:101
#define HYJAL_AI_MAX_SPELLS
Definition hyjalAI.h:12
SpellIds
Definition stratholme.h:65
Definition hyjalAI.h:31
uint32 WaveTimer
Definition hyjalAI.h:33
uint32 Mob[18]
Definition hyjalAI.h:32
bool IsBoss
Definition hyjalAI.h:34
uint32 TargetType
Definition hyjalAI.h:187
uint32 Cooldown
Definition hyjalAI.h:186
uint32 SpellId
Definition hyjalAI.h:185
bool Debug
Definition hyjalAI.h:164
void RespawnNearPos(float x, float y)
Definition hyjalAI.cpp:924
void SetFaction(uint32 _faction)
Definition hyjalAI.h:119
bool WaitForTeleport
Definition hyjalAI.h:170
void SpawnVeins()
Definition hyjalAI.cpp:642
uint32 RespawnTimer
Definition hyjalAI.h:175
void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3])
Definition hyjalAI.cpp:521
bool FirstBossDead
Definition hyjalAI.h:160
void Reset()
Definition hyjalAI.cpp:337
uint32 OverrunCounter2
Definition hyjalAI.h:173
bool Summon
Definition hyjalAI.h:162
bool DoMassTeleport
Definition hyjalAI.h:180
uint32 CheckTimer
Definition hyjalAI.h:154
bool VeinsSpawned[2]
Definition hyjalAI.h:165
void EnterCombat(Unit *)
Definition hyjalAI.cpp:417
bool DoRespawn
Definition hyjalAI.h:176
bool SecondBossDead
Definition hyjalAI.h:161
uint32 RetreatTimer
Definition hyjalAI.h:157
bool bRetreat
Definition hyjalAI.h:163
void StartEvent(Player *player)
Definition hyjalAI.cpp:576
void MoveInLineOfSight(Unit *who)
Definition hyjalAI.cpp:427
uint8 InfernalCount
Definition hyjalAI.h:166
void EnterEvadeMode()
Definition hyjalAI.cpp:403
uint32 EnemyCount
Definition hyjalAI.h:156
uint32 InfernalPoint
Definition hyjalAI.h:174
uint64 PlayerGUID
Definition hyjalAI.h:148
void DeSpawnVeins()
Definition hyjalAI.cpp:668
uint32 MassTeleportTimer
Definition hyjalAI.h:179
void SummonedCreatureDespawn(Creature *summoned)
Definition hyjalAI.cpp:332
void UpdateAI(uint32 diff)
== Triggered Actions Requested ==================
Definition hyjalAI.cpp:697
void HideNearPos(float x, float y)
Definition hyjalAI.cpp:900
SummonList Summons
Definition hyjalAI.h:167
uint32 NextWaveTimer
Definition hyjalAI.h:152
bool EventBegun
Definition hyjalAI.h:159
void Retreat()
Definition hyjalAI.cpp:608
void WaypointReached(uint32 waypointId)
Definition hyjalAI.cpp:936
uint32 GetInstanceData(uint32 Event)
Definition hyjalAI.cpp:599
void JustSummoned(Creature *summoned)
Definition hyjalAI.cpp:327
uint32 OverrunCounter
Definition hyjalAI.h:172
uint64 DummyGuid
Definition hyjalAI.h:181
hyjalAI(Creature *creature)
Definition hyjalAI.cpp:305
void JustDied(Unit *)
Definition hyjalAI.cpp:877
uint32 TeleportTimer
Definition hyjalAI.h:171
uint32 WaveCount
Definition hyjalAI.h:153
InstanceScript * instance
Definition hyjalAI.h:146
void DoOverrun(uint32 faction, const uint32 diff)
Definition hyjalAI.cpp:991
bool Overrun
Definition hyjalAI.h:168
uint64 BossGUID[2]
Definition hyjalAI.h:149
uint32 SpellTimer[3]
Definition hyjalAI.h:191
uint64 VeinGUID[14]
Definition hyjalAI.h:150
void SummonCreature(uint32 entry, float Base[4][3])
Definition hyjalAI.cpp:435
bool Teleported
Definition hyjalAI.h:169
uint32 Faction
Definition hyjalAI.h:155
bool DoHide
Definition hyjalAI.h:177
bool IsDummy
Definition hyjalAI.h:178
npc_escortAI(Creature *creature)