Главная Форум Файлы
Вы находитесь: Wow-Good.Ru » WoW » Mists of Pandaria




Страница 1 из 11
Модератор форума: Влад 
Форум » TrinityCore » Патчи » Сброс кд перед дуэлью
Сброс кд перед дуэлью
Dispeller Дата: Воскресенье, 26.08.2012, 21:30 | Сообщение # 1
Сержант
Сообщений: 59
Репутация: 1
Награды: 0
Code
diff -r 7619a1afc784 -r 23ce1bcb226b src/server/game/Server/Protocol/Handlers/DuelHandler.cpp      
--- a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp    Mon Apr 25 00:02:18 2011 +0400      
+++ b/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp    Mon Apr 25 00:22:14 2011 +0400      
@@ -51,6 +51,31 @@      
             
           player->SendDuelCountdown(3000);      
           plTarget->SendDuelCountdown(3000);      
+       
+    if (sWorld->getIntConfig(CONFIG_DUEL_RESET_COOLDOWN) == 1)      
+    {      
+  player->SetHealth(player->GetMaxHealth());      
+  plTarget->SetHealth(plTarget->GetMaxHealth());      
+        
+  if (player->getPowerType() == POWER_MANA)       
+   player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA));      
+  if (plTarget->getPowerType() == POWER_MANA)      
+   plTarget->SetPower(POWER_MANA, plTarget->GetMaxPower(POWER_MANA));      
+  if (player->getPowerType() == POWER_RAGE)       
+   player->SetPower(POWER_RAGE, 0);      
+  if (plTarget->getPowerType() == POWER_RAGE)      
+   plTarget->SetPower(POWER_RAGE, 0);      
+  if (player->getPowerType() == POWER_RUNIC_POWER)       
+   player->SetPower(POWER_RUNIC_POWER, 0);      
+  if (plTarget->getPowerType() == POWER_RUNIC_POWER)      
+   plTarget->SetPower(POWER_RUNIC_POWER, 0);      
+        
+  if (!player->GetMap()->IsDungeon())      
+  {      
+   player->RemoveArenaSpellCooldowns();      
+   plTarget->RemoveArenaSpellCooldowns();      
+  }      
+    }      
       }      
             
       void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket)      
diff -r 7619a1afc784 -r 23ce1bcb226b src/server/game/World/World.cpp      
--- a/src/server/game/World/World.cpp    Mon Apr 25 00:02:18 2011 +0400      
+++ b/src/server/game/World/World.cpp    Mon Apr 25 00:22:14 2011 +0400      
@@ -1219,6 +1219,8 @@      
             
           // MySQL ping time interval      
           m_int_configs[CONFIG_DB_PING_INTERVAL] = sConfig->GetIntDefault("MaxPingTime", 30);      
+       
+    m_int_configs[CONFIG_DUEL_RESET_COOLDOWN] = sConfig->GetIntDefault("DuelResetCooldown", 1);      
             
           sScriptMgr->OnConfigLoad(reload);      
       }      
diff -r 7619a1afc784 -r 23ce1bcb226b src/server/game/World/World.h      
--- a/src/server/game/World/World.h    Mon Apr 25 00:02:18 2011 +0400      
+++ b/src/server/game/World/World.h    Mon Apr 25 00:22:14 2011 +0400      
@@ -306,6 +306,7 @@      
           CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION,      
           CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS,      
           CONFIG_MAX_INSTANCES_PER_HOUR,      
+    CONFIG_DUEL_RESET_COOLDOWN,      
           INT_CONFIG_VALUE_COUNT      
       };      
             
diff -r 7619a1afc784 -r 23ce1bcb226b src/server/worldserver/worldserver.conf.dist      
--- a/src/server/worldserver/worldserver.conf.dist    Mon Apr 25 00:02:18 2011 +0400      
+++ b/src/server/worldserver/worldserver.conf.dist    Mon Apr 25 00:22:14 2011 +0400      
@@ -2793,3 +2793,13 @@      
             
       #      
       ###################################################################################################      
+      
+###################################################################################################      
+# OTHER      
+#      
+#    DuelResetCooldown      
+#  Description: Reseting cooldown and restore health to start duel      
+#  Default: 1 - Enable      
+#      
+       
+ DuelResetCooldown = 1

 
Форум » TrinityCore » Патчи » Сброс кд перед дуэлью
Страница 1 из 11
Поиск: