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

Public Member Functions

 instance_sunken_temple_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnCreatureCreate (Creature *creature) override
 
void OnUnitDeath (Unit *unit) override
 
void OnGameObjectCreate (GameObject *gameobject) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 type) const override
 
void Update (uint32 diff) override
 
void ReadSaveDataMore (std::istringstream &data) override
 
void WriteSaveDataMore (std::ostringstream &data) 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

uint32 _statuePhase
 
uint32 _defendersKilled
 
uint32 _encounters [MAX_ENCOUNTERS]
 
ObjectGuid _forcefieldGUID
 
ObjectGuid _jammalanGUID
 
ObjectGuid _shadeOfEranikusGUID
 
GuidList _dragonkinList
 
EventMap _events
 

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_sunken_temple_InstanceMapScript()

instance_sunken_temple::instance_sunken_temple_InstanceMapScript::instance_sunken_temple_InstanceMapScript ( Map map)
inline
36 : InstanceScript(map)
37 {
39 }
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138

References DataHeader, and InstanceScript::SetHeaders().

Member Function Documentation

◆ GetData()

uint32 instance_sunken_temple::instance_sunken_temple_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

145 {
146 switch (type)
147 {
148 case DATA_STATUES:
149 return _statuePhase;
151 return _defendersKilled;
153 case TYPE_JAMMAL_AN:
155 return _encounters[type];
156 }
157
158 return 0;
159 }
@ TYPE_JAMMAL_AN
Definition: sunken_temple.h:32
@ TYPE_HAKKAR_EVENT
Definition: sunken_temple.h:33
@ DATA_DEFENDER_KILLED
Definition: sunken_temple.h:26
@ TYPE_ATAL_ALARION
Definition: sunken_temple.h:31
@ DATA_STATUES
Definition: sunken_temple.h:25
uint32 _encounters[MAX_ENCOUNTERS]
Definition: instance_sunken_temple.cpp:195
uint32 _statuePhase
Definition: instance_sunken_temple.cpp:193
uint32 _defendersKilled
Definition: instance_sunken_temple.cpp:194

References _defendersKilled, _encounters, _statuePhase, DATA_DEFENDER_KILLED, DATA_STATUES, TYPE_ATAL_ALARION, TYPE_HAKKAR_EVENT, and TYPE_JAMMAL_AN.

◆ Initialize()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

42 {
43 _statuePhase = 0;
45 memset(&_encounters, 0, sizeof(_encounters));
46 }

References _defendersKilled, _encounters, and _statuePhase.

◆ OnCreatureCreate()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

49 {
50 switch (creature->GetEntry())
51 {
53 _jammalanGUID = creature->GetGUID();
54 break;
56 _shadeOfEranikusGUID = creature->GetGUID();
58 break;
59 }
60
61 if (creature->IsAlive() && creature->GetSpawnId() && creature->GetCreatureType() == CREATURE_TYPE_DRAGONKIN && creature->GetEntry() != NPC_SHADE_OF_ERANIKUS)
62 _dragonkinList.push_back(creature->GetGUID());
63 }
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
@ NPC_SHADE_OF_ERANIKUS
Definition: sunken_temple.h:55
@ NPC_JAMMAL_AN_THE_PROPHET
Definition: sunken_temple.h:54
@ CREATURE_TYPE_DRAGONKIN
Definition: SharedDefines.h:2629
ObjectGuid::LowType GetSpawnId() const
Definition: Creature.h:68
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
bool IsAlive() const
Definition: Unit.h:1204
uint32 GetCreatureType() const
Definition: Unit.cpp:15137
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
ObjectGuid _shadeOfEranikusGUID
Definition: instance_sunken_temple.cpp:199
GuidList _dragonkinList
Definition: instance_sunken_temple.cpp:200
ObjectGuid _jammalanGUID
Definition: instance_sunken_temple.cpp:198

References _dragonkinList, _jammalanGUID, _shadeOfEranikusGUID, CREATURE_TYPE_DRAGONKIN, Unit::GetCreatureType(), Object::GetEntry(), Object::GetGUID(), Creature::GetSpawnId(), Unit::IsAlive(), NPC_JAMMAL_AN_THE_PROPHET, NPC_SHADE_OF_ERANIKUS, Unit::SetUnitFlag(), and UNIT_FLAG_NOT_SELECTABLE.

◆ OnGameObjectCreate()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::OnGameObjectCreate ( GameObject gameobject)
inlineoverridevirtual

Reimplemented from InstanceScript.

78 {
79 switch (gameobject->GetEntry())
80 {
87 if (gameobject->GetEntry() < GO_ATALAI_STATUE1 + _statuePhase)
88 {
89 instance->SummonGameObject(GO_ATALAI_LIGHT2, gameobject->GetPositionX(), gameobject->GetPositionY(), gameobject->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
91 }
92 break;
93 case GO_ATALAI_IDOL:
95 gameobject->SummonGameObject(GO_IDOL_OF_HAKKAR, -480.08f, 94.29f, -189.72f, 1.571f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
96 break;
100 break;
101 case GO_FORCEFIELD:
102 _forcefieldGUID = gameobject->GetGUID();
104 gameobject->SetGoState(GO_STATE_ACTIVE);
105 }
106 }
@ DONE
Definition: InstanceScript.h:60
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ DEFENDERS_COUNT
Definition: sunken_temple.h:29
@ MAX_STATUE_PHASE
Definition: sunken_temple.h:28
@ GO_ATALAI_IDOL
Definition: sunken_temple.h:45
@ GO_ATALAI_STATUE6
Definition: sunken_temple.h:44
@ GO_IDOL_OF_HAKKAR
Definition: sunken_temple.h:46
@ GO_ATALAI_STATUE5
Definition: sunken_temple.h:43
@ GO_ATALAI_STATUE4
Definition: sunken_temple.h:42
@ GO_ATALAI_STATUE2
Definition: sunken_temple.h:40
@ GO_ATALAI_STATUE3
Definition: sunken_temple.h:41
@ GO_ATALAI_LIGHT2
Definition: sunken_temple.h:47
@ GO_FORCEFIELD
Definition: sunken_temple.h:48
@ GO_ATALAI_STATUE1
Definition: sunken_temple.h:39
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
void SetGoState(GOState state)
Definition: GameObject.cpp:2477
void RemoveGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:220
void ReplaceAllGameObjectFlags(GameObjectFlags flags)
Definition: GameObject.h:221
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2369
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
Map * instance
Definition: InstanceScript.h:148
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true)
Definition: Object.cpp:2302
ObjectGuid _forcefieldGUID
Definition: instance_sunken_temple.cpp:197

References _defendersKilled, _encounters, _forcefieldGUID, _statuePhase, DEFENDERS_COUNT, DONE, Object::GetEntry(), Object::GetGUID(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_ATALAI_IDOL, GO_ATALAI_LIGHT2, GO_ATALAI_STATUE1, GO_ATALAI_STATUE2, GO_ATALAI_STATUE3, GO_ATALAI_STATUE4, GO_ATALAI_STATUE5, GO_ATALAI_STATUE6, GO_FLAG_NOT_SELECTABLE, GO_FORCEFIELD, GO_IDOL_OF_HAKKAR, GO_STATE_ACTIVE, InstanceScript::instance, MAX_STATUE_PHASE, GameObject::RemoveGameObjectFlag(), GameObject::ReplaceAllGameObjectFlags(), GameObject::SetGoState(), Map::SummonGameObject(), WorldObject::SummonGameObject(), and TYPE_ATAL_ALARION.

◆ OnUnitDeath()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::OnUnitDeath ( Unit unit)
inlineoverridevirtual

Reimplemented from ZoneScript.

66 {
68 _dragonkinList.remove(unit->GetGUID());
70 {
72 cr->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
73 }
74
75 }
Definition: Creature.h:46
bool IsCreature() const
Definition: Object.h:201
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314

References _dragonkinList, _shadeOfEranikusGUID, CREATURE_TYPE_DRAGONKIN, Map::GetCreature(), Unit::GetCreatureType(), Object::GetEntry(), Object::GetGUID(), InstanceScript::instance, Object::IsCreature(), NPC_JAMMAL_AN_THE_PROPHET, NPC_SHADE_OF_ERANIKUS, and UNIT_FLAG_NOT_SELECTABLE.

◆ ReadSaveDataMore()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

175 {
176 data >> _encounters[0];
177 data >> _encounters[1];
178 data >> _encounters[2];
179 data >> _statuePhase;
180 data >> _defendersKilled;
181 }

References _defendersKilled, _encounters, and _statuePhase.

◆ SetData()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

109 {
110 switch (type)
111 {
112 case DATA_STATUES:
114 break;
118 {
119 instance->LoadGrid(-425.89f, -86.07f);
121 jammal->AI()->Talk(0);
123 forcefield->SetGoState(GO_STATE_ACTIVE);
124 }
125 break;
127 for (ObjectGuid const& guid : _dragonkinList)
128 {
129 if (Creature* creature = instance->GetCreature(guid))
130 if (instance->IsGridLoaded(creature->GetPositionX(), creature->GetPositionY()))
131 creature->SetInCombatWithZone();
132 }
133 break;
135 case TYPE_JAMMAL_AN:
137 _encounters[type] = data;
138 break;
139 }
140
141 SaveToDB();
142 }
@ DATA_ERANIKUS_FIGHT
Definition: sunken_temple.h:27
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
Definition: GameObject.h:121
Definition: ObjectGuid.h:118
void SaveToDB()
Definition: InstanceScript.cpp:41
void LoadGrid(float x, float y)
Definition: Map.cpp:492
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319
bool IsGridLoaded(float x, float y) const
Definition: Map.h:369
EventMap _events
Definition: instance_sunken_temple.cpp:201

References _defendersKilled, _dragonkinList, _encounters, _events, _forcefieldGUID, _jammalanGUID, DATA_DEFENDER_KILLED, DATA_ERANIKUS_FIGHT, DATA_STATUES, DEFENDERS_COUNT, Map::GetCreature(), Map::GetGameObject(), GO_STATE_ACTIVE, InstanceScript::instance, Map::IsGridLoaded(), Map::LoadGrid(), InstanceScript::SaveToDB(), EventMap::ScheduleEvent(), TYPE_ATAL_ALARION, TYPE_HAKKAR_EVENT, and TYPE_JAMMAL_AN.

◆ Update()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

162 {
163 _events.Update(diff);
164 switch (_events.ExecuteEvent())
165 {
166 case DATA_STATUES:
167 ++_statuePhase;
169 instance->SummonGameObject(GO_IDOL_OF_HAKKAR, -480.08f, 94.29f, -189.72f, 1.571f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
170 break;
171 }
172 }
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54

References _events, _statuePhase, DATA_STATUES, EventMap::ExecuteEvent(), GO_IDOL_OF_HAKKAR, InstanceScript::instance, MAX_STATUE_PHASE, Map::SummonGameObject(), and EventMap::Update().

◆ WriteSaveDataMore()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

184 {
185 data << _encounters[0] << ' '
186 << _encounters[1] << ' '
187 << _encounters[2] << ' '
188 << _statuePhase << ' '
190 }

References _defendersKilled, _encounters, and _statuePhase.

Member Data Documentation

◆ _defendersKilled

uint32 instance_sunken_temple::instance_sunken_temple_InstanceMapScript::_defendersKilled
private

◆ _dragonkinList

GuidList instance_sunken_temple::instance_sunken_temple_InstanceMapScript::_dragonkinList
private

◆ _encounters

uint32 instance_sunken_temple::instance_sunken_temple_InstanceMapScript::_encounters[MAX_ENCOUNTERS]
private

◆ _events

EventMap instance_sunken_temple::instance_sunken_temple_InstanceMapScript::_events
private

Referenced by SetData(), and Update().

◆ _forcefieldGUID

ObjectGuid instance_sunken_temple::instance_sunken_temple_InstanceMapScript::_forcefieldGUID
private

Referenced by OnGameObjectCreate(), and SetData().

◆ _jammalanGUID

ObjectGuid instance_sunken_temple::instance_sunken_temple_InstanceMapScript::_jammalanGUID
private

Referenced by OnCreatureCreate(), and SetData().

◆ _shadeOfEranikusGUID

ObjectGuid instance_sunken_temple::instance_sunken_temple_InstanceMapScript::_shadeOfEranikusGUID
private

Referenced by OnCreatureCreate(), and OnUnitDeath().

◆ _statuePhase

uint32 instance_sunken_temple::instance_sunken_temple_InstanceMapScript::_statuePhase
private