aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.h')
-rw-r--r--src/game/Player.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/game/Player.h b/src/game/Player.h
index 1de6f252791..196c3e6fcfa 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -72,10 +72,11 @@ enum PlayerUnderwaterState
{
UNDERWATER_NONE = 0x00,
UNDERWATER_INWATER = 0x01, // terrain type is water and player is afflicted by it
- UNDERWATER_WATER_TRIGGER = 0x02, // m_breathTimer has been initialized
- UNDERWATER_WATER_BREATHB = 0x04, // breathbar has been send to client
- UNDERWATER_WATER_BREATHB_RETRACTING = 0x10, // breathbar is currently refilling - the player is above water level
- UNDERWATER_INLAVA = 0x80 // terrain type is lava and player is afflicted by it
+ UNDERWATER_INLAVA = 0x02, // terrain type is lava and player is afflicted by it
+ UNDERWATER_INSLIME = 0x04, // terrain type is lava and player is afflicted by it
+ UNDERWARER_INDARKWATER = 0x08, // terrain type is dark water and player is afflicted by it
+
+ UNDERWATER_EXIST_TIMERS = 0x10
};
enum PlayerSpellState
@@ -501,6 +502,8 @@ enum MirrorTimerType
BREATH_TIMER = 1,
FIRE_TIMER = 2
};
+#define MAX_TIMERS 3
+#define DISABLED_MIRROR_TIMER -1
// 2^n values
enum PlayerExtraFlags
@@ -1722,6 +1725,7 @@ class TRINITY_DLL_SPEC Player : public Unit
uint32 DurabilityRepairAll(bool cost, float discountMod, bool guildBank);
uint32 DurabilityRepair(uint16 pos, bool cost, float discountMod, bool guildBank);
+ void UpdateMirrorTimers();
void StopMirrorTimers()
{
StopMirrorTimer(FATIGUE_TIMER);
@@ -2040,7 +2044,6 @@ class TRINITY_DLL_SPEC Player : public Unit
bool IsFlying() const { return HasUnitMovementFlag(MOVEMENTFLAG_FLYING); }
bool IsAllowUseFlyMountsHere() const;
- void HandleDrowning();
void HandleFallUnderMap();
void SetClientControl(Unit* target, uint8 allowMove);
@@ -2268,12 +2271,14 @@ class TRINITY_DLL_SPEC Player : public Unit
/*********************************************************/
/*** ENVIRONMENTAL SYSTEM ***/
/*********************************************************/
- void HandleLava();
void HandleSobering();
- void StartMirrorTimer(MirrorTimerType Type, uint32 MaxValue);
- void ModifyMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, uint32 Regen);
+ void SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, int32 Regen);
void StopMirrorTimer(MirrorTimerType Type);
- uint8 m_isunderwater;
+ void HandleDrowning(uint32 time_diff);
+ int32 getMaxTimer(MirrorTimerType timer);
+ int32 m_MirrorTimer[MAX_TIMERS];
+ uint8 m_MirrorTimerFlags;
+ uint8 m_MirrorTimerFlagsLast;
bool m_isInWater;
/*********************************************************/
@@ -2357,7 +2362,6 @@ class TRINITY_DLL_SPEC Player : public Unit
bool m_DailyQuestChanged;
time_t m_lastDailyQuestTime;
- uint32 m_breathTimer;
uint32 m_drunkTimer;
uint16 m_drunk;
uint32 m_weaponChangeTimer;