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

Public Member Functions

 instance_ahnkahet_InstanceScript (Map *map)
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 type) const override
 
void SetGuidData (uint32 type, ObjectGuid data) override
 
ObjectGuid GetGuidData (uint32 type) const override
 
bool SetBossState (uint32 type, EncounterState state) override
 
void WriteSaveDataMore (std::ostringstream &data) override
 
void ReadSaveDataMore (std::istringstream &data) 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 void Update (uint32)
 
virtual bool IsEncounterInProgress () const
 
virtual void OnCreatureRemove (Creature *creature) 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 ()
 
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 uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Protected Attributes

ObjectGuid ElderNadoxGUID
 
ObjectGuid PrinceTaldaramGUID
 
ObjectGuid JedogaShadowseekerGUID
 
ObjectGuid AmanitarGUID
 
ObjectGuid HeraldVolazjGUID
 
ObjectGuid PrinceTaldaramPlatformGUID
 
ObjectGuid JedogaSacrifices
 
ObjectGuid JedogaTarget
 
GuidSet InitiandGUIDs
 
uint32 SpheresState [2]
 
uint8 SwitchTrigger
 

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_ahnkahet::instance_ahnkahet_InstanceScript::instance_ahnkahet_InstanceScript ( Map map)
inline
36  : InstanceScript(map)
37  {
41 
42  SwitchTrigger = 0;
43 
44  SpheresState[0] = 0;
45  SpheresState[1] = 0;
46  }
uint32 const EncounterCount
Definition: baradin_hold.h:28
DoorData const doorData[]
Definition: instance_ahnkahet.cpp:23
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:258
uint32 SpheresState[2]
Definition: instance_ahnkahet.cpp:273
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 LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:124
uint8 SwitchTrigger
Definition: instance_ahnkahet.cpp:274

+ Here is the call graph for this function:

Member Function Documentation

uint32 instance_ahnkahet::instance_ahnkahet_InstanceScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

150  {
151  switch (type)
152  {
153  case DATA_SPHERE_1:
154  case DATA_SPHERE_2:
155  return SpheresState[type - DATA_SPHERE_1];
157  for (ObjectGuid guid : InitiandGUIDs)
158  {
159  Creature* cr = instance->GetCreature(guid);
160  if (!cr || cr->IsAlive())
161  return 0;
162  }
163  return 1;
165  return SwitchTrigger;
166  default:
167  break;
168  }
169  return 0;
170  }
Definition: ahnkahet.h:42
Definition: ahnkahet.h:36
uint32 SpheresState[2]
Definition: instance_ahnkahet.cpp:273
Definition: Creature.h:467
bool IsAlive() const
Definition: Unit.h:1692
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
Definition: ahnkahet.h:37
Definition: ahnkahet.h:44
Definition: ObjectGuid.h:189
GuidSet InitiandGUIDs
Definition: instance_ahnkahet.cpp:271
uint8 SwitchTrigger
Definition: instance_ahnkahet.cpp:274

+ Here is the call graph for this function:

ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::GetGuidData ( uint32  type) const
inlineoverridevirtual

Reimplemented from InstanceScript.

188  {
189  switch (type)
190  {
191  case DATA_ELDER_NADOX:
192  return ElderNadoxGUID;
194  return PrinceTaldaramGUID;
196  return JedogaShadowseekerGUID;
197  case DATA_AMANITAR:
198  return AmanitarGUID;
199  case DATA_HERALD_VOLAZJ:
200  return HeraldVolazjGUID;
204  {
205  GuidVector vInitiands;
206  vInitiands.reserve(InitiandGUIDs.size());
207  for (ObjectGuid guid : InitiandGUIDs)
208  {
209  Creature* cr = instance->GetCreature(guid);
210  if (cr && cr->IsAlive())
211  vInitiands.push_back(guid);
212  }
213  if (vInitiands.empty())
214  return ObjectGuid::Empty;
215 
217  }
219  return JedogaSacrifices;
221  return JedogaTarget;
222  default:
223  break;
224  }
225  return ObjectGuid::Empty;
226  }
Definition: ahnkahet.h:32
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
C::value_type const & SelectRandomContainerElement(C const &container)
Definition: Containers.h:68
ObjectGuid JedogaShadowseekerGUID
Definition: instance_ahnkahet.cpp:263
ObjectGuid HeraldVolazjGUID
Definition: instance_ahnkahet.cpp:265
Definition: Creature.h:467
Definition: ahnkahet.h:29
std::vector< ObjectGuid > GuidVector
Definition: ObjectGuid.h:335
ObjectGuid JedogaTarget
Definition: instance_ahnkahet.cpp:269
Definition: ahnkahet.h:33
Definition: ahnkahet.h:41
ObjectGuid AmanitarGUID
Definition: instance_ahnkahet.cpp:264
Definition: ahnkahet.h:39
Definition: ahnkahet.h:40
Definition: ahnkahet.h:38
Definition: ahnkahet.h:30
ObjectGuid PrinceTaldaramPlatformGUID
Definition: instance_ahnkahet.cpp:267
bool IsAlive() const
Definition: Unit.h:1692
Map * instance
Definition: InstanceScript.h:148
ObjectGuid JedogaSacrifices
Definition: instance_ahnkahet.cpp:268
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
ObjectGuid ElderNadoxGUID
Definition: instance_ahnkahet.cpp:261
Definition: ahnkahet.h:31
Definition: ObjectGuid.h:189
GuidSet InitiandGUIDs
Definition: instance_ahnkahet.cpp:271
ObjectGuid PrinceTaldaramGUID
Definition: instance_ahnkahet.cpp:262

+ Here is the call graph for this function:

void instance_ahnkahet::instance_ahnkahet_InstanceScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

49  {
50  switch (creature->GetEntry())
51  {
52  case NPC_ELDER_NADOX:
53  ElderNadoxGUID = creature->GetGUID();
54  break;
56  PrinceTaldaramGUID = creature->GetGUID();
57  break;
59  JedogaShadowseekerGUID = creature->GetGUID();
60  break;
61  case NPC_AMANITAR:
62  AmanitarGUID = creature->GetGUID();
63  break;
64  case NPC_HERALD_VOLAZJ:
65  HeraldVolazjGUID = creature->GetGUID();
66  break;
67  case NPC_INITIAND:
68  InitiandGUIDs.insert(creature->GetGUID());
69  break;
70  default:
71  break;
72  }
73  }
Definition: ahnkahet.h:53
Definition: ahnkahet.h:60
ObjectGuid JedogaShadowseekerGUID
Definition: instance_ahnkahet.cpp:263
ObjectGuid HeraldVolazjGUID
Definition: instance_ahnkahet.cpp:265
ObjectGuid AmanitarGUID
Definition: instance_ahnkahet.cpp:264
Definition: ahnkahet.h:52
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ahnkahet.h:51
ObjectGuid ElderNadoxGUID
Definition: instance_ahnkahet.cpp:261
Definition: ahnkahet.h:50
uint32 GetEntry() const
Definition: Object.h:107
GuidSet InitiandGUIDs
Definition: instance_ahnkahet.cpp:271
ObjectGuid PrinceTaldaramGUID
Definition: instance_ahnkahet.cpp:262
Definition: ahnkahet.h:49

+ Here is the call graph for this function:

void instance_ahnkahet::instance_ahnkahet_InstanceScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

76  {
77  switch (go->GetEntry())
78  {
83  break;
84  case GO_SPHERE_1:
85  if (SpheresState[0])
86  {
89  }
90  else
92  break;
93  case GO_SPHERE_2:
94  if (SpheresState[1])
95  {
98  }
99  else
101  break;
103  AddDoor(go, true);
104  break;
105  default:
106  break;
107  }
108  }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: SharedDefines.h:2125
uint32 SpheresState[2]
Definition: instance_ahnkahet.cpp:273
Definition: inflate.h:49
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: ahnkahet.h:80
Definition: ahnkahet.h:79
Definition: ahnkahet.h:30
ObjectGuid PrinceTaldaramPlatformGUID
Definition: instance_ahnkahet.cpp:267
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
Definition: ahnkahet.h:78
Definition: UpdateFields.h:319
Definition: GameObject.h:822
void SetGoState(GOState state)
Definition: GameObject.cpp:2137
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ahnkahet.h:77
uint32 GetEntry() const
Definition: Object.h:107
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227
virtual void AddDoor(GameObject *door, bool add)
Definition: InstanceScript.cpp:239

+ Here is the call graph for this function:

void instance_ahnkahet::instance_ahnkahet_InstanceScript::OnGameObjectRemove ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

111  {
112  switch (go->GetEntry())
113  {
115  AddDoor(go, false);
116  break;
117  default:
118  break;
119  }
120  }
Definition: ahnkahet.h:77
uint32 GetEntry() const
Definition: Object.h:107
virtual void AddDoor(GameObject *door, bool add)
Definition: InstanceScript.cpp:239

+ Here is the call graph for this function:

void instance_ahnkahet::instance_ahnkahet_InstanceScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

255  {
256  data >> SpheresState[0];
257  data >> SpheresState[1];
258  }
uint32 SpheresState[2]
Definition: instance_ahnkahet.cpp:273
bool instance_ahnkahet::instance_ahnkahet_InstanceScript::SetBossState ( uint32  type,
EncounterState  state 
)
inlineoverridevirtual

Reimplemented from InstanceScript.

229  {
230  if (!InstanceScript::SetBossState(type, state))
231  return false;
232 
233  switch (type)
234  {
236  if (state == DONE)
237  {
238  for (ObjectGuid guid : InitiandGUIDs)
239  if (Creature* cr = instance->GetCreature(guid))
240  cr->DespawnOrUnsummon();
241  }
242  break;
243  default:
244  break;
245  }
246  return true;
247  }
Definition: inflate.h:49
Definition: Creature.h:467
Map * instance
Definition: InstanceScript.h:148
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
Definition: ahnkahet.h:31
Definition: ObjectGuid.h:189
GuidSet InitiandGUIDs
Definition: instance_ahnkahet.cpp:271

+ Here is the call graph for this function:

void instance_ahnkahet::instance_ahnkahet_InstanceScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

123  {
124  switch (type)
125  {
126  case DATA_SPHERE_1:
127  case DATA_SPHERE_2:
128  SpheresState[type - DATA_SPHERE_1] = data;
129  break;
131  SwitchTrigger = data;
132  break;
134  for (ObjectGuid guid : InitiandGUIDs)
135  {
136  if (Creature* creature = instance->GetCreature(guid))
137  {
138  creature->Respawn();
139  if (!creature->IsInEvadeMode())
140  creature->AI()->EnterEvadeMode();
141  }
142  }
143  break;
144  default:
145  break;
146  }
147  }
Definition: ahnkahet.h:42
Definition: ahnkahet.h:36
uint32 SpheresState[2]
Definition: instance_ahnkahet.cpp:273
Definition: Creature.h:467
Map * instance
Definition: InstanceScript.h:148
Definition: ahnkahet.h:43
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
Definition: ahnkahet.h:37
Definition: ObjectGuid.h:189
GuidSet InitiandGUIDs
Definition: instance_ahnkahet.cpp:271
uint8 SwitchTrigger
Definition: instance_ahnkahet.cpp:274

+ Here is the call graph for this function:

void instance_ahnkahet::instance_ahnkahet_InstanceScript::SetGuidData ( uint32  type,
ObjectGuid  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

173  {
174  switch (type)
175  {
177  JedogaSacrifices = data;
178  break;
180  JedogaTarget = data;
181  break;
182  default:
183  break;
184  }
185  }
ObjectGuid JedogaTarget
Definition: instance_ahnkahet.cpp:269
Definition: ahnkahet.h:39
Definition: ahnkahet.h:40
ObjectGuid JedogaSacrifices
Definition: instance_ahnkahet.cpp:268
void instance_ahnkahet::instance_ahnkahet_InstanceScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

250  {
251  data << SpheresState[0] << ' ' << SpheresState[1];
252  }
uint32 SpheresState[2]
Definition: instance_ahnkahet.cpp:273

Member Data Documentation

ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::AmanitarGUID
protected
ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::ElderNadoxGUID
protected
ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::HeraldVolazjGUID
protected
GuidSet instance_ahnkahet::instance_ahnkahet_InstanceScript::InitiandGUIDs
protected
ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::JedogaSacrifices
protected
ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::JedogaShadowseekerGUID
protected
ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::JedogaTarget
protected
ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::PrinceTaldaramGUID
protected
ObjectGuid instance_ahnkahet::instance_ahnkahet_InstanceScript::PrinceTaldaramPlatformGUID
protected
uint32 instance_ahnkahet::instance_ahnkahet_InstanceScript::SpheresState[2]
protected
uint8 instance_ahnkahet::instance_ahnkahet_InstanceScript::SwitchTrigger
protected

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