Wikia

WoWWiki

API OffhandHasWeapon

Talk0
101,679pages on
this wiki
Revision as of 17:31, January 6, 2007 by Hobinbot (Talk | contribs)

(diff) ←Older revision | Latest revision (diff) | Newer revision → (diff)
WoW API < OffhandHasWeapon
hasWeapon = OffhandHasWeapon()

Return whether a weapon is in the offhand slot.


Returns
hasWeapon 
Flag - 1 if an item of type Weapon is in the offhand slot, nil otherwise


Note: Shields, Held Off-Hand and other non-weapon items in this slot are typically not a weapon. You can think of this return as the equivalent of:

local _,_,id = string.find(GetInventoryItemLink("player",GetInventorySlotInfo("SecondaryHandSlot")) or "","(item:%d+:%d+:%d+:%d+)")
local _,_,_,_,itemType = GetItemInfo(id)
return itemType=="Weapon"

Around Wikia's network

Random Wiki