aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Instances/InstanceScript.h
diff options
context:
space:
mode:
authorKrudor <erikstrandberg93@hotmail.com>2016-07-16 14:58:33 +0200
committerShauren <shauren.trinity@gmail.com>2016-07-16 14:58:33 +0200
commit649e3a9ac59a1d24eeec3419138d0d5f11dee566 (patch)
tree94834378e61389199ec5e734f34a02097e80d911 /src/server/game/Instances/InstanceScript.h
parente2d6c362f2c80346c464f053ad20b773f9e31863 (diff)
Core/Instances: Add functionality for modifying instance entrance locations
Instances have since MoP (Possibly even Cataclysm) been able to set new locations for players when they zone into the instance. A theoretic example of this could be after a certain boss has been defeated, a new entrance location is set to bring players entering the instance closer to the relevant content. A real example would be Siege of Orgrimmar changing entrance locations many times as the raid progresses. Added SetEntranceLocation for setting entrance locations that will be saved to DB the next time the instance is saved, and SetTemporaryEntranceLocation for when you don't want the value to be saved to the database. Closes #17167
Diffstat (limited to 'src/server/game/Instances/InstanceScript.h')
-rw-r--r--src/server/game/Instances/InstanceScript.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index d858bb6b9c2..eb0579ef63e 100644
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -246,6 +246,15 @@ class TC_GAME_API InstanceScript : public ZoneScript
// Returns completed encounters mask for packets
uint32 GetCompletedEncounterMask() const { return completedEncounters; }
+ // Sets the entrance location (WorldSafeLoc) id
+ void SetEntranceLocation(uint32 worldSafeLocationId);
+
+ // Sets a temporary entrance that does not get saved to db
+ void SetTemporaryEntranceLocation(uint32 worldSafeLocationId) { _temporaryEntranceId = worldSafeLocationId; }
+
+ // Get's the current entrance id
+ uint32 GetEntranceLocation() const { return _temporaryEntranceId ? _temporaryEntranceId : _entranceId; }
+
void SendEncounterUnit(uint32 type, Unit* unit = NULL, uint8 priority = 0);
void SendEncounterStart(uint32 inCombatResCount = 0, uint32 maxInCombatResCount = 0, uint32 inCombatResChargeRecovery = 0, uint32 nextCombatResChargeTime = 0);
void SendEncounterEnd();
@@ -309,6 +318,8 @@ class TC_GAME_API InstanceScript : public ZoneScript
ObjectInfoMap _gameObjectInfo;
ObjectGuidMap _objectGuids;
uint32 completedEncounters; // completed encounter mask, bit indexes are DungeonEncounter.dbc boss numbers, used for packets
+ uint32 _entranceId;
+ uint32 _temporaryEntranceId;
uint32 _combatResurrectionTimer;
uint8 _combatResurrectionCharges; // the counter for available battle resurrections
bool _combatResurrectionTimerStarted;