From 4b02d01243eeb6b31c57e5220914b9e5e7c7bfe8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Jul 2016 20:49:31 +0300 Subject: Impliment packet SMSG_HOMUNCULUS_EXP 0x0b22. For now it show homunculus exp over player ovner. But probably need show it over homunculus. --- src/being/localplayer.cpp | 13 +++++++++++++ src/being/localplayer.h | 2 ++ src/net/eathena/homunculusrecv.cpp | 9 +++++++++ src/net/eathena/homunculusrecv.h | 1 + src/net/eathena/packetsin.inc | 1 + 5 files changed, 26 insertions(+) (limited to 'src') diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 3ae1cd90b..abecee8de 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1144,6 +1144,19 @@ void LocalPlayer::addXpMessage(const int change) } } +void LocalPlayer::addHomunXpMessage(const int change) +{ + if (change != 0 && mMessages.size() < 20) + { + addMessageToQueue(strprintf("%s %d %s", + // TRANSLATORS: get homunculus xp message + _("Homun"), + change, + // TRANSLATORS: get xp message + _("xp"))); + } +} + void LocalPlayer::addHpMessage(const int change) { if (change != 0 && mMessages.size() < 20) diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 5fa17b7f8..50ef31052 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -376,6 +376,8 @@ class LocalPlayer final : public Being, void addXpMessage(const int change); + void addHomunXpMessage(const int change); + void addJobMessage(const int change); void addHpMessage(const int change); diff --git a/src/net/eathena/homunculusrecv.cpp b/src/net/eathena/homunculusrecv.cpp index 2366b639b..4511d89b1 100644 --- a/src/net/eathena/homunculusrecv.cpp +++ b/src/net/eathena/homunculusrecv.cpp @@ -25,6 +25,7 @@ #include "being/homunculusinfo.h" #include "being/playerinfo.h" +#include "being/localplayer.h" #include "enums/resources/notifytypes.h" @@ -205,4 +206,12 @@ void HomunculusRecv::processHomunculusFood(Net::MessageIn &msg) } } +void HomunculusRecv::processHomunculusExp(Net::MessageIn &msg) +{ + const int exp = msg.readInt32("exp"); + msg.readInt32("unused"); + if (localPlayer) + localPlayer->addHomunXpMessage(exp); +} + } // namespace EAthena diff --git a/src/net/eathena/homunculusrecv.h b/src/net/eathena/homunculusrecv.h index a7b9c4ea6..76ddcf544 100644 --- a/src/net/eathena/homunculusrecv.h +++ b/src/net/eathena/homunculusrecv.h @@ -37,6 +37,7 @@ namespace EAthena void processHomunculusInfo(Net::MessageIn &msg); void processHomunculusSkillUp(Net::MessageIn &msg); void processHomunculusFood(Net::MessageIn &msg); + void processHomunculusExp(Net::MessageIn &msg); } // namespace HomunculusRecv } // namespace EAthena diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 49d5a3e5d..8439ea6c7 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -809,6 +809,7 @@ if (serverVersion > 0) packet(SMSG_PLAYER_ADD_SKILL2, 0x0b1f, -1, &SkillRecv::processSkillAdd2, 0); packet(SMSG_PLAYER_UPDATE_SKILL2, 0x0b20, -1, &SkillRecv::processSkillUpdate2, 0); packet(SMSG_WALK_ERROR, 0x0b21, 10, &PlayerRecv::processWalkError, 0); + packet(SMSG_HOMUNCULUS_EXP, 0x0b22, 10, &HomunculusRecv::processHomunculusExp, 0); // char server packet(SMSG_CHAR_PASSWORD_RESPONSE, 0x0062, 3, &LoginRecv::processCharPasswordResponse, 0); -- cgit v1.2.3-60-g2f50