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

Public Member Functions

 instance_gundrak_InstanceMapScript (Map *map)
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnUnitDeath (Unit *unit) override
 
bool SetBossState (uint32 type, EncounterState state) override
 
bool CheckRequiredBosses (uint32 bossId, Player const *player=nullptr) const override
 
bool IsBridgeReady () const
 
void SetData (uint32 type, uint32 data) override
 
void WriteSaveDataMore (std::ostringstream &data) override
 
void ReadSaveDataMore (std::istringstream &data) override
 
void ToggleGameObject (uint32 type, GOState state)
 
void Update (uint32 diff) override
 
- 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
 
virtual ObjectGuid GetGuidData (uint32 type) const override
 
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 ()
 
EncounterState GetBossState (uint32 id) const
 
CreatureBoundary constGetBossBoundary (uint32 id) const
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=NULL, uint32=0)
 
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 SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Protected Attributes

EventMap Events
 
GuidSet DwellerGUIDs
 
GOState SladRanStatueState
 
GOState DrakkariColossusStatueState
 
GOState MoorabiStatueState
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
- 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)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
bool _SkipCheckRequiredBosses (Player const *player=nullptr) const
 

Constructor & Destructor Documentation

instance_gundrak::instance_gundrak_InstanceMapScript::instance_gundrak_InstanceMapScript ( Map map)
inline
63  : InstanceScript(map)
64  {
69 
73  }
GOState DrakkariColossusStatueState
Definition: instance_gundrak.cpp:338
uint32 const EncounterCount
Definition: baradin_hold.h:28
ObjectData const gameObjectData[]
Definition: instance_gundrak.cpp:40
GOState SladRanStatueState
Definition: instance_gundrak.cpp:337
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:258
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:98
#define DataHeader
Definition: baradin_hold.h:25
InstanceScript(Map *map)
Definition: InstanceScript.h:144
Definition: GameObject.h:822
void LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:124
ObjectData const creatureData[]
Definition: instance_gundrak.cpp:34
GOState MoorabiStatueState
Definition: instance_gundrak.cpp:339
DoorData const doorData[]
Definition: instance_gundrak.cpp:24
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Definition: InstanceScript.cpp:136

+ Here is the call graph for this function:

Member Function Documentation

bool instance_gundrak::instance_gundrak_InstanceMapScript::CheckRequiredBosses ( uint32  bossId,
Player const player = nullptr 
) const
inlineoverridevirtual

Reimplemented from InstanceScript.

192  {
193  if (_SkipCheckRequiredBosses(player))
194  return true;
195 
196  switch (bossId)
197  {
200  return false;
201  break;
202  case DATA_GAL_DARAH:
206  return false;
207  break;
208  default:
209  break;
210  }
211 
212  return true;
213  }
GOState DrakkariColossusStatueState
Definition: instance_gundrak.cpp:338
Definition: gundrak.h:33
GOState SladRanStatueState
Definition: instance_gundrak.cpp:337
Definition: inflate.h:49
Definition: GameObject.h:824
bool IsHeroic() const
Definition: Map.cpp:3420
Map * instance
Definition: InstanceScript.h:148
Definition: gundrak.h:32
Definition: gundrak.h:31
bool _SkipCheckRequiredBosses(Player const *player=nullptr) const
Definition: InstanceScript.cpp:313
GOState MoorabiStatueState
Definition: instance_gundrak.cpp:339
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool instance_gundrak::instance_gundrak_InstanceMapScript::IsBridgeReady ( ) const
inline
216  {
218  }
GOState DrakkariColossusStatueState
Definition: instance_gundrak.cpp:338
GOState SladRanStatueState
Definition: instance_gundrak.cpp:337
Definition: GameObject.h:823
GOState MoorabiStatueState
Definition: instance_gundrak.cpp:339

+ Here is the caller graph for this function:

void instance_gundrak::instance_gundrak_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

76  {
77  switch (creature->GetEntry())
78  {
79  case NPC_RUIN_DWELLER:
80  if (creature->IsAlive())
81  DwellerGUIDs.insert(creature->GetGUID());
82  break;
83  default:
84  break;
85  }
86 
88  }
Definition: gundrak.h:58
GuidSet DwellerGUIDs
Definition: instance_gundrak.cpp:335
virtual void OnCreatureCreate(Creature *creature) override
Definition: InstanceScript.cpp:61
bool IsAlive() const
Definition: Unit.h:1692
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_gundrak::instance_gundrak_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

91  {
92  switch (go->GetEntry())
93  {
94  case GO_SLAD_RAN_ALTAR:
96  {
99  else
101  }
102  break;
103  case GO_MOORABI_ALTAR:
105  {
108  else
110  }
111  break;
114  {
117  else
119  }
120  break;
121  case GO_SLAD_RAN_STATUE:
123  break;
124  case GO_MOORABI_STATUE:
126  break;
127  case GO_GAL_DARAH_STATUE:
129  break;
132  break;
134  // Don't store door on non-heroic
135  if (!instance->IsHeroic())
136  return;
137  break;
138  case GO_TRAPDOOR:
140  break;
141  case GO_COLLISION:
142  go->SetGoState(CheckRequiredBosses(DATA_GAL_DARAH) ? GO_STATE_ACTIVE : GO_STATE_READY);
143  break;
144  default:
145  break;
146  }
147 
149  }
GOState DrakkariColossusStatueState
Definition: instance_gundrak.cpp:338
Definition: gundrak.h:67
Definition: SharedDefines.h:2125
GOState SladRanStatueState
Definition: instance_gundrak.cpp:337
Definition: gundrak.h:68
Definition: gundrak.h:78
Definition: inflate.h:49
Definition: gundrak.h:71
Definition: GameObject.h:824
Definition: gundrak.h:72
Definition: gundrak.h:29
bool IsHeroic() const
Definition: Map.cpp:3420
virtual void OnGameObjectCreate(GameObject *go) override
Definition: InstanceScript.cpp:73
Map * instance
Definition: InstanceScript.h:148
Definition: gundrak.h:65
Definition: gundrak.h:32
Definition: gundrak.h:31
bool CheckRequiredBosses(uint32 bossId, Player const *player=nullptr) const override
Definition: instance_gundrak.cpp:191
Definition: gundrak.h:30
Definition: UpdateFields.h:319
Definition: GameObject.h:822
Definition: GameObject.h:823
Definition: gundrak.h:69
void SetGoState(GOState state)
Definition: GameObject.cpp:2137
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: gundrak.h:77
Definition: gundrak.h:70
GOState MoorabiStatueState
Definition: instance_gundrak.cpp:339
uint32 GetEntry() const
Definition: Object.h:107
Definition: gundrak.h:66
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227

+ Here is the call graph for this function:

void instance_gundrak::instance_gundrak_InstanceMapScript::OnUnitDeath ( Unit unit)
inlineoverridevirtual

Reimplemented from ZoneScript.

152  {
153  if (unit->GetEntry() == NPC_RUIN_DWELLER)
154  {
155  DwellerGUIDs.erase(unit->GetGUID());
156 
157  if (DwellerGUIDs.empty())
159  }
160  }
Definition: gundrak.h:58
GuidSet DwellerGUIDs
Definition: instance_gundrak.cpp:335
Definition: gundrak.h:59
Position const EckSpawnPoint
Definition: instance_gundrak.cpp:54
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: Common.h:103
Definition: Object.h:59
uint32 GetEntry() const
Definition: Object.h:107
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346

+ Here is the call graph for this function:

void instance_gundrak::instance_gundrak_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

249  {
250  uint32 temp;
251 
252  data >> temp;
253  SladRanStatueState = GOState(temp);
254 
255  data >> temp;
257 
258  data >> temp;
259  MoorabiStatueState = GOState(temp);
260 
261  if (IsBridgeReady())
263  }
GOState DrakkariColossusStatueState
Definition: instance_gundrak.cpp:338
GOState SladRanStatueState
Definition: instance_gundrak.cpp:337
Events
Definition: alterac_valley.cpp:51
uint32_t uint32
Definition: Define.h:150
Definition: gundrak.h:90
bool IsBridgeReady() const
Definition: instance_gundrak.cpp:215
GOState
Definition: GameObject.h:820
Definition: gundrak.h:47
GOState MoorabiStatueState
Definition: instance_gundrak.cpp:339

+ Here is the call graph for this function:

bool instance_gundrak::instance_gundrak_InstanceMapScript::SetBossState ( uint32  type,
EncounterState  state 
)
inlineoverridevirtual

Reimplemented from InstanceScript.

163  {
164  if (!InstanceScript::SetBossState(type, state))
165  return false;
166 
167  switch (type)
168  {
169  case DATA_SLAD_RAN:
170  if (state == DONE)
172  go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
173  break;
175  if (state == DONE)
177  go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
178  break;
179  case DATA_MOORABI:
180  if (state == DONE)
182  go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
183  break;
184  default:
185  break;
186  }
187 
188  return true;
189  }
Definition: SharedDefines.h:2125
Definition: gundrak.h:37
Definition: inflate.h:49
Definition: gundrak.h:29
Definition: gundrak.h:36
GameObject * GetGameObject(uint32 type)
Definition: InstanceScript.h:184
Definition: GameObject.h:880
Definition: gundrak.h:38
Definition: gundrak.h:31
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: gundrak.h:30
Definition: UpdateFields.h:319

+ Here is the call graph for this function:

void instance_gundrak::instance_gundrak_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

221  {
222  if (type == DATA_STATUE_ACTIVATE)
223  {
224  switch (data)
225  {
226  case GO_SLAD_RAN_ALTAR:
228  break;
231  break;
232  case GO_MOORABI_ALTAR:
234  break;
235  default:
236  break;
237  }
238  }
239  }
Definition: gundrak.h:67
Definition: gundrak.h:41
Events
Definition: alterac_valley.cpp:51
Definition: gundrak.h:40
Definition: gundrak.h:42
Definition: gundrak.h:90
Definition: gundrak.h:65
Definition: gundrak.h:66
Definition: gundrak.h:49
void instance_gundrak::instance_gundrak_InstanceMapScript::ToggleGameObject ( uint32  type,
GOState  state 
)
inline
266  {
267  if (GameObject* go = GetGameObject(type))
268  go->SetGoState(state);
269 
270  switch (type)
271  {
273  SladRanStatueState = state;
274  break;
277  break;
278  case DATA_MOORABI_STATUE:
279  MoorabiStatueState = state;
280  break;
281  default:
282  break;
283  }
284  }
GOState DrakkariColossusStatueState
Definition: instance_gundrak.cpp:338
GOState SladRanStatueState
Definition: instance_gundrak.cpp:337
Definition: gundrak.h:41
Definition: gundrak.h:40
Definition: gundrak.h:42
GameObject * GetGameObject(uint32 type)
Definition: InstanceScript.h:184
Definition: GameObject.h:880
GOState MoorabiStatueState
Definition: instance_gundrak.cpp:339

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void instance_gundrak::instance_gundrak_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

287  {
288  Events.Update(diff);
289 
290  while (uint32 eventId = Events.ExecuteEvent())
291  {
292  uint32 spellId = 0;
293  uint32 altarId = 0;
294  switch (eventId)
295  {
297  spellId = SPELL_FIRE_BEAM_SNAKE;
298  altarId = DATA_SLAD_RAN_ALTAR;
299  break;
301  spellId = SPELL_FIRE_BEAM_ELEMENTAL;
303  break;
304  case DATA_MOORABI_STATUE:
305  spellId = SPELL_FIRE_BEAM_MAMMOTH;
306  altarId = DATA_MOORABI_ALTAR;
307  break;
308  case DATA_BRIDGE:
309  for (uint32 type = DATA_SLAD_RAN_STATUE; type <= DATA_GAL_DARAH_STATUE; ++type)
313  SaveToDB();
314  return;
315  default:
316  return;
317  }
318 
319  if (GameObject* altar = GetGameObject(altarId))
320  if (Creature* trigger = altar->FindNearestCreature(NPC_ALTAR_TRIGGER, 10.0f))
321  trigger->CastSpell((Unit*)nullptr, spellId, true);
322 
323  // eventId equals statueId
325 
326  if (IsBridgeReady())
328 
329  SaveToDB();
330  }
331  }
Definition: gundrak.h:45
void ToggleGameObject(uint32 type, GOState state)
Definition: instance_gundrak.cpp:265
Definition: gundrak.h:37
Definition: gundrak.h:41
Definition: gundrak.h:43
Definition: Creature.h:467
Events
Definition: alterac_valley.cpp:51
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2443
Definition: GameObject.h:824
Definition: gundrak.h:83
Definition: gundrak.h:36
Definition: gundrak.h:40
Definition: gundrak.h:42
void SaveToDB()
Definition: InstanceScript.cpp:39
GameObject * GetGameObject(uint32 type)
Definition: InstanceScript.h:184
uint32_t uint32
Definition: Define.h:150
Definition: GameObject.h:880
Definition: gundrak.h:90
Definition: gundrak.h:38
Definition: gundrak.h:60
bool IsBridgeReady() const
Definition: instance_gundrak.cpp:215
Definition: GameObject.h:822
Definition: GameObject.h:823
Definition: gundrak.h:46
Definition: gundrak.h:47
Definition: gundrak.h:84
Definition: gundrak.h:85
Definition: Unit.h:1305

+ Here is the call graph for this function:

void instance_gundrak::instance_gundrak_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

242  {
243  data << uint32(SladRanStatueState) << ' ';
244  data << uint32(DrakkariColossusStatueState) << ' ';
245  data << uint32(MoorabiStatueState) << ' ';
246  }
GOState DrakkariColossusStatueState
Definition: instance_gundrak.cpp:338
GOState SladRanStatueState
Definition: instance_gundrak.cpp:337
GOState MoorabiStatueState
Definition: instance_gundrak.cpp:339
uint32_t uint32
Definition: g3dmath.h:168

Member Data Documentation

GOState instance_gundrak::instance_gundrak_InstanceMapScript::DrakkariColossusStatueState
protected
GuidSet instance_gundrak::instance_gundrak_InstanceMapScript::DwellerGUIDs
protected
EventMap instance_gundrak::instance_gundrak_InstanceMapScript::Events
protected
GOState instance_gundrak::instance_gundrak_InstanceMapScript::MoorabiStatueState
protected
GOState instance_gundrak::instance_gundrak_InstanceMapScript::SladRanStatueState
protected

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