Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _G.talentAnywhere()
- local removeTalent = RemoveTalent
- local learnTalent = LearnTalent
- -- Load Talent UI if not opened before
- if not IsAddOnLoaded("Blizzard_TalentUI") and not UnitAffectingCombat("player") then
- LoadAddOn("Blizzard_TalentUI")
- end
- local function talentSelection(row)
- _G.selectedTalent = nil
- for column = 1, 3 do
- if IsMouseButtonDown(1) and _G.newTalent == nil and MouseIsOver(_G["PlayerTalentFrameTalentsTalentRow"..row.."Talent"..column])
- and not select(4, GetTalentInfoByID(GetTalentInfo(row, column, 1), 1))
- then
- _G.selectedTalent = nil
- _G.newTalent = select(1,GetTalentInfo(row, column, 1))
- _G.newTalentRow = row
- end
- if _G.newTalentRow ~= nil then
- if select(4, GetTalentInfoByID(GetTalentInfo(_G.newTalentRow, column, 1), 1)) then
- _G.selectedTalent = select(1,GetTalentInfo(_G.newTalentRow, column, 1))
- end
- end
- end
- return _G.selectedTalent, _G.newTalent -- selectedNew
- end
- if PlayerTalentFrame and PlayerTalentFrame:IsVisible() and not IsResting() then
- for row = 1, 7 do
- _G.selectedTalent, _G.newTalent, _G.selectedNew = talentSelection(row)
- end
- _G.ChatOverlay(tostring(_G.selectedTalent).." | "..tostring(_G.newTalent).." | "..tostring(_G.selectedNew))
- if _G.newTalent ~= nil then
- if _G.selectedTalent ~= nil and _G.selectedTalent ~= _G.newTalent and not _G.selectedNew and Zylla.timer:useTimer("RemoveTalent", 0.1) then
- removeTalent(_G.selectedTalent)
- end
- if _G.selectedTalent == nil and _G.selectedTalent ~= _G.newTalent and not _G.selectedNew then
- learnTalent(_G.newTalent)
- _G.selectedNew = true
- end
- if _G.selectedTalent == _G.newTalent then
- _G.selectedNew = false
- _G.newTalent = nil
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement