TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
instance_zulfarrak::instance_zulfarrak_InstanceMapScript Struct Reference

Public Member Functions

 instance_zulfarrak_InstanceMapScript (Map *map)
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
uint32 GetData (uint32 type) const override
 
ObjectGuid GetGuidData (uint32 data) const override
 
void SetData (uint32 type, uint32 data) override
 
virtual void Update (uint32 diff) override
 
void MoveNPCIfAlive (uint32 entry, float x, float y, float z, float o)
 
void SpawnPyramidWave (uint32 wave)
 
bool IsWaveAllDead ()
 
void SendAddsUpStairs (uint32 count)
 
- Public Member Functions inherited from InstanceScript
 InstanceScript (Map *map)
 
virtual ~InstanceScript ()
 
virtual void Initialize ()
 
virtual void Load (char const *data)
 
virtual std::string GetSaveData ()
 
void SaveToDB ()
 
virtual bool IsEncounterInProgress () const
 
virtual void OnCreatureRemove (Creature *creature) override
 
virtual void OnGameObjectRemove (GameObject *go) override
 
ObjectGuid GetObjectGuid (uint32 type) const
 
CreatureGetCreature (uint32 type)
 
GameObjectGetGameObject (uint32 type)
 
virtual void OnPlayerEnter (Player *)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoCloseDoorOrButton (ObjectGuid guid)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
void DoUpdateWorldState (uint32 worldstateId, uint32 worldstateValue)
 
void DoSendNotifyToInstance (char const *format,...)
 
void DoUpdateAchievementCriteria (AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=NULL)
 
void DoStartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoStopTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoRemoveAurasDueToSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayers (uint32 spell)
 
bool ServerAllowsTwoSideGroups ()
 
virtual bool SetBossState (uint32 id, EncounterState state)
 
EncounterState GetBossState (uint32 id) const
 
CreatureBoundary constGetBossBoundary (uint32 id) const
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=NULL, uint32=0)
 
virtual bool CheckRequiredBosses (uint32, Player const *=nullptr) const
 
void UpdateEncounterState (EncounterCreditType type, uint32 creditEntry, Unit *source)
 
void SetCompletedEncountersMask (uint32 newMask)
 
uint32 GetCompletedEncounterMask () const
 
void SendEncounterUnit (uint32 type, Unit *unit=NULL, uint8 param1=0, uint8 param2=0)
 
virtual void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &)
 
void UpdatePhasing ()
 
uint32 GetEncounterCount () const
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void OnUnitDeath (Unit *)
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Public Attributes

uint32 GahzRillaEncounter
 
ObjectGuid ZumrahGUID
 
ObjectGuid BlyGUID
 
ObjectGuid WeegliGUID
 
ObjectGuid OroGUID
 
ObjectGuid RavenGUID
 
ObjectGuid MurtaGUID
 
ObjectGuid EndDoorGUID
 
uint32 PyramidPhase
 
uint32 major_wave_Timer
 
uint32 minor_wave_Timer
 
uint32 addGroupSize
 
uint32 waypoint
 
GuidList addsAtBase
 
GuidList movedadds
 
- Public Attributes inherited from InstanceScript
Mapinstance
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Protected Member Functions inherited from InstanceScript
void SetHeaders (std::string const &dataHeaders)
 
void SetBossNumber (uint32 number)
 
void LoadBossBoundaries (BossBoundaryData const &data)
 
void LoadDoorData (DoorData const *data)
 
void LoadMinionData (MinionData const *data)
 
void LoadObjectData (ObjectData const *creatureData, ObjectData const *gameObjectData)
 
void AddObject (Creature *obj, bool add)
 
void AddObject (GameObject *obj, bool add)
 
void AddObject (WorldObject *obj, uint32 type, bool add)
 
virtual void AddDoor (GameObject *door, bool add)
 
void AddMinion (Creature *minion, bool add)
 
virtual void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
BossInfoGetBossInfo (uint32 id)
 
bool ReadSaveDataHeaders (std::istringstream &data)
 
void ReadSaveDataBossStates (std::istringstream &data)
 
virtual void ReadSaveDataMore (std::istringstream &)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
virtual void WriteSaveDataMore (std::ostringstream &)
 
bool _SkipCheckRequiredBosses (Player const *player=nullptr) const
 

Constructor & Destructor Documentation

instance_zulfarrak::instance_zulfarrak_InstanceMapScript::instance_zulfarrak_InstanceMapScript ( Map map)
inline
111  : InstanceScript(map)
112  {
115  PyramidPhase = 0;
116  major_wave_Timer = 0;
117  minor_wave_Timer = 0;
118  addGroupSize = 0;
119  waypoint = 0;
120  }
uint32 major_wave_Timer
Definition: instance_zulfarrak.cpp:131
uint32 GahzRillaEncounter
Definition: instance_zulfarrak.cpp:122
uint32 PyramidPhase
Definition: instance_zulfarrak.cpp:130
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:98
#define DataHeader
Definition: baradin_hold.h:25
uint32 minor_wave_Timer
Definition: instance_zulfarrak.cpp:132
uint32 addGroupSize
Definition: instance_zulfarrak.cpp:133
InstanceScript(Map *map)
Definition: InstanceScript.h:144
Definition: InstanceScript.h:58
uint32 waypoint
Definition: instance_zulfarrak.cpp:134

+ Here is the call graph for this function:

Member Function Documentation

uint32 instance_zulfarrak::instance_zulfarrak_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

183  {
184  switch (type)
185  {
186  case EVENT_PYRAMID:
187  return PyramidPhase;
188  }
189  return 0;
190  }
uint32 PyramidPhase
Definition: instance_zulfarrak.cpp:130
Definition: zulfarrak.h:35
ObjectGuid instance_zulfarrak::instance_zulfarrak_InstanceMapScript::GetGuidData ( uint32  data) const
inlineoverridevirtual

Reimplemented from InstanceScript.

193  {
194  switch (data)
195  {
196  case ENTRY_ZUM_RAH:
197  return ZumrahGUID;
198  case ENTRY_BLY:
199  return BlyGUID;
200  case ENTRY_RAVEN:
201  return RavenGUID;
202  case ENTRY_ORO:
203  return OroGUID;
204  case ENTRY_WEEGLI:
205  return WeegliGUID;
206  case ENTRY_MURTA:
207  return MurtaGUID;
208  case GO_END_DOOR:
209  return EndDoorGUID;
210  }
211  return ObjectGuid::Empty;
212  }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: zulfarrak.h:27
ObjectGuid RavenGUID
Definition: instance_zulfarrak.cpp:127
ObjectGuid ZumrahGUID
Definition: instance_zulfarrak.cpp:123
ObjectGuid OroGUID
Definition: instance_zulfarrak.cpp:126
Definition: zulfarrak.h:29
ObjectGuid MurtaGUID
Definition: instance_zulfarrak.cpp:128
ObjectGuid WeegliGUID
Definition: instance_zulfarrak.cpp:125
ObjectGuid EndDoorGUID
Definition: instance_zulfarrak.cpp:129
Definition: zulfarrak.h:33
Definition: zulfarrak.h:30
Definition: zulfarrak.h:26
ObjectGuid BlyGUID
Definition: instance_zulfarrak.cpp:124
Definition: zulfarrak.h:31
Definition: zulfarrak.h:28

+ Here is the caller graph for this function:

bool instance_zulfarrak::instance_zulfarrak_InstanceMapScript::IsWaveAllDead ( )
inline
339  {
340  for (GuidList::iterator itr = addsAtBase.begin(); itr != addsAtBase.end(); ++itr)
341  {
342  if (Creature* add = instance->GetCreature((*itr)))
343  {
344  if (add->IsAlive())
345  return false;
346  }
347  }
348  for (GuidList::iterator itr = movedadds.begin(); itr != movedadds.end(); ++itr)
349  {
350  if (Creature* add = instance->GetCreature(((*itr))))
351  {
352  if (add->IsAlive())
353  return false;
354  }
355  }
356  return true;
357  }
Definition: Creature.h:467
GuidList addsAtBase
Definition: instance_zulfarrak.cpp:309
GuidList movedadds
Definition: instance_zulfarrak.cpp:309
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void instance_zulfarrak::instance_zulfarrak_InstanceMapScript::MoveNPCIfAlive ( uint32  entry,
float  x,
float  y,
float  z,
float  o 
)
inline
312  {
313  if (Creature* npc = instance->GetCreature(GetGuidData(entry)))
314  {
315  if (npc->IsAlive())
316  {
317  npc->SetWalk(true);
318  npc->GetMotionMaster()->MovePoint(1, x, y, z);
319  npc->SetHomePosition(x, y, z, o);
320  }
321  }
322  }
Definition: Creature.h:467
G3D::int16 z
Definition: Vector3int16.h:46
ObjectGuid GetGuidData(uint32 data) const override
Definition: instance_zulfarrak.cpp:192
G3D::int16 y
Definition: Vector2int16.h:38
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void instance_zulfarrak::instance_zulfarrak_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

137  {
138  switch (creature->GetEntry())
139  {
140  case ENTRY_ZUM_RAH:
141  ZumrahGUID = creature->GetGUID();
142  break;
143  case ENTRY_BLY:
144  BlyGUID = creature->GetGUID();
145  creature->SetReactState(REACT_PASSIVE); // starts out passive (in a cage)
146  break;
147  case ENTRY_RAVEN:
148  RavenGUID = creature->GetGUID();
149  creature->SetReactState(REACT_PASSIVE);// starts out passive (in a cage)
150  break;
151  case ENTRY_ORO:
152  OroGUID = creature->GetGUID();
153  creature->SetReactState(REACT_PASSIVE);// starts out passive (in a cage)
154  break;
155  case ENTRY_WEEGLI:
156  WeegliGUID = creature->GetGUID();
157  creature->SetReactState(REACT_PASSIVE);// starts out passive (in a cage)
158  break;
159  case ENTRY_MURTA:
160  MurtaGUID = creature->GetGUID();
161  creature->SetReactState(REACT_PASSIVE);// starts out passive (in a cage)
162  break;
163  case NPC_GAHZRILLA:
165  creature->DisappearAndDie();
166  else
168  break;
169  }
170  }
uint32 GahzRillaEncounter
Definition: instance_zulfarrak.cpp:122
Definition: zulfarrak.h:27
ObjectGuid RavenGUID
Definition: instance_zulfarrak.cpp:127
ObjectGuid ZumrahGUID
Definition: instance_zulfarrak.cpp:123
Definition: instance_zulfarrak.cpp:27
Definition: Unit.h:1129
ObjectGuid OroGUID
Definition: instance_zulfarrak.cpp:126
Definition: zulfarrak.h:29
ObjectGuid MurtaGUID
Definition: instance_zulfarrak.cpp:128
ObjectGuid WeegliGUID
Definition: instance_zulfarrak.cpp:125
Definition: InstanceScript.h:59
Definition: zulfarrak.h:30
Definition: zulfarrak.h:26
ObjectGuid const & GetGUID() const
Definition: Object.h:105
ObjectGuid BlyGUID
Definition: instance_zulfarrak.cpp:124
Definition: zulfarrak.h:31
Definition: zulfarrak.h:28
uint32 GetEntry() const
Definition: Object.h:107
void DisappearAndDie()
Definition: Creature.cpp:256
void SetReactState(ReactStates st)
Definition: Creature.h:502

+ Here is the call graph for this function:

void instance_zulfarrak::instance_zulfarrak_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

173  {
174  switch (go->GetEntry())
175  {
176  case GO_END_DOOR:
177  EndDoorGUID = go->GetGUID();
178  break;
179  }
180  }
ObjectGuid EndDoorGUID
Definition: instance_zulfarrak.cpp:129
Definition: zulfarrak.h:33
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint32 GetEntry() const
Definition: Object.h:107

+ Here is the call graph for this function:

void instance_zulfarrak::instance_zulfarrak_InstanceMapScript::SendAddsUpStairs ( uint32  count)
inline
360  {
361  //pop a add from list, send him up the stairs...
362  for (uint32 addCount = 0; addCount<count && !addsAtBase.empty(); addCount++)
363  {
364  if (Creature* add = instance->GetCreature(*addsAtBase.begin()))
365  {
366  add->GetMotionMaster()->MovePath(PATH_ADDS, false);
367  movedadds.push_back(add->GetGUID());
368  }
369  addsAtBase.erase(addsAtBase.begin());
370  }
371  }
Definition: Creature.h:467
GuidList addsAtBase
Definition: instance_zulfarrak.cpp:309
GuidList movedadds
Definition: instance_zulfarrak.cpp:309
uint32_t uint32
Definition: Define.h:150
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
Definition: instance_zulfarrak.cpp:30

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void instance_zulfarrak::instance_zulfarrak_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

215  {
216  switch (type)
217  {
218  case EVENT_PYRAMID:
219  PyramidPhase=data;
220  break;
221  };
222  }
uint32 PyramidPhase
Definition: instance_zulfarrak.cpp:130
Definition: zulfarrak.h:35

+ Here is the caller graph for this function:

void instance_zulfarrak::instance_zulfarrak_InstanceMapScript::SpawnPyramidWave ( uint32  wave)
inline
325  {
326  for (int i = 0; i < pyramidSpawnTotal; i++)
327  {
328  if (pyramidSpawns[i][0] == (float)wave)
329  {
330  Position pos = {pyramidSpawns[i][2], pyramidSpawns[i][3], 8.87f, 0};
332  ts->GetMotionMaster()->MoveRandom(10);
333  addsAtBase.push_back(ts->GetGUID());
334  }
335  }
336  }
Definition: TemporarySummon.h:40
void MoveRandom(float spawndist=0.0f)
Definition: MotionMaster.cpp:192
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=NULL, uint32 duration=0, Unit *summoner=NULL, uint32 spellId=0, uint32 vehId=0)
Definition: Object.cpp:2219
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
int const pyramidSpawnTotal
Definition: instance_zulfarrak.cpp:33
GuidList addsAtBase
Definition: instance_zulfarrak.cpp:309
Map * instance
Definition: InstanceScript.h:148
float pyramidSpawns[pyramidSpawnTotal][4]
Definition: instance_zulfarrak.cpp:36
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: Position.h:27
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void instance_zulfarrak::instance_zulfarrak_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

225  {
226  switch (PyramidPhase)
227  {
228  case PYRAMID_NOT_STARTED:
230  break;
232  SpawnPyramidWave(1);
234  major_wave_Timer=120000;
236  addGroupSize=2;
237  break;
238  case PYRAMID_WAVE_1:
239  if (IsWaveAllDead())
240  {
242  major_wave_Timer = 10000; //give players a few seconds before wave 2 starts to rebuff
243  }
244  else
245  if (minor_wave_Timer<diff)
246  {
248  minor_wave_Timer=10000;
249  }
250  else
251  minor_wave_Timer -= diff;
252  break;
253  case PYRAMID_PRE_WAVE_2:
254  if (major_wave_Timer<diff)
255  {
256  // beginning 2nd wave!
257  SpawnPyramidWave(2);
259  minor_wave_Timer = 0;
260  addGroupSize=2;
261  }
262  else
263  major_wave_Timer -= diff;
264  break;
265  case PYRAMID_WAVE_2:
266  if (IsWaveAllDead())
267  {
268  SpawnPyramidWave(3);
270  major_wave_Timer = 5000; //give NPCs time to return to their home spots
271  }
272  else
273  if (minor_wave_Timer<diff)
274  {
276  minor_wave_Timer=10000;
277  }
278  else
279  minor_wave_Timer -= diff;
280  break;
281  case PYRAMID_PRE_WAVE_3:
282  if (major_wave_Timer<diff)
283  {
284  // move NPCs to bottom of stair
285  MoveNPCIfAlive(ENTRY_BLY, 1887.92f, 1228.179f, 9.98f, 4.78f);
286  MoveNPCIfAlive(ENTRY_MURTA, 1891.57f, 1228.68f, 9.69f, 4.78f);
287  MoveNPCIfAlive(ENTRY_ORO, 1897.23f, 1228.34f, 9.43f, 4.78f);
288  MoveNPCIfAlive(ENTRY_RAVEN, 1883.68f, 1227.95f, 9.543f, 4.78f);
289  MoveNPCIfAlive(ENTRY_WEEGLI, 1878.02f, 1227.65f, 9.485f, 4.78f);
291  }
292  else
293  major_wave_Timer -= diff;
294  break;
295  case PYRAMID_WAVE_3:
296  if (IsWaveAllDead()) // move NPCS to their final positions
297  {
299  MoveNPCIfAlive(ENTRY_BLY, 1883.82f, 1200.83f, 8.87f, 1.32f);
300  MoveNPCIfAlive(ENTRY_MURTA, 1891.83f, 1201.45f, 8.87f, 1.32f);
301  MoveNPCIfAlive(ENTRY_ORO, 1894.50f, 1204.40f, 8.87f, 1.32f);
302  MoveNPCIfAlive(ENTRY_RAVEN, 1874.11f, 1206.17f, 8.87f, 1.32f);
303  MoveNPCIfAlive(ENTRY_WEEGLI, 1877.52f, 1199.63f, 8.87f, 1.32f);
304  }
305  break;
306  };
307  }
uint32 major_wave_Timer
Definition: instance_zulfarrak.cpp:131
Definition: zulfarrak.h:49
Definition: zulfarrak.h:27
Definition: zulfarrak.h:29
Definition: zulfarrak.h:54
Definition: zulfarrak.h:48
uint32 PyramidPhase
Definition: instance_zulfarrak.cpp:130
void MoveNPCIfAlive(uint32 entry, float x, float y, float z, float o)
Definition: instance_zulfarrak.cpp:311
bool IsWaveAllDead()
Definition: instance_zulfarrak.cpp:338
uint32 minor_wave_Timer
Definition: instance_zulfarrak.cpp:132
uint32 addGroupSize
Definition: instance_zulfarrak.cpp:133
Definition: zulfarrak.h:53
Definition: zulfarrak.h:35
Definition: zulfarrak.h:50
void SetData(uint32 type, uint32 data) override
Definition: instance_zulfarrak.cpp:214
Definition: zulfarrak.h:30
Definition: zulfarrak.h:51
Definition: zulfarrak.h:52
Definition: zulfarrak.h:31
Definition: zulfarrak.h:28
Definition: zulfarrak.h:46
void SendAddsUpStairs(uint32 count)
Definition: instance_zulfarrak.cpp:359
void SpawnPyramidWave(uint32 wave)
Definition: instance_zulfarrak.cpp:324

+ Here is the call graph for this function:

Member Data Documentation

uint32 instance_zulfarrak::instance_zulfarrak_InstanceMapScript::addGroupSize
GuidList instance_zulfarrak::instance_zulfarrak_InstanceMapScript::addsAtBase
ObjectGuid instance_zulfarrak::instance_zulfarrak_InstanceMapScript::BlyGUID
ObjectGuid instance_zulfarrak::instance_zulfarrak_InstanceMapScript::EndDoorGUID
uint32 instance_zulfarrak::instance_zulfarrak_InstanceMapScript::GahzRillaEncounter
uint32 instance_zulfarrak::instance_zulfarrak_InstanceMapScript::major_wave_Timer
uint32 instance_zulfarrak::instance_zulfarrak_InstanceMapScript::minor_wave_Timer
GuidList instance_zulfarrak::instance_zulfarrak_InstanceMapScript::movedadds
ObjectGuid instance_zulfarrak::instance_zulfarrak_InstanceMapScript::MurtaGUID
ObjectGuid instance_zulfarrak::instance_zulfarrak_InstanceMapScript::OroGUID
uint32 instance_zulfarrak::instance_zulfarrak_InstanceMapScript::PyramidPhase
ObjectGuid instance_zulfarrak::instance_zulfarrak_InstanceMapScript::RavenGUID
uint32 instance_zulfarrak::instance_zulfarrak_InstanceMapScript::waypoint
ObjectGuid instance_zulfarrak::instance_zulfarrak_InstanceMapScript::WeegliGUID
ObjectGuid instance_zulfarrak::instance_zulfarrak_InstanceMapScript::ZumrahGUID

The documentation for this struct was generated from the following file: