AzeorthCore 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
 
std::string GetSaveData () override
 
void Load (const char *in) 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)
 
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)
 
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
 
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)
 
- 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
 
- Protected Member Functions inherited from InstanceScript
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)
 
void AddDoor (GameObject *door, bool add)
 
void AddMinion (Creature *minion, bool add)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
std::string LoadBossState (char const *data)
 
std::string GetBossSaveData ()
 

Detailed Description

Constructor & Destructor Documentation

◆ instance_sunken_temple_InstanceMapScript()

instance_sunken_temple::instance_sunken_temple_InstanceMapScript::instance_sunken_temple_InstanceMapScript ( Map map)
inline
34 : InstanceScript(map)
35 {
36 }
Definition: InstanceScript.h:140

Member Function Documentation

◆ GetData()

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

Reimplemented from ZoneScript.

142 {
143 switch (type)
144 {
145 case DATA_STATUES:
146 return _statuePhase;
148 return _defendersKilled;
150 case TYPE_JAMMAL_AN:
152 return _encounters[type];
153 }
154
155 return 0;
156 }
@ TYPE_JAMMAL_AN
Definition: sunken_temple.h:30
@ TYPE_HAKKAR_EVENT
Definition: sunken_temple.h:31
@ DATA_DEFENDER_KILLED
Definition: sunken_temple.h:24
@ TYPE_ATAL_ALARION
Definition: sunken_temple.h:29
@ DATA_STATUES
Definition: sunken_temple.h:23
uint32 _encounters[MAX_ENCOUNTERS]
Definition: instance_sunken_temple.cpp:203
uint32 _statuePhase
Definition: instance_sunken_temple.cpp:201
uint32 _defendersKilled
Definition: instance_sunken_temple.cpp:202

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

◆ GetSaveData()

std::string instance_sunken_temple::instance_sunken_temple_InstanceMapScript::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

172 {
173 std::ostringstream saveStream;
174 saveStream << "T A " << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2] << ' ' << _statuePhase << ' ' << _defendersKilled;
175 return saveStream.str();
176 }

References _defendersKilled, _encounters, and _statuePhase.

◆ Initialize()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

39 {
40 _statuePhase = 0;
42 memset(&_encounters, 0, sizeof(_encounters));
43 }

References _defendersKilled, _encounters, and _statuePhase.

◆ Load()

void instance_sunken_temple::instance_sunken_temple_InstanceMapScript::Load ( const char *  in)
inlineoverridevirtual

Reimplemented from InstanceScript.

179 {
180 if (!in)
181 return;
182
183 char dataHead1, dataHead2;
184 std::istringstream loadStream(in);
185 loadStream >> dataHead1 >> dataHead2;
186 if (dataHead1 == 'T' && dataHead2 == 'A')
187 {
188 for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
189 {
190 loadStream >> _encounters[i];
191 if (_encounters[i] == IN_PROGRESS)
193 }
194
195 loadStream >> _statuePhase;
196 loadStream >> _defendersKilled;
197 }
198 }
std::uint8_t uint8
Definition: Define.h:110
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ NOT_STARTED
Definition: InstanceScript.h:56
@ MAX_ENCOUNTERS
Definition: deadmines.h:29

References _defendersKilled, _encounters, _statuePhase, IN_PROGRESS, MAX_ENCOUNTERS, and NOT_STARTED.

◆ OnCreatureCreate()

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

Reimplemented from InstanceScript.

46 {
47 switch (creature->GetEntry())
48 {
50 _jammalanGUID = creature->GetGUID();
51 break;
53 _shadeOfEranikusGUID = creature->GetGUID();
55 break;
56 }
57
58 if (creature->IsAlive() && creature->GetSpawnId() && creature->GetCreatureType() == CREATURE_TYPE_DRAGONKIN && creature->GetEntry() != NPC_SHADE_OF_ERANIKUS)
59 _dragonkinList.push_back(creature->GetGUID());
60 }
@ UNIT_FLAG_NOT_SELECTABLE
Definition: Unit.h:473
@ NPC_SHADE_OF_ERANIKUS
Definition: sunken_temple.h:53
@ NPC_JAMMAL_AN_THE_PROPHET
Definition: sunken_temple.h:52
@ CREATURE_TYPE_DRAGONKIN
Definition: SharedDefines.h:2601
ObjectGuid::LowType GetSpawnId() const
Definition: Creature.h:66
uint32 GetEntry() const
Definition: Object.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
bool IsAlive() const
Definition: Unit.h:2024
uint32 GetCreatureType() const
Definition: Unit.cpp:15895
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1479
ObjectGuid _shadeOfEranikusGUID
Definition: instance_sunken_temple.cpp:207
GuidList _dragonkinList
Definition: instance_sunken_temple.cpp:208
ObjectGuid _jammalanGUID
Definition: instance_sunken_temple.cpp:206

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.

75 {
76 switch (gameobject->GetEntry())
77 {
84 if (gameobject->GetEntry() < GO_ATALAI_STATUE1 + _statuePhase)
85 {
86 instance->SummonGameObject(GO_ATALAI_LIGHT2, gameobject->GetPositionX(), gameobject->GetPositionY(), gameobject->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
88 }
89 break;
90 case GO_ATALAI_IDOL:
92 gameobject->SummonGameObject(GO_IDOL_OF_HAKKAR, -480.08f, 94.29f, -189.72f, 1.571f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
93 break;
97 break;
98 case GO_FORCEFIELD:
99 _forcefieldGUID = gameobject->GetGUID();
101 gameobject->SetGoState(GO_STATE_ACTIVE);
102 }
103 }
@ GO_STATE_ACTIVE
Definition: GameObject.h:734
@ DONE
Definition: InstanceScript.h:59
@ DEFENDERS_COUNT
Definition: sunken_temple.h:27
@ MAX_STATUE_PHASE
Definition: sunken_temple.h:26
@ GO_ATALAI_IDOL
Definition: sunken_temple.h:43
@ GO_ATALAI_STATUE6
Definition: sunken_temple.h:42
@ GO_IDOL_OF_HAKKAR
Definition: sunken_temple.h:44
@ GO_ATALAI_STATUE5
Definition: sunken_temple.h:41
@ GO_ATALAI_STATUE4
Definition: sunken_temple.h:40
@ GO_ATALAI_STATUE2
Definition: sunken_temple.h:38
@ GO_ATALAI_STATUE3
Definition: sunken_temple.h:39
@ GO_ATALAI_LIGHT2
Definition: sunken_temple.h:45
@ GO_FORCEFIELD
Definition: sunken_temple.h:46
@ GO_ATALAI_STATUE1
Definition: sunken_temple.h:37
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1579
void SetGoState(GOState state)
Definition: GameObject.cpp:2441
void RemoveGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:912
void ReplaceAllGameObjectFlags(GameObjectFlags flags)
Definition: GameObject.h:913
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:2317
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:146
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:2250
ObjectGuid _forcefieldGUID
Definition: instance_sunken_temple.cpp:205

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.

63 {
65 _dragonkinList.remove(unit->GetGUID());
67 {
69 cr->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
70 }
71
72 }
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
Definition: Creature.h:46
TypeID GetTypeId() const
Definition: Object.h:121
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3290

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

◆ SetData()

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

Reimplemented from ZoneScript.

106 {
107 switch (type)
108 {
109 case DATA_STATUES:
111 break;
115 {
116 instance->LoadGrid(-425.89f, -86.07f);
118 jammal->AI()->Talk(0);
120 forcefield->SetGoState(GO_STATE_ACTIVE);
121 }
122 break;
124 for (ObjectGuid const& guid : _dragonkinList)
125 {
126 if (Creature* creature = instance->GetCreature(guid))
127 if (instance->IsGridLoaded(creature->GetPositionX(), creature->GetPositionY()))
128 creature->SetInCombatWithZone();
129 }
130 break;
132 case TYPE_JAMMAL_AN:
134 _encounters[type] = data;
135 break;
136 }
137
138 SaveToDB();
139 }
@ DATA_ERANIKUS_FIGHT
Definition: sunken_temple.h:25
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
Definition: GameObject.h:813
Definition: ObjectGuid.h:120
void SaveToDB()
Definition: InstanceScript.cpp:40
void LoadGrid(float x, float y)
Definition: Map.cpp:494
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3295
bool IsGridLoaded(float x, float y) const
Definition: Map.h:368
EventMap _events
Definition: instance_sunken_temple.cpp:209

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.

159 {
160 _events.Update(diff);
161 switch (_events.ExecuteEvent())
162 {
163 case DATA_STATUES:
164 ++_statuePhase;
166 instance->SummonGameObject(GO_IDOL_OF_HAKKAR, -480.08f, 94.29f, -189.72f, 1.571f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
167 break;
168 }
169 }
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().

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