diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-27 21:40:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-27 21:40:58 +0300 |
commit | 815a432c34d1901d14745d8c3386d489abdf3339 (patch) | |
tree | 7dd45b9a16a35451771e883b933e8739b91e5697 /src/net/eathena/mercenaryrecv.cpp | |
parent | 4b02d01243eeb6b31c57e5220914b9e5e7c7bfe8 (diff) | |
download | manaplus-815a432c34d1901d14745d8c3386d489abdf3339.tar.gz manaplus-815a432c34d1901d14745d8c3386d489abdf3339.tar.bz2 manaplus-815a432c34d1901d14745d8c3386d489abdf3339.tar.xz manaplus-815a432c34d1901d14745d8c3386d489abdf3339.zip |
Impliment packet SMSG_MERCENARY_UPDATE 0x02a2.
Diffstat (limited to 'src/net/eathena/mercenaryrecv.cpp')
-rw-r--r-- | src/net/eathena/mercenaryrecv.cpp | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/net/eathena/mercenaryrecv.cpp b/src/net/eathena/mercenaryrecv.cpp index 3f338e61a..b00fd0235 100644 --- a/src/net/eathena/mercenaryrecv.cpp +++ b/src/net/eathena/mercenaryrecv.cpp @@ -33,17 +33,45 @@ #include "net/messagein.h" +#include "net/eathena/sp.h" + +#include "utils/checkutils.h" + #include "debug.h" namespace EAthena { +#define setMercStat(sp, stat) \ + case sp: \ + PlayerInfo::setStatBase(stat, \ + val); \ + break; + void MercenaryRecv::processMercenaryUpdate(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - // +++ need create if need mercenary being and update stats - msg.readInt16("type"); - msg.readInt32("value"); + const int sp = msg.readInt16("type"); + const int val = msg.readInt32("value"); + switch (sp) + { + setMercStat(Sp::ATK1, Attributes::MERC_ATK); + setMercStat(Sp::MATK1, Attributes::MERC_MATK); + setMercStat(Sp::HIT, Attributes::MERC_HIT); + setMercStat(Sp::CRITICAL, Attributes::MERC_CRIT); + setMercStat(Sp::DEF1, Attributes::MERC_DEF); + setMercStat(Sp::MDEF1, Attributes::MERC_MDEF); + setMercStat(Sp::MERCFLEE, Attributes::MERC_FLEE); + setMercStat(Sp::ASPD, Attributes::MERC_ATTACK_DELAY); + setMercStat(Sp::HP, Attributes::MERC_HP); + setMercStat(Sp::MAXHP, Attributes::MERC_MAX_HP); + setMercStat(Sp::SP, Attributes::MERC_MP); + setMercStat(Sp::MAXSP, Attributes::MERC_MAX_MP); + setMercStat(Sp::MERCKILLS, Attributes::MERC_KILLS); + setMercStat(Sp::MERCFAITH, Attributes::MERC_FAITH); + default: + reportAlways("Unknown mercenary stat %d", + sp); + } } void MercenaryRecv::processMercenaryInfo(Net::MessageIn &msg) |