当前位置:首页>>魔兽单机>>正文
另外一种WOW_WOTLK单机中配置是否取消疲劳度的代码
2013-05-01 23:27:17 作者:网络 来源: 浏览次数:0
摘要:WOW单机中设置取消疲劳度的配置
这个是一套可以再Trinity端中配置是否取消角色疲劳度的一个C++代码。 

直接加到Trinity中,。然后你可以通过worldserver.conf配置文件来设置是否开启疲劳设置。。


另外一个代码可以参考这里: MANGOS端单机版疲劳度控制代码

下面是代码


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)



Fatigue Disable禁止疲劳代码下载


相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 资源下载 | 魔兽图片 | 单机文档 | 技术攻略 | 玩家视频
备案号:蜀ICP备2024062380号-1
免责声明:本网站为热爱怀旧WOW的玩家们建立的魔兽世界资料网站,仅供交流和学习使用,非盈利和商用.如有侵权之处,请联系我们,我们会在24小时内确认删除侵权内容,谢谢合作。
Copyright © 2024 - 2024 WOWAII.COM Corporation, All Rights Reserved

机器人国度