WoW:API GetWeaponEnchantInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Removed thrown weapon return values -- ranged weapon slot no longer exists.)
No edit summary
Line 1: Line 1:
{{wowapi}}
{{wowapi}}GetWeaponEnchantInfo();
GetWeaponEnchantInfo();


This appears to be used for handling TEMPORARY enchants to weapons - like POISONS. Also appears to be self-only.
This appears to be used for handling TEMPORARY enchants to weapons - like POISONS. Also appears to be self-only.


;Returns
== Returns ==
hasMainHandEnchant, mainHandExpiration, mainHandCharges, mainHandEnchantID, hasOffHandEnchant, offHandExpiration, offHandCharges, offHandEnchantId = GetWeaponEnchantInfo();
;hasMainHandEnchant
: Boolean - 1 if has an enchant on the main-hand weapon, nil if no enchant
;mainHandExpiration
: Number - Duration of enchant on the main-hand weapon in MILLISECONDS, nil if no enchant
;mainHandCharges
: Number - Amount of charges on the main-hand weapon, 0 if no charges, nil if no enchant
;mainHandEnchantID (as of 6.0)
;hasOffHandEnchant
: Boolean - 1 if has an enchant on the off-hand weapon or nil
;offHandExpiration
: Number - Duration of enchant on the off-hand weapon in MILLISECONDS, nil if no enchant
;offHandCharges
: Number - Amount of charges on the off-hand weapon, 0 if no charges, nil if no enchant
;offHandEnchantID (as of 6.0)


== Example ==
  hasMainHandEnchant = 1 (true) or nil
  hasMainHandEnchant = 1 (true) or nil
  mainHandExpiration = time remaining as thousandths of seconds
  mainHandExpiration = time remaining as thousandths of seconds
Line 15: Line 28:
  offHandCharges = charges remaining
  offHandCharges = charges remaining
  offHandEnchantID = the spell ID of the off hand enchantment (new in 6.0)
  offHandEnchantID = the spell ID of the off hand enchantment (new in 6.0)
<br>
   
   
 
  Reference the default interface BuffFrame.Lua for its usage.
  Reference the default interface BuffFrame.Lua for its usage.
== History ==
* Patch 6.0 added mainHandEnchantID and offHandEnchantID.

Revision as of 07:08, 13 March 2020

WoW API < GetWeaponEnchantInfoGetWeaponEnchantInfo();

This appears to be used for handling TEMPORARY enchants to weapons - like POISONS. Also appears to be self-only.

Returns

hasMainHandEnchant
Boolean - 1 if has an enchant on the main-hand weapon, nil if no enchant
mainHandExpiration
Number - Duration of enchant on the main-hand weapon in MILLISECONDS, nil if no enchant
mainHandCharges
Number - Amount of charges on the main-hand weapon, 0 if no charges, nil if no enchant
mainHandEnchantID (as of 6.0)
hasOffHandEnchant
Boolean - 1 if has an enchant on the off-hand weapon or nil
offHandExpiration
Number - Duration of enchant on the off-hand weapon in MILLISECONDS, nil if no enchant
offHandCharges
Number - Amount of charges on the off-hand weapon, 0 if no charges, nil if no enchant
offHandEnchantID (as of 6.0)

Example

hasMainHandEnchant = 1 (true) or nil
mainHandExpiration = time remaining as thousandths of seconds
mainHandCharges = charges remaining
mainHandEnchantID = the spell ID of the main hand enchantment (new in 6.0)
hasOffHandEnchant = 1 (true) or nil
offHandExpiration = time remaining as thousandths of seconds
offHandCharges = charges remaining
offHandEnchantID = the spell ID of the off hand enchantment (new in 6.0)

 
Reference the default interface BuffFrame.Lua for its usage.

History

  • Patch 6.0 added mainHandEnchantID and offHandEnchantID.