From 83282c3948f7f2af1e8b0d22d5ab2264c107b268 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Thu, 29 Jun 2006 13:56:36 +0000 Subject: Clients get notified of equipping visible items. --- src/net/beinghandler.cpp | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src/net/beinghandler.cpp') diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index f8e6baef..b4e60b4e 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -106,7 +106,7 @@ void BeingHandler::handleMessage(MessageIn *msg) dstBeing->mJob = job; dstBeing->setHairStyle(msg->readInt16()); dstBeing->setWeapon(msg->readInt16()); - msg->readInt16(); // head option bottom + dstBeing->mVisibleEquipment[3] = msg->readInt16(); // head (bottom) if (msg->getId() == SMSG_BEING_MOVE) { @@ -114,8 +114,8 @@ void BeingHandler::handleMessage(MessageIn *msg) } msg->readInt16(); // shield - msg->readInt16(); // head option top - msg->readInt16(); // head option mid + dstBeing->mVisibleEquipment[4] = msg->readInt16(); // head (top) + dstBeing->mVisibleEquipment[5] = msg->readInt16(); // head (mid) dstBeing->setHairColor(msg->readInt16()); msg->readInt16(); // unknown msg->readInt16(); // head dir @@ -255,19 +255,29 @@ void BeingHandler::handleMessage(MessageIn *msg) { break; } + + int type = msg->readInt8(); - switch (msg->readInt8()) { + switch (type) { case 1: dstBeing->setHairStyle(msg->readInt8()); break; case 2: dstBeing->setWeapon(msg->readInt8()); break; + case 3: + case 4: + case 5: + // Equip/unequip head 3. Bottom 4. Top 5. Bottom + dstBeing->mVisibleEquipment[type] = msg->readInt8(); + // First 3 slots of mVisibleEquipments are reserved for + // later use, probably accessories. + break; case 6: dstBeing->setHairColor(msg->readInt8()); break; default: - msg->readInt8(); // unsupported + printf("c3: %i\n", msg->readInt8()); // unsupported break; } break; @@ -302,20 +312,20 @@ void BeingHandler::handleMessage(MessageIn *msg) dstBeing->setHairStyle(msg->readInt16()); dstBeing->setWeaponById(msg->readInt16()); // item id 1 msg->readInt16(); // item id 2 - msg->readInt16(); // head option bottom + dstBeing->mVisibleEquipment[3] = msg->readInt16(); // head (bottom) if (msg->getId() == SMSG_PLAYER_MOVE) { msg->readInt32(); // server tick } - msg->readInt16(); // head option top - msg->readInt16(); // head option mid + dstBeing->mVisibleEquipment[4] = msg->readInt16(); // head (top) + dstBeing->mVisibleEquipment[5] = msg->readInt16(); // head (mid) dstBeing->setHairColor(msg->readInt16()); msg->readInt16(); // unknown msg->readInt16(); // head dir - msg->readInt32(); // guild - msg->readInt32(); // emblem + msg->readInt32(); // guild + msg->readInt32(); // emblem msg->readInt16(); // manner msg->readInt8(); // karma dstBeing->setSex(1 - msg->readInt8()); // sex @@ -358,6 +368,9 @@ void BeingHandler::handleMessage(MessageIn *msg) case 0x0119: // Change in players look + printf("0x0119 %i %i %i %x %i\n", msg->readInt32(), + msg->readInt16(), msg->readInt16(), msg->readInt16(), + msg->readInt8()); break; } } -- cgit v1.2.3-70-g09d2