Navigation menu

WoW:API GetItemFamily: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Stub/API}}{{wowapi}} __NOTOC__
{{wowapi}}__NOTOC__
 
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
Gets the bitfield of what types of bags an item can go into or contain.
Gets the bitfield of what types of bags an item can go into or contain.


<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
[[bagType]] = GetItemFamily(itemId or "itemName" or "itemLink")
[[bagType]] = GetItemFamily(itemID | "name" | "itemLink")
 


== Arguments ==
== Arguments ==
<!-- List each argument, together with its type -->
:(itemId or "itemName" or "[[itemLink]]")
:(itemID | "name" | "itemLink")
 
:;itemID : Number - id of an item
:;name : String - name of an item
:;itemLink : String - link to an item


:;itemId : Integer - The numeric ID of the item. ie. 12345
:;itemName : String - The Name of the Item, ex: "Hearthstone"
:;[[itemLink]] : String - The [[itemLink]], when Shift-Clicking items.


== Returns ==
== Returns ==
<!-- List each return value, together with its type -->
:;[[bagType]] : Bitfield - What type of bags an item can go into or if the item is a container what it can contain
 
:;[[bagType]] : bitfield - what type of bags an item can go into or if the item is a container what it can contain
 
 


== Example ==
== Example ==
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
  local a = GetItemFamily(22786)
  local a = GetItemFamily(22786)


<big>'''Result'''</big>
<big>'''Result'''</big>
<!-- If it helps, include example results here, though they are not required. You're allowed to cheat liberally since WoW isn't a command line language. -->
  a = 32
  a = 32


== Details ==
== Details ==
<!-- Details not appropriate for the main description can go here.
: New function for 2.4 that allows you to find out what items can go into what bags.  If the item you pass is a container itself it will return what items it can contain since containers can always only go in general purpose bags.  This function only returns info for the items in the item cache just like [[API GetItemInfo|GetItemInfo]]. If the item is not in the item cache the function will return ''nil''.
    REMOVE the section if you're just going to restate the intro line! -->
 
: New function for 2.4 that allows you to find out what items can go into what bags.  If the item you pass is a container itself it will return what items it can contain since containers can always only go in general purpose bags.  This function only returns info for the items in the item cache just like GetItemInfo. If the item is not in the item cache the function will return nil.
Anonymous user