View Single Post
02-17-16, 09:00 AM   #12
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Since 6.0 you can get the temporary enchant ids from GetWeaponEnchantInfo():

Lua Code:
  1. local hasMainHandEnchant, mainHandExpiration, mainHandCharges, mainHandEnchantID, hasOffHandEnchant, offHandExpiration, offHandCharges, offHandEnchantId = GetWeaponEnchantInfo()

The issue now, is that you don't know the duration of the enchants.

But you can filter the fishing lure enchants or fall back to 3600 like this:

Lua Code:
  1. local tempEnchantID = {
  2.     [256] = 600, -- (+75)
  3.     [263] = 600, -- (+25)
  4.     [264] = 600, -- (+50)
  5.     [265] = 600, -- (+75)
  6.     [266] = 600, -- (+100)
  7.     [3868] = 3600, -- (+100)
  8.     [4225] = 900, -- (+150)
  9.     [4264] = 600, -- (+15)
  10.     [4919] = 600, -- (+150)
  11.     [5386] = 600, -- (+200)
  12. }
  13.  
  14. local hasMainHandEnchant, mainHandExpiration, mainHandCharges, mainHandEnchantID, hasOffHandEnchant, offHandExpiration, offHandCharges, offHandEnchantId = GetWeaponEnchantInfo()
  15. local duration = tempEnchantID[mainHandEnchantID] or 3600
  16. frame.cooldown:SetCooldown(GetTime() + ((mainHandExpiration / 1000) - duration), duration)

Last edited by Resike : 02-17-16 at 09:18 AM.
  Reply With Quote