From 84aafd27dad40f4033561052164c21fe68cf78ad Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Wed, 11 Jul 2007 12:58:11 +0000 Subject: Weapon sprites are now (almost) threated like other equipment sprites through the equipment sprite database. (use -u to ignore updates) --- src/net/beinghandler.cpp | 17 ++++++++--------- src/net/charserverhandler.cpp | 2 +- src/net/equipmenthandler.cpp | 9 +++++---- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/net') diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index fc202b36..3bec6369 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -107,7 +107,7 @@ void BeingHandler::handleMessage(MessageIn *msg) dstBeing->setWalkSpeed(speed); dstBeing->mJob = job; dstBeing->setHairStyle(msg->readInt16()); - dstBeing->setWeapon(msg->readInt16()); + dstBeing->setVisibleEquipment(Being::WEAPON_SPRITE, msg->readInt16() * 10000); dstBeing->setVisibleEquipment( Being::BOTTOMCLOTHES_SPRITE, msg->readInt16()); @@ -257,22 +257,20 @@ void BeingHandler::handleMessage(MessageIn *msg) dstBeing->setHairStyle(id); break; case 2: - dstBeing->setWeapon(id); + dstBeing->setVisibleEquipment( + Being::WEAPON_SPRITE, id * 10000); break; case 3: // Change lower headgear for eAthena, pants for us dstBeing->setVisibleEquipment( - Being::BOTTOMCLOTHES_SPRITE, - id); + Being::BOTTOMCLOTHES_SPRITE, id); break; case 4: // Change upper headgear for eAthena, hat for us dstBeing->setVisibleEquipment( - Being::HAT_SPRITE, - id); + Being::HAT_SPRITE, id); break; case 5: // Change middle headgear for eathena, armor for us dstBeing->setVisibleEquipment( - Being::TOPCLOTHES_SPRITE, - id); + Being::TOPCLOTHES_SPRITE, id); break; case 6: dstBeing->setHairColor(id); @@ -312,7 +310,8 @@ void BeingHandler::handleMessage(MessageIn *msg) dstBeing->setWalkSpeed(speed); dstBeing->mJob = job; dstBeing->setHairStyle(msg->readInt16()); - dstBeing->setWeaponById(msg->readInt16()); // item id 1 + dstBeing->setVisibleEquipment( + Being::WEAPON_SPRITE, msg->readInt16()); msg->readInt16(); // item id 2 headBottom = msg->readInt16(); diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index a54a17de..6d4149ec 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -206,7 +206,7 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn &msg, int &slot) Uint16 weapon = msg.readInt16(); if (weapon == 11) weapon = 2; - tempPlayer->setWeapon(weapon); + tempPlayer->setVisibleEquipment(Being::WEAPON_SPRITE, weapon * 10000); tempPlayer->mLevel = msg.readInt16(); msg.readInt16(); // skill point tempPlayer->setVisibleEquipment(Being::BOTTOMCLOTHES_SPRITE, msg.readInt16()); // head bottom diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp index 74ce95f3..579b6ed3 100644 --- a/src/net/equipmenthandler.cpp +++ b/src/net/equipmenthandler.cpp @@ -125,7 +125,8 @@ void EquipmentHandler::handleMessage(MessageIn *msg) item = player_node->getInvItem(index); player_node->mEquipment->setEquipment(position, item); - player_node->setWeaponById(item->getId()); + player_node->setVisibleEquipment( + Being::WEAPON_SPRITE, item->getId()); break; case 0x01d7: @@ -138,7 +139,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg) if (!being) break; - being->setWeaponById(itemId); + being->setVisibleEquipment(Being::WEAPON_SPRITE, itemId); break; case SMSG_PLAYER_UNEQUIP: @@ -181,7 +182,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg) case 536: case 1200: case 1201: - player_node->setWeapon(0); + player_node->setVisibleEquipment(Being::WEAPON_SPRITE, 0); // TODO: Why this break? Shouldn't a weapon be // unequipped in inventory too? break; @@ -192,7 +193,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg) logger->log("Unequipping: %i %i(%i) %i", index, equipPoint, type, position); break; - + case SMSG_PLAYER_ATTACK_RANGE: player_node->setAttackRange(msg->readInt16()); break; -- cgit v1.2.3-70-g09d2