diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-02 00:18:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:55 +0300 |
commit | 4f19173e1c6f606cbbbc7785ab270ab70dff1df0 (patch) | |
tree | 80f5f674050df83a3bd5e0c172ae614a9196c8f6 /src/net | |
parent | 65d1d4810e79d15e436208dccd865d93c237e5a9 (diff) | |
download | plus-4f19173e1c6f606cbbbc7785ab270ab70dff1df0.tar.gz plus-4f19173e1c6f606cbbbc7785ab270ab70dff1df0.tar.bz2 plus-4f19173e1c6f606cbbbc7785ab270ab70dff1df0.tar.xz plus-4f19173e1c6f606cbbbc7785ab270ab70dff1df0.zip |
eathena: fix handling packet SMSG_PLAYER_STAT_UPDATE_5 0x00bd.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 87 |
1 files changed, 47 insertions, 40 deletions
diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 1a3a18d8a..5a7a1bada 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -246,74 +246,81 @@ void PlayerHandler::processPlayerShowEquip(Net::MessageIn &msg) void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg) { BLOCK_START("PlayerHandler::processPlayerStatUpdate5") - PlayerInfo::setAttribute(Attributes::CHAR_POINTS, msg.readInt16()); + PlayerInfo::setAttribute(Attributes::CHAR_POINTS, + msg.readInt16("char points")); - unsigned int val = msg.readUInt8(); - PlayerInfo::setStatBase(STR, val); + unsigned int val = msg.readUInt8("str"); + PlayerInfo::setStatBase(EA_STR, val); if (statusWindow) - statusWindow->setPointsNeeded(STR, msg.readUInt8()); + statusWindow->setPointsNeeded(EA_STR, msg.readUInt8("str cost")); else - msg.readUInt8(); + msg.readUInt8("str need"); - val = msg.readUInt8(); - PlayerInfo::setStatBase(AGI, val); + val = msg.readUInt8("agi"); + PlayerInfo::setStatBase(EA_AGI, val); if (statusWindow) - statusWindow->setPointsNeeded(AGI, msg.readUInt8()); + statusWindow->setPointsNeeded(EA_AGI, msg.readUInt8("agi cost")); else - msg.readUInt8(); + msg.readUInt8("agi cost"); - val = msg.readUInt8(); - PlayerInfo::setStatBase(VIT, val); + val = msg.readUInt8("vit"); + PlayerInfo::setStatBase(EA_VIT, val); if (statusWindow) - statusWindow->setPointsNeeded(VIT, msg.readUInt8()); + statusWindow->setPointsNeeded(EA_VIT, msg.readUInt8("vit cost")); else - msg.readUInt8(); + msg.readUInt8("vit cost"); - val = msg.readUInt8(); - PlayerInfo::setStatBase(INT, val); + val = msg.readUInt8("int"); + PlayerInfo::setStatBase(EA_INT, val); if (statusWindow) - statusWindow->setPointsNeeded(INT, msg.readUInt8()); + statusWindow->setPointsNeeded(EA_INT, msg.readUInt8("int cost")); else - msg.readUInt8(); + msg.readUInt8("int cost"); - val = msg.readUInt8(); - PlayerInfo::setStatBase(DEX, val); + val = msg.readUInt8("dex"); + PlayerInfo::setStatBase(EA_DEX, val); if (statusWindow) - statusWindow->setPointsNeeded(DEX, msg.readUInt8()); + statusWindow->setPointsNeeded(EA_DEX, msg.readUInt8("dex cost")); else - msg.readUInt8(); + msg.readUInt8("dex cost"); - val = msg.readUInt8(); - PlayerInfo::setStatBase(LUK, val); + val = msg.readUInt8("luk"); + PlayerInfo::setStatBase(EA_LUK, val); if (statusWindow) - statusWindow->setPointsNeeded(LUK, msg.readUInt8()); + statusWindow->setPointsNeeded(EA_LUK, msg.readUInt8("luk cost")); else - msg.readUInt8(); + msg.readUInt8("luk cost"); - PlayerInfo::setStatBase(ATK, msg.readInt16(), false); - PlayerInfo::setStatMod(ATK, msg.readInt16()); + PlayerInfo::setStatBase(EA_ATK, msg.readInt16("left atk"), false); + PlayerInfo::setStatMod(EA_ATK, msg.readInt16("right atk")); PlayerInfo::updateAttrs(); - val = msg.readInt16(); - PlayerInfo::setStatBase(MATK, val, false); + val = msg.readInt16("right matk"); + PlayerInfo::setStatBase(EA_MATK, val, false); - val = msg.readInt16(); - PlayerInfo::setStatMod(MATK, val); + val = msg.readInt16("left matk"); + PlayerInfo::setStatMod(EA_MATK, val); - PlayerInfo::setStatBase(DEF, msg.readInt16(), false); - PlayerInfo::setStatMod(DEF, msg.readInt16()); + PlayerInfo::setStatBase(EA_DEF, msg.readInt16("left def"), false); + PlayerInfo::setStatMod(EA_DEF, msg.readInt16("right def")); - PlayerInfo::setStatBase(MDEF, msg.readInt16(), false); - PlayerInfo::setStatMod(MDEF, msg.readInt16()); + PlayerInfo::setStatBase(EA_MDEF, msg.readInt16("left mdef"), false); + PlayerInfo::setStatMod(EA_MDEF, msg.readInt16("right mdef")); - PlayerInfo::setStatBase(HIT, msg.readInt16()); + PlayerInfo::setStatBase(EA_HIT, msg.readInt16("hit")); - PlayerInfo::setStatBase(FLEE, msg.readInt16(), false); - PlayerInfo::setStatMod(FLEE, msg.readInt16()); + PlayerInfo::setStatBase(EA_FLEE, msg.readInt16("flee"), false); + PlayerInfo::setStatMod(EA_FLEE, msg.readInt16("flee2/10")); - PlayerInfo::setStatBase(CRIT, msg.readInt16()); + PlayerInfo::setStatBase(EA_CRIT, msg.readInt16("crit/10")); + + const int speed = msg.readInt16("speed"); + localPlayer->setWalkSpeed(Vector(static_cast<float>(speed), + static_cast<float>(speed), 0)); + PlayerInfo::setStatBase(Attributes::WALK_SPEED, speed); + PlayerInfo::setStatMod(Attributes::WALK_SPEED, + msg.readInt16("plus speed = 0")); - msg.readInt16(); // manner BLOCK_END("PlayerHandler::processPlayerStatUpdate5") } |