summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-19 20:56:49 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-19 20:56:49 +0300
commitdbc90e69531c5ae8fddfcfbd6adeaca0ad144f34 (patch)
tree5df1fb43e4823848afc2ca6434c66ff76ebc0a25
parent0dbfdfcfd3c16e0442ac0c867890cd76a5c5f32a (diff)
downloadmv-dbc90e69531c5ae8fddfcfbd6adeaca0ad144f34.tar.gz
mv-dbc90e69531c5ae8fddfcfbd6adeaca0ad144f34.tar.bz2
mv-dbc90e69531c5ae8fddfcfbd6adeaca0ad144f34.tar.xz
mv-dbc90e69531c5ae8fddfcfbd6adeaca0ad144f34.zip
eathena: add partial support for packet SMSG_MERCENARY_SKILLS 0x029d.
-rw-r--r--src/net/eathena/mercenaryhandler.cpp21
-rw-r--r--src/net/eathena/mercenaryhandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
4 files changed, 25 insertions, 1 deletions
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index 6aa424682..b48a6b39b 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -41,6 +41,7 @@ MercenaryHandler::MercenaryHandler() :
{
SMSG_MERCENARY_UPDATE,
SMSG_MERCENARY_INFO,
+ SMSG_MERCENARY_SKILLS,
0
};
handledMessages = _messages;
@@ -59,6 +60,10 @@ void MercenaryHandler::handleMessage(Net::MessageIn &msg)
processMercenaryInfo(msg);
break;
+ case SMSG_MERCENARY_SKILLS:
+ processMercenarySkills(msg);
+ break;
+
default:
break;
}
@@ -96,4 +101,20 @@ void MercenaryHandler::processMercenaryInfo(Net::MessageIn &msg)
msg.readInt16("attack range");
}
+void MercenaryHandler::processMercenarySkills(Net::MessageIn &msg)
+{
+ // +++ need create if need mercenary being and update stats
+ const int count = (msg.readInt16("len") - 4) / 37;
+ for (int f = 0; f < count; f ++)
+ {
+ msg.readInt16("skill id");
+ msg.readInt32("inf");
+ msg.readInt16("level");
+ msg.readInt16("sp");
+ msg.readInt16("attack range");
+ msg.readString(24, "name");
+ msg.readUInt8("upgradable");
+ }
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/mercenaryhandler.h b/src/net/eathena/mercenaryhandler.h
index 1b3749f01..8a1ea03d9 100644
--- a/src/net/eathena/mercenaryhandler.h
+++ b/src/net/eathena/mercenaryhandler.h
@@ -43,6 +43,8 @@ class MercenaryHandler final : public MessageHandler,
void processMercenaryUpdate(Net::MessageIn &msg);
void processMercenaryInfo(Net::MessageIn &msg);
+
+ void processMercenarySkills(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 75c7bc891..73d6c4dcb 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -94,7 +94,7 @@ int16_t packet_lengths[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// #0x0280
0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0,
+ 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, -1, 0, 0,
0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, -1, -1, 107, 6, -1, 0, 0, 0, 191, 0, 0, 0, 0, 0, 0,
// #0x02C0
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 0f26a5ca9..6708da931 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -250,6 +250,7 @@
#define SMSG_MERCENARY_UPDATE 0x02a2
#define SMSG_MERCENARY_INFO 0x029b
+#define SMSG_MERCENARY_SKILLS 0x029d
/**********************************
* Packets from client to server *