From 9499d44c38597c70f32426497994238d73bf7130 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Thu, 18 Sep 2014 19:11:02 +0300
Subject: eathena: add packet SMSG_PLAYER_SKILL_COOLDOWN_LIST 0x0985.

---
 src/net/eathena/packets.h        |  2 +-
 src/net/eathena/protocol.h       |  1 +
 src/net/eathena/skillhandler.cpp | 18 ++++++++++++++++++
 src/net/eathena/skillhandler.h   |  2 ++
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index f947a91d3..cbbc5ed8c 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -247,7 +247,7 @@ int16_t packet_lengths[] =
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  31,   0,   0,   0,   0,   0,   0,  14,   0,   0,   0,   0,   0, 288,   0,   0,
 // #0x0980
-  0,   0,   0,  29,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+  0,   0,   0,  29,   0,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  31,  -1,  -1,   0,   0,  -1,  -1,   0,   0,  11,   9,   8,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,  12,   0,   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 5db622079..0d3aa1e14 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -81,6 +81,7 @@
 #define SMSG_PLAYER_SKILL_UP         0x010e
 #define SMSG_PLAYER_HEAL             0x013d
 #define SMSG_PLAYER_SKILL_COOLDOWN   0x043d
+#define SMSG_PLAYER_SKILL_COOLDOWN_LIST 0x0985
 #define SMSG_SKILL_FAILED            0x0110
 #define SMSG_SKILL_DAMAGE            0x01de
 #define SMSG_SKILL_AUTO_CAST         0x0147
diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp
index 640b6fbbc..9846a6c2a 100644
--- a/src/net/eathena/skillhandler.cpp
+++ b/src/net/eathena/skillhandler.cpp
@@ -46,6 +46,7 @@ SkillHandler::SkillHandler() :
         SMSG_SKILL_FAILED,
         SMSG_PLAYER_SKILL_UP,
         SMSG_PLAYER_SKILL_COOLDOWN,
+        SMSG_PLAYER_SKILL_COOLDOWN_LIST,
         0
     };
     handledMessages = _messages;
@@ -72,6 +73,10 @@ void SkillHandler::handleMessage(Net::MessageIn &msg)
             processSkillCoolDown(msg);
             break;
 
+        case SMSG_PLAYER_SKILL_COOLDOWN_LIST:
+            processSkillCoolDownList(msg);
+            break;
+
         default:
             break;
     }
@@ -155,4 +160,17 @@ void SkillHandler::processSkillCoolDown(Net::MessageIn &msg)
         skillDialog->setSkillDuration(skillId, duration);
 }
 
+void SkillHandler::processSkillCoolDownList(Net::MessageIn &msg)
+{
+    const int count = (msg.readInt16("len") - 4) / 10;
+    for (int f = 0; f < count; f ++)
+    {
+        const int skillId = msg.readInt16("skill id");
+        msg.readInt32("total");
+        const int duration = msg.readInt32("duration");
+        if (skillDialog)
+            skillDialog->setSkillDuration(skillId, duration);
+    }
+}
+
 }  // namespace EAthena
diff --git a/src/net/eathena/skillhandler.h b/src/net/eathena/skillhandler.h
index 8ea91eb0c..66f96f3eb 100644
--- a/src/net/eathena/skillhandler.h
+++ b/src/net/eathena/skillhandler.h
@@ -55,6 +55,8 @@ class SkillHandler final : public MessageHandler, public Ea::SkillHandler
         void processPlayerSkills(Net::MessageIn &msg);
 
         void processSkillCoolDown(Net::MessageIn &msg);
+
+        void processSkillCoolDownList(Net::MessageIn &msg);
 };
 
 }  // namespace EAthena
-- 
cgit v1.2.3-70-g09d2