AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript Struct Reference
Inheritance diagram for instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript:
InstanceScript ZoneScript

Public Member Functions

 instance_temple_of_ahnqiraj_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnUnitDeath (Unit *unit) override
 
uint32 GetData (uint32 type) const override
 
void SetData (uint32 type, uint32 data) override
 
bool SetBossState (uint32 type, EncounterState state) override
 
- Public Member Functions inherited from InstanceScript
 InstanceScript (Map *map)
 
 ~InstanceScript () override
 
virtual void Initialize ()
 
virtual void Load (char const *data)
 
virtual void CreatureLooted (Creature *, LootType)
 
virtual std::string GetSaveData ()
 
void SaveToDB ()
 
virtual void Update (uint32)
 
virtual bool IsEncounterInProgress () const
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
ObjectGuid GetObjectGuid (uint32 type) const
 
ObjectGuid GetGuidData (uint32 type) const override
 
CreatureGetCreature (uint32 type)
 
GameObjectGetGameObject (uint32 type)
 
virtual void OnPlayerEnter (Player *)
 
virtual void OnPlayerAreaUpdate (Player *, uint32, uint32)
 
virtual void OnPlayerInWaterStateUpdate (Player *, bool)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
void DoRespawnCreature (ObjectGuid guid, bool force=false)
 
void DoRespawnCreature (uint32 type, bool force=false)
 
void DoUpdateWorldState (uint32 worldstateId, uint32 worldstateValue)
 
void DoSendNotifyToInstance (char const *format,...)
 
void DoUpdateAchievementCriteria (AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
 
void DoStartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoStopTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoRemoveAurasDueToSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayer (Player *player, uint32 spell, bool includePets, bool includeControlled)
 
bool ServerAllowsTwoSideGroups ()
 
virtual bool SetBossState (uint32 id, EncounterState state)
 
EncounterState GetBossState (uint32 id) const
 
CreatureBoundary const * GetBossBoundary (uint32 id) const
 
BossInfo const * GetBossInfo (uint32 id) const
 
uint32 GetPersistentData (uint32 index) const
 
void StorePersistentData (uint32 index, uint32 data)
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=nullptr, uint32=0)
 
virtual bool CheckRequiredBosses (uint32, Player const *=nullptr) const
 
void SetCompletedEncountersMask (uint32 newMask, bool save)
 
uint32 GetCompletedEncounterMask () const
 
void SendEncounterUnit (uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
 
virtual void FillInitialWorldStates (WorldPacket &)
 
uint32 GetEncounterCount () const
 
void MarkAreaTriggerDone (uint32 id)
 
void ResetAreaTriggerDone (uint32 id)
 
bool IsAreaTriggerDone (uint32 id) const
 
virtual void DoAction (int32)
 
void DoForAllMinions (uint32 id, std::function< void(Creature *)> exec)
 
void StoreGameObjectState (ObjectGuid::LowType spawnId, uint8 state)
 
uint8 GetStoredGameObjectState (ObjectGuid::LowType spawnId) const
 
void LoadInstanceSavedGameobjectStateData ()
 
bool IsBossDone (uint32 bossId) const
 
bool AllBossesDone () const
 
bool AllBossesDone (std::initializer_list< uint32 > bossIds) 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 OnCreatureCreate (Creature *)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnGameObjectCreate (GameObject *)
 
virtual void OnGameObjectRemove (GameObject *)
 
virtual void OnUnitDeath (Unit *)
 
virtual void OnCreatureEvade (Creature *)
 
virtual ObjectGuid GetGuidData (uint32) const
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Private Attributes

GuidVector CThunGraspGUIDs
 
uint32 BugTrioDeathCount
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
TaskScheduler scheduler
 
- Protected Member Functions inherited from InstanceScript
void SetHeaders (std::string const &dataHeaders)
 
void SetBossNumber (uint32 number)
 
void SetPersistentDataCount (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=true)
 
void RemoveObject (Creature *obj)
 
void AddObject (GameObject *obj, bool add=true)
 
void RemoveObject (GameObject *obj)
 
void AddObject (WorldObject *obj, uint32 type, bool add=true)
 
void RemoveObject (WorldObject *obj, uint32 type)
 
void AddDoor (GameObject *door, bool add=true)
 
void RemoveDoor (GameObject *door)
 
void AddMinion (Creature *minion, bool add=true)
 
void RemoveMinion (Creature *minion)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
bool ReadSaveDataHeaders (std::istringstream &data)
 
void ReadSaveDataBossStates (std::istringstream &data)
 
void ReadSavePersistentData (std::istringstream &data)
 
virtual void ReadSaveDataMore (std::istringstream &)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
void WritePersistentData (std::ostringstream &data)
 
virtual void WriteSaveDataMore (std::ostringstream &)
 

Detailed Description

Constructor & Destructor Documentation

◆ instance_temple_of_ahnqiraj_InstanceMapScript()

instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::instance_temple_of_ahnqiraj_InstanceMapScript ( Map map)
inline
62 : InstanceScript(map)
63 {
68 }
#define DataHeader
Definition: blackrock_depths.h:23
ObjectData const creatureData[]
Definition: instance_temple_of_ahnqiraj.cpp:25
DoorData const doorData[]
Definition: instance_temple_of_ahnqiraj.cpp:42
@ MAX_BOSS_NUMBER
Definition: temple_of_ahnqiraj.h:38
Definition: InstanceScript.h:142
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:285
void LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:161
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Definition: InstanceScript.cpp:173

References creatureData, DataHeader, doorData, InstanceScript::LoadDoorData(), InstanceScript::LoadObjectData(), MAX_BOSS_NUMBER, InstanceScript::SetBossNumber(), and InstanceScript::SetHeaders().

Member Function Documentation

◆ GetData()

uint32 instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

168 {
169 switch (type)
170 {
172 return BugTrioDeathCount;
173 }
174 return 0;
175 }
@ DATA_BUG_TRIO_DEATH
Definition: temple_of_ahnqiraj.h:43
uint32 BugTrioDeathCount
Definition: instance_temple_of_ahnqiraj.cpp:215

References DATA_BUG_TRIO_DEATH.

◆ Initialize()

void instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

71 {
73 }

References BugTrioDeathCount.

◆ OnCreatureCreate()

void instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

76 {
77 switch (creature->GetEntry())
78 {
81 creature->Respawn();
82 break;
83 case NPC_MASTERS_EYE:
85 creature->Respawn(true);
86 break;
87 case NPC_CTHUN:
88 if (!creature->IsAlive())
89 {
90 for (ObjectGuid const& guid : CThunGraspGUIDs)
91 {
92 if (GameObject* cthunGrasp = instance->GetGameObject(guid))
93 {
94 cthunGrasp->DespawnOrUnsummon(1s);
95 }
96 }
97 }
98 break;
99 default:
100 break;
101 }
102
104 }
@ DONE
Definition: InstanceScript.h:60
@ NPC_CTHUN
Definition: temple_of_ahnqiraj.h:54
@ NPC_OURO_SPAWNER
Definition: temple_of_ahnqiraj.h:77
@ NPC_MASTERS_EYE
Definition: temple_of_ahnqiraj.h:53
@ DATA_TWIN_EMPERORS
Definition: temple_of_ahnqiraj.h:34
@ DATA_OURO
Definition: temple_of_ahnqiraj.h:35
void Respawn(bool force=false)
Definition: Creature.cpp:2030
Definition: GameObject.h:121
uint32 GetEntry() const
Definition: Object.h:112
Definition: ObjectGuid.h:118
bool IsAlive() const
Definition: Unit.h:1204
void OnCreatureCreate(Creature *creature) override
Definition: InstanceScript.cpp:58
Map * instance
Definition: InstanceScript.h:148
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319
GuidVector CThunGraspGUIDs
Definition: instance_temple_of_ahnqiraj.cpp:214

References CThunGraspGUIDs, DATA_OURO, DATA_TWIN_EMPERORS, DONE, InstanceScript::GetBossState(), Object::GetEntry(), Map::GetGameObject(), InstanceScript::instance, Unit::IsAlive(), NPC_CTHUN, NPC_MASTERS_EYE, NPC_OURO_SPAWNER, InstanceScript::OnCreatureCreate(), and Creature::Respawn().

◆ OnGameObjectCreate()

void instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

107 {
108 switch (go->GetEntry())
109 {
110 case GO_CTHUN_GRASP:
111 CThunGraspGUIDs.push_back(go->GetGUID());
112 if (Creature* CThun = GetCreature(DATA_CTHUN))
113 {
114 if (!CThun->IsAlive())
115 {
116 go->DespawnOrUnsummon(1s);
117 }
118 }
119 break;
120 default:
121 break;
122 }
123
125 }
@ GO_CTHUN_GRASP
Definition: temple_of_ahnqiraj.h:89
@ DATA_CTHUN
Definition: temple_of_ahnqiraj.h:36
Definition: Creature.h:46
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:933
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
Creature * GetCreature(uint32 type)
Definition: InstanceScript.cpp:100
void OnGameObjectCreate(GameObject *go) override
Definition: InstanceScript.cpp:70

References CThunGraspGUIDs, DATA_CTHUN, GameObject::DespawnOrUnsummon(), InstanceScript::GetCreature(), Object::GetEntry(), Object::GetGUID(), GO_CTHUN_GRASP, and InstanceScript::OnGameObjectCreate().

◆ OnUnitDeath()

void instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::OnUnitDeath ( Unit unit)
inlineoverridevirtual

Reimplemented from ZoneScript.

128 {
129 switch (unit->GetEntry())
130 {
133 if (Creature* creature = unit->ToCreature())
134 {
135 if (CreatureGroup* formation = creature->GetFormation())
136 {
137 scheduler.Schedule(100ms, [formation](TaskContext /*context*/)
138 {
139 if (!formation->IsAnyMemberAlive(true))
140 {
141 if (Creature* leader = formation->GetLeader())
142 {
143 if (leader->IsAlive())
144 {
145 leader->AI()->SetData(0, 1);
146 }
147 }
148 }
149 });
150 }
151 }
152 break;
153 case NPC_CTHUN:
154 for (ObjectGuid const& guid : CThunGraspGUIDs)
155 {
156 if (GameObject* cthunGrasp = instance->GetGameObject(guid))
157 {
158 cthunGrasp->DespawnOrUnsummon(1s);
159 }
160 }
161 break;
162 default:
163 break;
164 }
165 }
@ NPC_QIRAJI_MINDSLAYER
Definition: temple_of_ahnqiraj.h:81
@ NPC_QIRAJI_SLAYER
Definition: temple_of_ahnqiraj.h:80
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:229
Definition: TaskScheduler.h:415
Definition: CreatureGroups.h:89
Creature * ToCreature()
Definition: Object.h:202
TaskScheduler scheduler
Definition: InstanceScript.h:282

References CThunGraspGUIDs, Object::GetEntry(), Map::GetGameObject(), InstanceScript::instance, NPC_CTHUN, NPC_QIRAJI_MINDSLAYER, NPC_QIRAJI_SLAYER, TaskScheduler::Schedule(), InstanceScript::scheduler, and Object::ToCreature().

◆ SetBossState()

bool instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::SetBossState ( uint32  type,
EncounterState  state 
)
inlineoverridevirtual

Reimplemented from InstanceScript.

193 {
194 if (!InstanceScript::SetBossState(type, state))
195 return false;
196
197 switch (type)
198 {
199 case DATA_OURO:
200 if (state == FAIL)
201 {
202 if (Creature* ouroSpawner = GetCreature(DATA_OURO_SPAWNER))
203 ouroSpawner->Respawn();
204 }
205 break;
206 default:
207 break;
208 }
209
210 return true;
211 }
@ FAIL
Definition: InstanceScript.h:59
@ DATA_OURO_SPAWNER
Definition: temple_of_ahnqiraj.h:44
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351

References DATA_OURO, DATA_OURO_SPAWNER, FAIL, and InstanceScript::SetBossState().

◆ SetData()

void instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

178 {
179 switch (type)
180 {
182 if (data != 0)
184 else
186 break;
187 default:
188 break;
189 }
190 }

References DATA_BUG_TRIO_DEATH.

Member Data Documentation

◆ BugTrioDeathCount

uint32 instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::BugTrioDeathCount
private

Referenced by Initialize().

◆ CThunGraspGUIDs

GuidVector instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::CThunGraspGUIDs
private