Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API OffhandHasWeapon

Last wiki revision 2020-04-04

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"

Source

https://warcraft.wiki.gg/wiki/API_OffhandHasWeapon · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.