void SearchStoreHandler::nextPage() const { createOutPacket(CMSG_SEARCHSTORE_NEXT_PAGE); }
void TradeHandler::finish() const { createOutPacket(CMSG_TRADE_OK); }
void TradeHandler::cancel() const { createOutPacket(CMSG_TRADE_CANCEL_REQUEST); }
void TradeHandler::setMoney(const int amount) const { createOutPacket(CMSG_TRADE_ITEM_ADD_REQUEST); outMsg.writeInt16(0, "index"); outMsg.writeInt32(amount, "amount"); }
void TradeHandler::confirm() const { createOutPacket(CMSG_TRADE_ADD_COMPLETE); }
void NpcHandler::talk(const BeingId npcId) const { createOutPacket(CMSG_NPC_TALK); outMsg.writeBeingId(npcId, "npc id"); outMsg.writeInt8(0, "unused"); }
void InventoryHandler::identifyItem(const Item *const item) const { createOutPacket(CMSG_QUICK_IDENTIFY_ITEM); outMsg.writeInt16(CAST_S16(item->getInvIndex()), "item index"); }
void BeingHandler::requestNameById(const BeingId id) const { createOutPacket(CMSG_NAME_REQUEST); outMsg.writeBeingId(id, "being id"); }
void CashShopHandler::buyItems(const int points, const STD_VECTOR<ShopItem*> &items) const { if (packetVersion < 20101124) return; int cnt = 0; const int pairSize = 2 + itemIdLen; FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) { const ShopItem *const item = *it; const int usedQuantity = item->getUsedQuantity(); const ItemTypeT type = item->getType(); if (usedQuantity == 0) continue; if (type == ItemType::Weapon || type == ItemType::Armor || type == ItemType::PetEgg || type == ItemType::PetArmor) { cnt += item->getUsedQuantity(); } else { cnt ++; } } if (cnt > 100) return; createOutPacket(CMSG_NPC_CASH_SHOP_BUY); outMsg.writeInt16(CAST_S16(10 + pairSize * cnt), "len"); outMsg.writeInt32(points, "points"); outMsg.writeInt16(CAST_S16(cnt), "count"); FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items) { ShopItem *const item = *it; const int usedQuantity = item->getUsedQuantity(); if (usedQuantity == 0) continue; item->increaseQuantity(usedQuantity); item->increaseUsedQuantity(-usedQuantity); item->update(); const ItemTypeT type = item->getType(); if (type == ItemType::Weapon || type == ItemType::Armor || type == ItemType::PetEgg || type == ItemType::PetArmor) { for (int f = 0; f < usedQuantity; f ++) { outMsg.writeInt16(CAST_S16(1), "amount"); outMsg.writeItemId(item->getId(), "item id"); } } else { outMsg.writeInt16(CAST_S16(usedQuantity), "amount"); outMsg.writeItemId(item->getId(), "item id"); } }
void PartyHandler::create(const std::string &name) const { createOutPacket(CMSG_PARTY_CREATE); outMsg.writeString(name.substr(0, 23), 24, "party name"); }
void PartyHandler::leave() const { createOutPacket(CMSG_PARTY_LEAVE); }
void PartyHandler::allowInvite(const bool allow) const { createOutPacket(CMSG_PARTY_ALLOW_INVITES); outMsg.writeInt8(CAST_S8(allow ? 1 : 0), "allow"); }
void NpcHandler::sell(const BeingId beingId) const { createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); outMsg.writeBeingId(beingId, "npc id"); outMsg.writeInt8(1, "action"); }
void NpcHandler::nextDialog(const BeingId npcId) const { createOutPacket(CMSG_NPC_NEXT_REQUEST); outMsg.writeBeingId(npcId, "npc id"); }
void SearchStoreHandler::close() const { createOutPacket(CMSG_SEARCHSTORE_CLOSE); }
void InventoryHandler::closeStorage() const { createOutPacket(CMSG_CLOSE_STORAGE); }
void CharServerHandler::switchCharacter() const { // This is really a map-server packet createOutPacket(CMSG_PLAYER_RESTART); outMsg.writeInt8(1, "flag"); }
void InventoryHandler::closeStorage(const int type A_UNUSED) const { createOutPacket(CMSG_CLOSE_STORAGE); }