- summary: Buy a number of one item from the NPC shop you have open.
- area: Game.Exchange
Buy a number of one item from the NPC shop you have open.
Kind request · Area Game.Exchange
Buys ExchangeBuyRequest.quantity units of one item from the NPC shop that
ExchangeNpcShopStartedEvent opened.
HOW TO SEND IT
1. PICK AN ITEM FROM THE SHOP'S STOCK. Copy its
ItemMinimalInformation.object_gid into
ExchangeBuyRequest.object_uid. Despite its name the field carries the item's
TEMPLATE id, not the unique id of an object you own.
2. CHECK THAT YOU MAY BUY IT: its ItemToSellInNpcShop.buy_criterion, and
the remaining allowance when ItemToSellInNpcShop.total_buyable is
positive.
3. CHECK THAT YOU CAN PAY: ItemToSellInNpcShop.price times the quantity,
in kamas or in the shop's token.
4. SEND IT with the quantity you want.
WHAT CAME BACK IN THE CAPTURE
A text notification (message 252; its parameters began with the template id and
ended with the quantity and the price), KamasUpdateEvent, ObjectAddedEvent with the new
object, InventoryWeightEvent, ExchangeBoughtEvent, then the same kamas and
weight again. A stack you already held grows through ObjectQuantityEvent
instead of ObjectAddedEvent.
When you may send it
- Requires
exchange_openinferred - Raised by: a user action: the player buys an item in the NPC shop window, directly or by confirming the buy popup proven
Related messages
- You will then receive
ExchangeBoughtEventobserved — the success answer, after the kamas, inventory and weight updates; 2 of 2 purchases
Fields
| # | Field | Type | Meaning | You set it |
|---|---|---|---|---|
| 1 | quantity | int32 | How many units to buy. Observed: 1The client's quantity selector starts at 1. | required |
| 2 | object_uid | int32 | The template id of the item to buy, as listed in the shop's stock. (item template id) Observed: 6765Despite the name it is NOT a unique object id: send the entry's ItemMinimalInformation.object_gid. | required |