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

Public Member Functions

 instance_deadmines_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnGameObjectCreate (GameObject *gameobject) override
 
void SetData (uint32 type, uint32 data) 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)
 
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]
 

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

instance_deadmines::instance_deadmines_InstanceMapScript::instance_deadmines_InstanceMapScript ( Map map)
inline
29 : InstanceScript(map)
30 {
32 }
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:141

References DataHeader, and InstanceScript::SetHeaders().

Member Function Documentation

◆ GetSaveData()

std::string instance_deadmines::instance_deadmines_InstanceMapScript::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

82 {
83 std::ostringstream saveStream;
84 saveStream << "D E " << _encounters[0] << ' ' << _encounters[1];
85 return saveStream.str();
86 }
uint32 _encounters[MAX_ENCOUNTERS]
Definition: instance_deadmines.cpp:108

References _encounters.

◆ Initialize()

void instance_deadmines::instance_deadmines_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

35 {
36 memset(&_encounters, 0, sizeof(_encounters));
37 }

References _encounters.

◆ Load()

void instance_deadmines::instance_deadmines_InstanceMapScript::Load ( const char *  in)
inlineoverridevirtual

Reimplemented from InstanceScript.

89 {
90 if (!in)
91 return;
92
93 char dataHead1, dataHead2;
94 std::istringstream loadStream(in);
95 loadStream >> dataHead1 >> dataHead2;
96 if (dataHead1 == 'D' && dataHead2 == 'E')
97 {
98 for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
99 {
100 loadStream >> _encounters[i];
101 if (_encounters[i] == IN_PROGRESS)
103 }
104 }
105 }
std::uint8_t uint8
Definition: Define.h:109
@ MAX_ENCOUNTERS
Definition: deadmines.h:30
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ NOT_STARTED
Definition: InstanceScript.h:57

References _encounters, IN_PROGRESS, MAX_ENCOUNTERS, and NOT_STARTED.

◆ OnGameObjectCreate()

void instance_deadmines::instance_deadmines_InstanceMapScript::OnGameObjectCreate ( GameObject gameobject)
inlineoverridevirtual

Reimplemented from InstanceScript.

40 {
41 switch (gameobject->GetEntry())
42 {
43 case GO_HEAVY_DOOR_1:
44 case GO_HEAVY_DOOR_2:
45 case GO_DOOR_LEVER_1:
46 case GO_DOOR_LEVER_2:
47 case GO_DOOR_LEVER_3:
48 case GO_CANNON:
49 gameobject->AllowSaveToDB(true);
50 break;
51 case GO_FACTORY_DOOR:
52 gameobject->AllowSaveToDB(true);
53 // GoState (Door opened) is restored during GO creation, but we need to set LootState to prevent Lever from closing it again
55 gameobject->SetLootState(GO_ACTIVATED);
56 break;
58 gameobject->AllowSaveToDB(true);
60 {
61 gameobject->DespawnOrUnsummon();
62 }
63 break;
64 }
65 }
@ GO_IRON_CLAD_DOOR
Definition: deadmines.h:38
@ GO_FACTORY_DOOR
Definition: deadmines.h:35
@ GO_DOOR_LEVER_2
Definition: deadmines.h:40
@ GO_DOOR_LEVER_3
Definition: deadmines.h:41
@ GO_HEAVY_DOOR_1
Definition: deadmines.h:36
@ GO_CANNON
Definition: deadmines.h:42
@ GO_DOOR_LEVER_1
Definition: deadmines.h:39
@ GO_HEAVY_DOOR_2
Definition: deadmines.h:37
@ TYPE_RHAHK_ZOR
Definition: deadmines.h:28
@ DONE
Definition: InstanceScript.h:60
@ GO_ACTIVATED
Definition: GameObject.h:112
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
void SetLootState(LootState s, Unit *unit=nullptr)
Definition: GameObject.cpp:2444
ObjectGuid::LowType GetSpawnId() const
Definition: GameObject.h:144
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:935
void AllowSaveToDB(bool enable)
Definition: GameObject.h:361
uint32 GetEntry() const
Definition: Object.h:115
uint8 GetStoredGameObjectState(ObjectGuid::LowType spawnId) const
Definition: InstanceScript.cpp:830

References _encounters, GameObject::AllowSaveToDB(), GameObject::DespawnOrUnsummon(), DONE, Object::GetEntry(), GameObject::GetSpawnId(), InstanceScript::GetStoredGameObjectState(), GO_ACTIVATED, GO_CANNON, GO_DOOR_LEVER_1, GO_DOOR_LEVER_2, GO_DOOR_LEVER_3, GO_FACTORY_DOOR, GO_HEAVY_DOOR_1, GO_HEAVY_DOOR_2, GO_IRON_CLAD_DOOR, GO_STATE_ACTIVE, GameObject::SetLootState(), and TYPE_RHAHK_ZOR.

◆ SetData()

void instance_deadmines::instance_deadmines_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

68 {
69 switch (type)
70 {
71 case TYPE_RHAHK_ZOR:
72 case TYPE_CANNON:
73 _encounters[type] = data;
74 break;
75 }
76
77 if (data == DONE)
78 SaveToDB();
79 }
@ TYPE_CANNON
Definition: deadmines.h:29
void SaveToDB()
Definition: InstanceScript.cpp:41

References _encounters, DONE, InstanceScript::SaveToDB(), TYPE_CANNON, and TYPE_RHAHK_ZOR.

Member Data Documentation

◆ _encounters

uint32 instance_deadmines::instance_deadmines_InstanceMapScript::_encounters[MAX_ENCOUNTERS]
private