Module action.item.Main
This is the item class.
Functions
| Item:GCD () | Get the Global Cooldown (GCD) duration for this item. |
| Item:Rarity () | Get the rarity level of this item. |
| Item:Level () | Get the item level of this item. |
| Item:MinLevel () | Get the minimum level required to use this item. |
| Item:SlotIDs () | Get the equipment slot IDs where this item can be equipped. |
| Item:InfoById () | Get item information by item ID. |
| Item:InfoByName () | Get item information by item name. |
| Item:Exists () | Check if the player has this item in their inventory. |
| Item:IsUsable () | Check if this item can be used by the player. |
| Item:IsEquipped () | Check if this item is currently equipped by the player. |
| Item:CooldownInfo () | Get cooldown information for this item. |
| Item:Cooldown () | Get the base cooldown duration of this item. |
| Item:HasCooldown () | Check if this item has a cooldown. |
| Item:CooldownRemains () | Get the remaining cooldown time for this item. |
| Item:IsOnCooldown () | Check if this item is currently on cooldown. |
| Item:IsNotOnCooldown () | Check if this item is not on cooldown. |
| Item:IsReady (showNameplateIcon) | Check if this item is ready to be used. |
| Item:IsEquippedAndReady () | Check if this item is equipped and ready to be used. |
Functions
- Item:GCD ()
-
Get the Global Cooldown (GCD) duration for this item.
Returns:
-
number The GCD duration in seconds, or 0 if the item has no on-use spell
- Item:Rarity ()
-
Get the rarity level of this item.
Returns:
-
number The item's rarity level
- Item:Level ()
-
Get the item level of this item.
Returns:
-
number The item's level
- Item:MinLevel ()
-
Get the minimum level required to use this item.
Returns:
-
number The minimum level required
- Item:SlotIDs ()
-
Get the equipment slot IDs where this item can be equipped.
Returns:
-
table Array of slot IDs where this item can be equipped
- Item:InfoById ()
-
Get item information by item ID.
Uses the WoW API GetItemInfo function with the item's ID.
Returns:
-
string,string,number,number,number,string,string,number,string,string,number,number,number,number,number,number,boolean
itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType,
itemStackCount, itemEquipLoc, itemTexture, sellPrice, classID, subclassID,
bindType, expansionID, setID, isCraftingReagent
- Item:InfoByName ()
-
Get item information by item name.
Uses the WoW API GetItemInfo function with the item's name.
Returns:
-
string,string,number,number,number,string,string,number,string,string,number,number,number,number,number,number,boolean
itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType,
itemStackCount, itemEquipLoc, itemTexture, sellPrice, classID, subclassID,
bindType, expansionID, setID, isCraftingReagent
- Item:Exists ()
-
Check if the player has this item in their inventory.
Returns:
-
boolean True if the player has at least one of this item
- Item:IsUsable ()
-
Check if this item can be used by the player.
Returns:
-
boolean True if the item is usable by the player
- Item:IsEquipped ()
-
Check if this item is currently equipped by the player.
Returns:
-
boolean True if the item is equipped in any valid slot
- Item:CooldownInfo ()
-
Get cooldown information for this item.
Returns:
-
number,number,boolean startTime, duration, enable - The cooldown start time and duration
- Item:Cooldown ()
-
Get the base cooldown duration of this item.
Returns:
-
number The base cooldown duration in seconds, or 0 if no cooldown
- Item:HasCooldown ()
-
Check if this item has a cooldown.
Returns:
-
boolean True if the item has a cooldown duration greater than 0
- Item:CooldownRemains ()
-
Get the remaining cooldown time for this item.
Returns:
-
number The remaining cooldown time in seconds, or 0 if not on cooldown
- Item:IsOnCooldown ()
-
Check if this item is currently on cooldown.
Returns:
-
boolean True if the item has remaining cooldown time
- Item:IsNotOnCooldown ()
-
Check if this item is not on cooldown.
Returns:
-
boolean True if the item has no remaining cooldown time
- Item:IsReady (showNameplateIcon)
-
Check if this item is ready to be used.
An item is considered ready if it's usable, not on cooldown, and passes action settings.
Parameters:
- showNameplateIcon boolean Optional parameter for nameplate icon display
Returns:
-
boolean True if the item is ready to use
- Item:IsEquippedAndReady ()
-
Check if this item is equipped and ready to be used.
Returns:
-
boolean True if the item is both equipped and ready