BuyMerchantItem

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 1.0.0 / 1.13.2

Buys an item from a merchant.

BuyMerchantItem(index[, quantity])

Arguments

index
number - The index of the item in the merchant's inventory
quantity
number? - Quantity to buy.

Details

If the item is sold in stacks, the quantity specifies how many stacks will be bought.

As of 4.1, the quantity argument behavior is different:

  • If you do not specify quantity and the item is sold in stacks it will buy a stack.
  • If you specify quantity it will buy the specified amount, sold in stacks or not.

The only limitation is the maximum stack allowed to buy from the merchant at one time, you can check this with the GetMerchantItemMaxStack function.