81 const BeingId id =
msg.readBeingId(
"owner id");
83 if (dstBeing !=
nullptr)
89 msg.readString(80,
"shop name");
97 const BeingId id =
msg.readBeingId(
"owner id");
99 if (dstBeing !=
nullptr)
113 if (
msg.getVersion() >= 20160921)
115 else if (
msg.getVersion() >= 20150226)
120 if (
msg.getVersion() >= 20100105)
123 const int count = (
msg.readInt16(
"len") - offset) / packetLen;
126 if (being ==
nullptr)
131 if (
msg.getVersion() >= 20100105)
132 msg.readInt32(
"vender id");
133 for (
int f = 0; f < count; f ++)
135 const int value =
msg.readInt32(
"price");
136 const int amount =
msg.readInt16(
"amount");
137 const int index =
msg.readInt16(
"inv index");
139 msg.readUInt8(
"item type"));
140 const int itemId =
msg.readItemId(
"item id");
141 msg.readUInt8(
"identify");
142 msg.readUInt8(
"attribute");
143 msg.readUInt8(
"refine");
145 cards[d] =
msg.readItemId(
"card");
147 if (
msg.getVersion() >= 20150226)
150 for (
int d = 0; d < 5; d ++)
152 const uint16_t idx =
msg.readInt16(
"option index");
153 const uint16_t val =
msg.readInt16(
"option value");
154 msg.readUInt8(
"option param");
155 options->
add(idx, val);
158 if (
msg.getVersion() >= 20160921)
160 msg.readInt32(
"equip type?");
161 msg.readInt16(
"look");
166 color, amount, value);
179 msg.readInt16(
"inv index");
180 msg.readInt16(
"amount");
181 const int flag =
msg.readUInt8(
"flag");
212 if (
msg.getVersion() >= 20150226)
217 const int count = (
msg.readInt16(
"len") - 8) / packetLen;
219 for (
int f = 0; f < count; f ++)
221 msg.readInt32(
"price");
222 msg.readInt16(
"inv index");
223 msg.readInt16(
"amount");
224 msg.readUInt8(
"item type");
225 msg.readItemId(
"item id");
226 msg.readUInt8(
"identify");
227 msg.readUInt8(
"attribute");
228 msg.readUInt8(
"refine");
230 msg.readItemId(
"card");
231 if (
msg.getVersion() >= 20150226)
233 for (
int d = 0; d < 5; d ++)
235 msg.readInt16(
"option index");
236 msg.readInt16(
"option value");
237 msg.readUInt8(
"option param");
248 const int amount =
msg.readInt16(
"amount");
250 if (
msg.getVersion() >= 20141016)
252 msg.readInt32(
"char id");
253 msg.readInt32(
"time");
254 money =
msg.readInt32(
"zeny");
257 if (inventory ==
nullptr)
259 const Item *
const item = inventory->
getItem(index);
268 str =
strprintf(
_(
"Sold item %s amount %d. You got: %s"),
269 info.getLink().c_str(),
277 info.getLink().c_str(),
286 msg.readUInt8(
"result");
ActorManager * actorManager
Being * findBeing(const BeingId id) const
void setSellBoard(const std::string &text)
ShopItem * addItem(const int id, const ItemTypeT type, const ItemColor color, const int amount, const int price)
void setMoney(const int amount)
Item * getItem(const int index) const
static ItemColor getColorFromCards(const int *const cards)
void setInvIndex(const int index)
void setOptions(const ItemOptionsList *const options)
const ItemInfo & getInfo() const
static void distributeEvent(const bool b)
static void distributeEvent(const int slots)
static const int INVENTORY_OFFSET
const std::string DEFAULT_CURRENCY
LocalPlayer * localPlayer
#define UNIMPLEMENTEDPACKETFIELD(field)
#define UNIMPLEMENTEDPACKET
bool msg(InputEvent &event)
bool info(InputEvent &event)
void processOpen(Net::MessageIn &msg)
void processOpenStatus(Net::MessageIn &msg)
void processShowBoard(Net::MessageIn &msg)
void processItemsList(Net::MessageIn &msg)
void processHideBoard(Net::MessageIn &msg)
void processOpenReq(Net::MessageIn &msg)
void processReport(Net::MessageIn &msg)
void processBuyAck(Net::MessageIn &msg)
void notify(const unsigned int message)
@ BUY_FAILED_TOO_MANY_ITEMS
void enableVending(const bool b)
int32_t getAttribute(const AttributesT id)
Inventory * getCartInventory()
std::string formatCurrency(const int value)
std::string strprintf(const char *const format,...)
void add(const uint16_t index, const uint16_t value)