WoW:API GetMerchantItemCostItem: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Added function)
 
m (Move page script moved page API GetMerchantItemCostItem to API GetMerchantItemCostItem without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}}
 
itemTexture, itemValue, itemLink = GetMerchantItemCostItem(index, itemIndex)
 
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
Returns cost info for Marks of Honor required to purchase an item
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
{{Code/Begin}}
itemTexture, itemValue = GetMerchantItemCostItem(index, itemIndex)
{{Code/End}}
 


== Parameters ==
== Parameters ==
Line 16: Line 8:


:;index : Number - The index of the item in the merchant's inventory
:;index : Number - The index of the item in the merchant's inventory
:;itemIndex : Number - The index for the required item type
:;itemIndex : Number - The index for the required item cost type.




Line 24: Line 16:
:;itemTexture : String - The texture that represents the item's icon
:;itemTexture : String - The texture that represents the item's icon
:;itemValue : Number - The number of that item required
:;itemValue : Number - The number of that item required
:;itemLink : String - An [[itemLink]] for the cost item.


==Details==
==Details==
<!-- Details not appropriate for the main description can go here.  
itemIndex counts into the number of different "alternate currency" tokens required to buy the item under consideration.  For example, looking at the 25-player Tier 9 vendor, a chestpiece costs 75 Emblems of Triumph and 1 Trophy of the Crusade. This function would be called with arguments (N,1) to retrieve information about the Emblems and (N,2) to retrieve information about the Trophy, where N is the index of the chestpiece in the merchant window.
    REMOVE the section if you're just going to restate the intro line! -->
 
Most vendor items only use a single type of alternate currency token, so itemIndex will typically be 1.


itemIndex should never be larger than the itemCount returned by [[API GetMerchantItemCostInfo|GetMerchantItemCostInfo]]
itemIndex should never be larger than the itemCount returned by [[API GetMerchantItemCostInfo|GetMerchantItemCostInfo]].

Latest revision as of 04:46, 15 August 2023

WoW API < GetMerchantItemCostItem

itemTexture, itemValue, itemLink = GetMerchantItemCostItem(index, itemIndex)

Parameters[edit]

Arguments

index
Number - The index of the item in the merchant's inventory
itemIndex
Number - The index for the required item cost type.


Returns

itemTexture
String - The texture that represents the item's icon
itemValue
Number - The number of that item required
itemLink
String - An itemLink for the cost item.

Details[edit]

itemIndex counts into the number of different "alternate currency" tokens required to buy the item under consideration. For example, looking at the 25-player Tier 9 vendor, a chestpiece costs 75 Emblems of Triumph and 1 Trophy of the Crusade. This function would be called with arguments (N,1) to retrieve information about the Emblems and (N,2) to retrieve information about the Trophy, where N is the index of the chestpiece in the merchant window.

Most vendor items only use a single type of alternate currency token, so itemIndex will typically be 1.

itemIndex should never be larger than the itemCount returned by GetMerchantItemCostInfo.