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

Public Member Functions

 instance_mount_hyjal_InstanceMapScript (Map *map)
 
bool IsEncounterInProgress () const override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnCreatureCreate (Creature *creature) override
 
ObjectGuid GetGuidData (uint32 identifier) const override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 type) const override
 
std::string GetSaveData () override
 
void Load (const char *in) override
 
- Public Member Functions inherited from InstanceScript
 InstanceScript (Map *map)
 
virtual ~InstanceScript ()
 
virtual void Initialize ()
 
void SaveToDB ()
 
virtual void Update (uint32)
 
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)
 

Protected Attributes

uint32 m_auiEncounter [EncounterCount]
 
std::string str_data
 
GuidList m_uiAncientGemGUID
 
ObjectGuid RageWinterchill
 
ObjectGuid Anetheron
 
ObjectGuid Kazrogal
 
ObjectGuid Azgalor
 
ObjectGuid Archimonde
 
ObjectGuid JainaProudmoore
 
ObjectGuid Thrall
 
ObjectGuid TyrandeWhisperwind
 
ObjectGuid HordeGate
 
ObjectGuid ElfGate
 
uint32 Trash
 
uint32 hordeRetreat
 
uint32 allianceRetreat
 
uint32 RaidDamage
 
bool ArchiYell
 

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)
 
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_hyjal::instance_mount_hyjal_InstanceMapScript::instance_mount_hyjal_InstanceMapScript ( Map map)
inline
62  : InstanceScript(map)
63  {
65  LoadObjectData(creatureData, nullptr);
66  memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
67 
68  RaidDamage = 0;
69  Trash = 0;
70  hordeRetreat = 0;
71  allianceRetreat = 0;
72 
73  ArchiYell = false;
74  }
bool ArchiYell
Definition: instance_hyjal.cpp:314
uint32 allianceRetreat
Definition: instance_hyjal.cpp:312
uint32 m_auiEncounter[EncounterCount]
Definition: instance_hyjal.cpp:297
uint32 RaidDamage
Definition: instance_hyjal.cpp:313
uint32 Trash
Definition: instance_hyjal.cpp:310
uint32 hordeRetreat
Definition: instance_hyjal.cpp:311
ObjectData const creatureData[]
Definition: instance_hyjal.cpp:44
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:98
#define DataHeader
Definition: baradin_hold.h:25
InstanceScript(Map *map)
Definition: InstanceScript.h:144
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Definition: InstanceScript.cpp:136

+ Here is the call graph for this function:

Member Function Documentation

uint32 instance_hyjal::instance_mount_hyjal_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

258  {
259  switch (type)
260  {
262  case DATA_ANETHERONEVENT: return m_auiEncounter[1];
263  case DATA_KAZROGALEVENT: return m_auiEncounter[2];
264  case DATA_AZGALOREVENT: return m_auiEncounter[3];
265  case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4];
266  case DATA_TRASH: return Trash;
268  case DATA_HORDE_RETREAT: return hordeRetreat;
269  case DATA_RAIDDAMAGE: return RaidDamage;
270  }
271  return 0;
272  }
Definition: hyjal.h:43
uint32 allianceRetreat
Definition: instance_hyjal.cpp:312
Definition: hyjal.h:38
Definition: hyjal.h:41
uint32 m_auiEncounter[EncounterCount]
Definition: instance_hyjal.cpp:297
uint32 RaidDamage
Definition: instance_hyjal.cpp:313
uint32 Trash
Definition: instance_hyjal.cpp:310
uint32 hordeRetreat
Definition: instance_hyjal.cpp:311
Definition: hyjal.h:29
Definition: hyjal.h:45
Definition: hyjal.h:33
Definition: hyjal.h:36
Definition: hyjal.h:31
Definition: hyjal.h:44

+ Here is the caller graph for this function:

ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::GetGuidData ( uint32  identifier) const
inlineoverridevirtual

Reimplemented from InstanceScript.

145  {
146  switch (identifier)
147  {
149  case DATA_ANETHERON: return Anetheron;
150  case DATA_KAZROGAL: return Kazrogal;
151  case DATA_AZGALOR: return Azgalor;
152  case DATA_ARCHIMONDE: return Archimonde;
154  case DATA_THRALL: return Thrall;
156  }
157 
158  return ObjectGuid::Empty;
159  }
Definition: hyjal.h:37
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
ObjectGuid RageWinterchill
Definition: instance_hyjal.cpp:300
ObjectGuid Archimonde
Definition: instance_hyjal.cpp:304
Definition: hyjal.h:34
Definition: hyjal.h:32
ObjectGuid Kazrogal
Definition: instance_hyjal.cpp:302
Definition: hyjal.h:35
Definition: hyjal.h:40
Definition: hyjal.h:39
ObjectGuid Azgalor
Definition: instance_hyjal.cpp:303
ObjectGuid TyrandeWhisperwind
Definition: instance_hyjal.cpp:307
ObjectGuid Anetheron
Definition: instance_hyjal.cpp:301
Definition: hyjal.h:30
Definition: hyjal.h:28
ObjectGuid Thrall
Definition: instance_hyjal.cpp:306
ObjectGuid JainaProudmoore
Definition: instance_hyjal.cpp:305
std::string instance_hyjal::instance_mount_hyjal_InstanceMapScript::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

275  {
276  return str_data;
277  }
std::string str_data
Definition: instance_hyjal.cpp:298
bool instance_hyjal::instance_mount_hyjal_InstanceMapScript::IsEncounterInProgress ( ) const
inlineoverridevirtual

Reimplemented from InstanceScript.

77  {
78  for (uint8 i = 0; i < EncounterCount; ++i)
79  if (m_auiEncounter[i] == IN_PROGRESS)
80  return true;
81 
82  return false;
83  }
uint32 const EncounterCount
Definition: baradin_hold.h:28
uint32 m_auiEncounter[EncounterCount]
Definition: instance_hyjal.cpp:297
Definition: InstanceScript.h:59
uint8_t uint8
Definition: Define.h:152
void instance_hyjal::instance_mount_hyjal_InstanceMapScript::Load ( const char *  in)
inlineoverridevirtual

Reimplemented from InstanceScript.

280  {
281  if (!in)
282  {
284  return;
285  }
286 
287  OUT_LOAD_INST_DATA(in);
288  std::istringstream loadStream(in);
290  for (uint8 i = 0; i < EncounterCount; ++i)
291  if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead.
294  }
#define OUT_LOAD_INST_DATA_FAIL
Definition: InstanceScript.h:33
uint32 allianceRetreat
Definition: instance_hyjal.cpp:312
uint32 const EncounterCount
Definition: baradin_hold.h:28
uint32 m_auiEncounter[EncounterCount]
Definition: instance_hyjal.cpp:297
uint32 RaidDamage
Definition: instance_hyjal.cpp:313
uint32 hordeRetreat
Definition: instance_hyjal.cpp:311
#define OUT_LOAD_INST_DATA_COMPLETE
Definition: InstanceScript.h:32
Definition: InstanceScript.h:59
Definition: InstanceScript.h:58
uint8_t uint8
Definition: Define.h:152
#define OUT_LOAD_INST_DATA(a)
Definition: InstanceScript.h:31
void instance_hyjal::instance_mount_hyjal_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

110  {
111  switch (creature->GetEntry())
112  {
113  case RAGE_WINTERCHILL:
114  RageWinterchill = creature->GetGUID();
115  break;
116  case ANETHERON:
117  Anetheron = creature->GetGUID();
118  break;
119  case KAZROGAL:
120  Kazrogal = creature->GetGUID();
121  break;
122  case AZGALOR:
123  Azgalor = creature->GetGUID();
124  break;
125  case ARCHIMONDE:
126  Archimonde = creature->GetGUID();
128  creature->SetVisible(false);
129  break;
130  case JAINA:
131  JainaProudmoore = creature->GetGUID();
132  break;
133  case THRALL:
134  Thrall = creature->GetGUID();
135  break;
136  case TYRANDE:
137  TyrandeWhisperwind = creature->GetGUID();
138  break;
139  }
140 
142  }
Definition: hyjal.h:80
Definition: hyjal.h:76
Definition: hyjal.h:71
Definition: hyjal.h:79
Definition: hyjal.h:72
ObjectGuid RageWinterchill
Definition: instance_hyjal.cpp:300
ObjectGuid Archimonde
Definition: instance_hyjal.cpp:304
Definition: inflate.h:49
uint32 GetData(uint32 type) const override
Definition: instance_hyjal.cpp:257
ObjectGuid Kazrogal
Definition: instance_hyjal.cpp:302
virtual void OnCreatureCreate(Creature *creature) override
Definition: InstanceScript.cpp:61
Definition: hyjal.h:77
void SetVisible(bool x)
Definition: Unit.cpp:10368
Definition: hyjal.h:33
ObjectGuid Azgalor
Definition: instance_hyjal.cpp:303
ObjectGuid TyrandeWhisperwind
Definition: instance_hyjal.cpp:307
ObjectGuid const & GetGUID() const
Definition: Object.h:105
ObjectGuid Anetheron
Definition: instance_hyjal.cpp:301
Definition: hyjal.h:78
Definition: hyjal.h:73
uint32 GetEntry() const
Definition: Object.h:107
ObjectGuid Thrall
Definition: instance_hyjal.cpp:306
ObjectGuid JainaProudmoore
Definition: instance_hyjal.cpp:305

+ Here is the call graph for this function:

void instance_hyjal::instance_mount_hyjal_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

86  {
87  switch (go->GetEntry())
88  {
90  HordeGate = go->GetGUID();
91  if (allianceRetreat)
93  else
95  break;
97  ElfGate = go->GetGUID();
98  if (hordeRetreat)
100  else
102  break;
103  case GO_ANCIENT_GEM:
104  m_uiAncientGemGUID.push_back(go->GetGUID());
105  break;
106  }
107  }
uint32 allianceRetreat
Definition: instance_hyjal.cpp:312
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: hyjal.h:89
Definition: hyjal.h:87
uint32 hordeRetreat
Definition: instance_hyjal.cpp:311
ObjectGuid ElfGate
Definition: instance_hyjal.cpp:309
ObjectGuid HordeGate
Definition: instance_hyjal.cpp:308
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
ObjectGuid const & GetGUID() const
Definition: Object.h:105
GuidList m_uiAncientGemGUID
Definition: instance_hyjal.cpp:299
Definition: hyjal.h:88
uint32 GetEntry() const
Definition: Object.h:107

+ Here is the call graph for this function:

void instance_hyjal::instance_mount_hyjal_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

162  {
163  switch (type)
164  {
166  m_auiEncounter[0] = data;
167  break;
168  case DATA_ANETHERONEVENT:
169  m_auiEncounter[1] = data;
170  break;
171  case DATA_KAZROGALEVENT:
172  m_auiEncounter[2] = data;
173  break;
174  case DATA_AZGALOREVENT:
175  m_auiEncounter[3] = data;
176  if (data == DONE)
177  {
178  instance->LoadGrid(5581.49f, -3445.63f);
179  if (Creature* archimonde = instance->GetCreature(Archimonde))
180  {
181  archimonde->SetVisible(true);
182 
183  if (!ArchiYell)
184  {
185  ArchiYell = true;
186  archimonde->AI()->Talk(YELL_ARCHIMONDE_INTRO);
187  }
188  }
189  }
190  break;
192  m_auiEncounter[4] = data;
193  break;
195  Trash = 0;
196  break;
197  case DATA_TRASH:
198  if (data)
199  Trash = data;
200  else
201  Trash--;
203  break;
204  case TYPE_RETREAT:
205  if (data == SPECIAL)
206  {
207  if (!m_uiAncientGemGUID.empty())
208  {
209  for (GuidList::const_iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr)
210  {
211  //don't know how long it expected
212  DoRespawnGameObject(*itr, DAY);
213  }
214  }
215  }
216  break;
218  allianceRetreat = data;
220  SaveToDB();
221  break;
222  case DATA_HORDE_RETREAT:
223  hordeRetreat = data;
224  HandleGameObject(ElfGate, true);
225  SaveToDB();
226  break;
227  case DATA_RAIDDAMAGE:
228  RaidDamage += data;
229  if (RaidDamage >= MINRAIDDAMAGE)
231  break;
233  RaidDamage = 0;
234  break;
235  }
236 
237  TC_LOG_DEBUG("scripts", "Instance Hyjal: Instance data updated for event %u (Data=%u)", type, data);
238 
239  if (data == DONE)
240  {
242 
243  std::ostringstream saveStream;
244  saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' '
245  << m_auiEncounter[3] << ' ' << m_auiEncounter[4]
246  << ' ' << allianceRetreat << ' ' << hordeRetreat
247  << ' ' << RaidDamage;
248 
249  str_data = saveStream.str();
250 
251  SaveToDB();
253  }
254 
255  }
void DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn=MINUTE)
Definition: InstanceScript.cpp:447
Definition: hyjal.h:43
bool ArchiYell
Definition: instance_hyjal.cpp:314
uint32 allianceRetreat
Definition: instance_hyjal.cpp:312
void LoadGrid(float x, float y)
Definition: Map.cpp:508
ObjectGuid Archimonde
Definition: instance_hyjal.cpp:304
#define OUT_SAVE_INST_DATA
Definition: InstanceScript.h:29
Definition: instance_hyjal.cpp:41
Definition: hyjal.h:38
Definition: inflate.h:49
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Creature.h:467
Definition: hyjal.h:41
uint32 m_auiEncounter[EncounterCount]
Definition: instance_hyjal.cpp:297
uint32 RaidDamage
Definition: instance_hyjal.cpp:313
uint32 Trash
Definition: instance_hyjal.cpp:310
uint32 hordeRetreat
Definition: instance_hyjal.cpp:311
ObjectGuid ElfGate
Definition: instance_hyjal.cpp:309
Definition: hyjal.h:46
std::string str_data
Definition: instance_hyjal.cpp:298
void SaveToDB()
Definition: InstanceScript.cpp:39
Definition: Common.h:99
Definition: hyjal.h:29
ObjectGuid HordeGate
Definition: instance_hyjal.cpp:308
Definition: hyjal.h:45
Map * instance
Definition: InstanceScript.h:148
Definition: InstanceScript.h:62
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
Definition: hyjal.h:33
void DoUpdateWorldState(uint32 worldstateId, uint32 worldstateValue)
Definition: InstanceScript.cpp:473
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
Definition: hyjal.h:36
GuidList m_uiAncientGemGUID
Definition: instance_hyjal.cpp:299
Definition: hyjal.h:31
Definition: hyjal.h:55
Definition: hyjal.h:44
Definition: hyjal.h:42
Definition: hyjal.h:47
#define OUT_SAVE_INST_DATA_COMPLETE
Definition: InstanceScript.h:30
#define MINRAIDDAMAGE
Definition: hyjal.h:94

+ Here is the call graph for this function:

Member Data Documentation

uint32 instance_hyjal::instance_mount_hyjal_InstanceMapScript::allianceRetreat
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::Anetheron
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::Archimonde
protected
bool instance_hyjal::instance_mount_hyjal_InstanceMapScript::ArchiYell
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::Azgalor
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::ElfGate
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::HordeGate
protected
uint32 instance_hyjal::instance_mount_hyjal_InstanceMapScript::hordeRetreat
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::JainaProudmoore
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::Kazrogal
protected
uint32 instance_hyjal::instance_mount_hyjal_InstanceMapScript::m_auiEncounter[EncounterCount]
protected
GuidList instance_hyjal::instance_mount_hyjal_InstanceMapScript::m_uiAncientGemGUID
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::RageWinterchill
protected
uint32 instance_hyjal::instance_mount_hyjal_InstanceMapScript::RaidDamage
protected
std::string instance_hyjal::instance_mount_hyjal_InstanceMapScript::str_data
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::Thrall
protected
uint32 instance_hyjal::instance_mount_hyjal_InstanceMapScript::Trash
protected
ObjectGuid instance_hyjal::instance_mount_hyjal_InstanceMapScript::TyrandeWhisperwind
protected

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