Created
October 20, 2013 06:50
-
-
Save anonymous/7065771 to your computer and use it in GitHub Desktop.
PATCH Fatigue Disable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entiti | |
index e12e5ee..b9e7b6d 100644 | |
--- a/src/server/game/Entities/Player/Player.cpp | |
+++ b/src/server/game/Entities/Player/Player.cpp | |
@@ -78,6 +78,7 @@ | |
#include "World.h" | |
#include "WorldPacket.h" | |
#include "WorldSession.h" | |
+#include "Config.h" | |
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS) | |
@@ -1312,9 +1313,12 @@ int32 Player::getMaxTimer(MirrorTimerType timer) | |
{ | |
switch (timer) | |
{ | |
- case FATIGUE_TIMER: | |
- return MINUTE * IN_MILLISECONDS; | |
- case BREATH_TIMER: | |
+ if(ConfigMgr::GetBoolDefault("fatigue.enabled", true)) // If "fatigue.en | |
+ { | |
+ case FATIGUE_TIMER: | |
+ return MINUTE * IN_MILLISECONDS; | |
+ } | |
+ case BREATH_TIMER: | |
{ | |
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSes | |
return DISABLED_MIRROR_TIMER; | |
@@ -1396,6 +1400,9 @@ void Player::HandleDrowning(uint32 time_diff) | |
} | |
// In dark water | |
+ if(ConfigMgr::GetBoolDefault("fatigue.enabled", true)) // If "fatigue.en | |
+ { | |
+ | |
if (m_MirrorTimerFlags & UNDERWARER_INDARKWATER) | |
{ | |
// Fatigue timer not activated - activate it | |
@@ -1432,7 +1439,7 @@ void Player::HandleDrowning(uint32 time_diff) | |
else if (m_MirrorTimerFlagsLast & UNDERWARER_INDARKWATER) | |
SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE | |
} | |
- | |
+ } | |
if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !( | |
{ | |
// Breath timer not activated - activate it | |
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserv | |
index bf19240..b81fcbd 100644 | |
--- a/src/server/worldserver/worldserver.conf.dist | |
+++ b/src/server/worldserver/worldserver.conf.dist | |
@@ -825,6 +825,13 @@ RecruitAFriend.MaxDifference = 4 | |
DisableWaterBreath = 4 | |
# | |
+# Enable or Disable "Fatigue" timer | |
+# default = 1 (enabled) | |
+# = 0 (disabled) | |
+ | |
+fatigue.enabled = 1 | |
+ | |
+# | |
# AllFlightPaths | |
# Description: Character knows all flight paths (of both factions) after | |
# Default: 0 - (Disabled) | |
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entiti | |
index e12e5ee..b9e7b6d 100644 | |
--- a/src/server/game/Entities/Player/Player.cpp | |
+++ b/src/server/game/Entities/Player/Player.cpp | |
@@ -78,6 +78,7 @@ | |
#include "World.h" | |
#include "WorldPacket.h" | |
#include "WorldSession.h" | |
+#include "Config.h" | |
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS) | |
@@ -1312,9 +1313,12 @@ int32 Player::getMaxTimer(MirrorTimerType timer) | |
{ | |
switch (timer) | |
{ | |
- case FATIGUE_TIMER: | |
- return MINUTE * IN_MILLISECONDS; | |
- case BREATH_TIMER: | |
+ if(ConfigMgr::GetBoolDefault("fatigue.enabled", true)) // If "fatigue.en | |
+ { | |
+ case FATIGUE_TIMER: | |
+ return MINUTE * IN_MILLISECONDS; | |
+ } | |
+ case BREATH_TIMER: | |
{ | |
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSes | |
return DISABLED_MIRROR_TIMER; | |
@@ -1396,6 +1400,9 @@ void Player::HandleDrowning(uint32 time_diff) | |
} | |
// In dark water | |
+ if(ConfigMgr::GetBoolDefault("fatigue.enabled", true)) // If "fatigue.en | |
+ { | |
+ | |
if (m_MirrorTimerFlags & UNDERWARER_INDARKWATER) | |
{ | |
// Fatigue timer not activated - activate it | |
@@ -1432,7 +1439,7 @@ void Player::HandleDrowning(uint32 time_diff) | |
else if (m_MirrorTimerFlagsLast & UNDERWARER_INDARKWATER) | |
SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE | |
} | |
- | |
+ } | |
if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !( | |
{ | |
// Breath timer not activated - activate it | |
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserv | |
index bf19240..b81fcbd 100644 | |
--- a/src/server/worldserver/worldserver.conf.dist | |
+++ b/src/server/worldserver/worldserver.conf.dist | |
@@ -825,6 +825,13 @@ RecruitAFriend.MaxDifference = 4 | |
DisableWaterBreath = 4 | |
# | |
+# Enable or Disable "Fatigue" timer | |
+# default = 1 (enabled) | |
+# = 0 (disabled) | |
+ | |
+fatigue.enabled = 1 | |
+ | |
+# | |
# AllFlightPaths | |
# Description: Character knows all flight paths (of both factions) after | |
# Default: 0 - (Disabled) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment