/Runeforger
-- Rune in Mainhand ( http://www.wowwiki.com/EnchantId ) |
local event = CreateFrame("Frame") |
event:SetScript("OnEvent", function(self, event, ...) |
if self[event] then return self[event](self, event, ...) end |
end) |
local text = event:CreateFontString(nil, "BACKGROUND") |
text:SetFontObject(ZoneTextFont) |
text:SetHeight(50) |
text:Hide() |
local total = 0 |
local total,texthide = 0 |
local function onUpdate(self,elapsed) |
total = total + elapsed |
local function checkrune() |
if GetInventoryItemLink("player", 16) and GetInventoryItemLink("player", 17) == nil then |
local rune = GetInventoryItemLink("player", 16):match("item:[^:]+:([^:]+):") -- Rune in Mainhand ( http://www.wowwiki.com/EnchantId ) |
local rune = GetInventoryItemLink("player", 16):match("item:[^:]+:([^:]+):") |
if (GetActiveTalentGroup() == 1 and rune == "3368") or (GetActiveTalentGroup() == 2 and rune == "3847") then |
text:Show() |
if not texthide then text:Show() end |
event:SetScript("OnUpdate", onUpdate) |
end |
end |
event:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
event:RegisterEvent("PLAYER_ENTERING_WORLD") |
event:RegisterEvent("PLAYER_DAMAGE_DONE_MODS") |
event:SetScript("OnEvent", checkrune) |
event:RegisterEvent("PLAYER_REGEN_DISABLED") |
event:RegisterEvent("PLAYER_REGEN_ENABLED") |
function event:PLAYER_EQUIPMENT_CHANGED() |
checkrune() |
end |
function event:ACTIVE_TALENT_GROUP_CHANGED() |
checkrune() |
end |
function event:PLAYER_ENTERING_WORLD() |
checkrune() |
end |
function event:PLAYER_DAMAGE_DONE_MODS() |
checkrune() |
end |
function event:PLAYER_REGEN_DISABLED() |
texthide = true |
text:Hide() |
self:SetScript("OnUpdate",nil) |
end |
function event:PLAYER_REGEN_ENABLED() |
texthide = nil |
checkrune() |
end |