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

Public Member Functions

 instance_uldaman_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnGameObjectCreate (GameObject *gameobject) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 data) const override
 
void ReadSaveDataMore (std::istringstream &data) override
 
void WriteSaveDataMore (std::ostringstream &data) override
 
void OnCreatureCreate (Creature *creature) 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 _encounters [MAX_ENCOUNTERS]
 
ObjectGuid archaedasTempleDoorGUID
 
ObjectGuid ancientVaultDoorGUID
 

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 LoadSummonData (ObjectData const *data)
 
void SetSummoner (Creature *creature)
 
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_uldaman_InstanceMapScript()

instance_uldaman::instance_uldaman_InstanceMapScript::instance_uldaman_InstanceMapScript ( Map map)
inline
43: InstanceScript(map) { }
Definition: InstanceScript.h:142

Member Function Documentation

◆ GetData()

uint32 instance_uldaman::instance_uldaman_InstanceMapScript::GetData ( uint32  data) const
inlineoverridevirtual

Reimplemented from ZoneScript.

98 {
99 if (data < MAX_ENCOUNTERS)
100 {
101 return _encounters[data];
102 }
103 return 0;
104 }
@ MAX_ENCOUNTERS
Definition: deadmines.h:30
uint32 _encounters[MAX_ENCOUNTERS]
Definition: instance_uldaman.cpp:132

References _encounters, and MAX_ENCOUNTERS.

◆ Initialize()

void instance_uldaman::instance_uldaman_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

46 {
48 memset(&_encounters, 0, sizeof(_encounters));
49 }
#define DataHeader
Definition: blackrock_depths.h:23
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:141

References _encounters, DataHeader, and InstanceScript::SetHeaders().

◆ OnCreatureCreate()

void instance_uldaman::instance_uldaman_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

121 {
122 switch (creature->GetEntry())
123 {
124 case NPC_STONE_KEEPER:
125 if (_encounters[DATA_STONE_KEEPERS] != DONE && !creature->IsAlive())
126 creature->Respawn();
127 break;
128 }
129 }
@ NPC_STONE_KEEPER
Definition: uldaman.h:42
@ DATA_STONE_KEEPERS
Definition: uldaman.h:26
@ DONE
Definition: InstanceScript.h:60
void Respawn(bool force=false)
Definition: Creature.cpp:2035
uint32 GetEntry() const
Definition: Object.h:115
bool IsAlive() const
Definition: Unit.h:1654

References _encounters, DATA_STONE_KEEPERS, DONE, Object::GetEntry(), Unit::IsAlive(), NPC_STONE_KEEPER, and Creature::Respawn().

◆ OnGameObjectCreate()

void instance_uldaman::instance_uldaman_InstanceMapScript::OnGameObjectCreate ( GameObject gameobject)
inlineoverridevirtual

Reimplemented from InstanceScript.

52 {
53 switch (gameobject->GetEntry())
54 {
56 case GO_KEYSTONE:
58 {
59 HandleGameObject(ObjectGuid::Empty, true, gameobject);
61 }
62 break;
63 case GO_TEMPLE_DOOR:
65 HandleGameObject(ObjectGuid::Empty, true, gameobject);
66 break;
68 ancientVaultDoorGUID = gameobject->GetGUID();
70 HandleGameObject(ObjectGuid::Empty, true, gameobject);
71 break;
73 archaedasTempleDoorGUID = gameobject->GetGUID();
74 break;
75 }
76 }
@ GO_ANCIENT_VAULT_DOOR
Definition: uldaman.h:35
@ GO_ARCHAEDAS_TEMPLE_DOOR
Definition: uldaman.h:33
@ GO_TEMPLE_DOOR
Definition: uldaman.h:34
@ GO_KEYSTONE
Definition: uldaman.h:37
@ GO_IRONAYA_SEAL_DOOR
Definition: uldaman.h:36
@ DATA_IRONAYA_DOORS
Definition: uldaman.h:25
@ DATA_ARCHAEDAS
Definition: uldaman.h:27
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
void SetGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:218
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:113
ObjectGuid archaedasTempleDoorGUID
Definition: instance_uldaman.cpp:133
ObjectGuid ancientVaultDoorGUID
Definition: instance_uldaman.cpp:134

References _encounters, ancientVaultDoorGUID, archaedasTempleDoorGUID, DATA_ARCHAEDAS, DATA_IRONAYA_DOORS, DATA_STONE_KEEPERS, DONE, ObjectGuid::Empty, Object::GetEntry(), Object::GetGUID(), GO_ANCIENT_VAULT_DOOR, GO_ARCHAEDAS_TEMPLE_DOOR, GO_FLAG_NOT_SELECTABLE, GO_IRONAYA_SEAL_DOOR, GO_KEYSTONE, GO_TEMPLE_DOOR, InstanceScript::HandleGameObject(), and GameObject::SetGameObjectFlag().

◆ ReadSaveDataMore()

void instance_uldaman::instance_uldaman_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

◆ SetData()

void instance_uldaman::instance_uldaman_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

79 {
80 switch (type)
81 {
84 _encounters[type] = data;
85 break;
86 case DATA_ARCHAEDAS:
87 _encounters[type] = data;
90 break;
91 }
92
93 if (data == DONE)
94 SaveToDB();
95 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
void SaveToDB()
Definition: InstanceScript.cpp:41

References _encounters, ancientVaultDoorGUID, archaedasTempleDoorGUID, DATA_ARCHAEDAS, DATA_IRONAYA_DOORS, DATA_STONE_KEEPERS, DONE, InstanceScript::HandleGameObject(), IN_PROGRESS, and InstanceScript::SaveToDB().

◆ WriteSaveDataMore()

void instance_uldaman::instance_uldaman_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

114 {
115 data << _encounters[DATA_IRONAYA_DOORS] << ' '
118 }

References _encounters, DATA_ARCHAEDAS, DATA_IRONAYA_DOORS, and DATA_STONE_KEEPERS.

Member Data Documentation

◆ _encounters

uint32 instance_uldaman::instance_uldaman_InstanceMapScript::_encounters[MAX_ENCOUNTERS]
private

◆ ancientVaultDoorGUID

ObjectGuid instance_uldaman::instance_uldaman_InstanceMapScript::ancientVaultDoorGUID
private

Referenced by OnGameObjectCreate(), and SetData().

◆ archaedasTempleDoorGUID

ObjectGuid instance_uldaman::instance_uldaman_InstanceMapScript::archaedasTempleDoorGUID
private

Referenced by OnGameObjectCreate(), and SetData().