Created
November 17, 2020 23:41
-
-
Save ambethia/246c8e5da39b8959ce9b86854d6ce922 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ADDON, NS = ... | |
local LibCopyPaste = LibStub("LibCopyPaste-1.0") | |
local Njor = CreateFrame("Frame", ADDON .. "Frame") | |
Njor:SetScript( | |
"OnEvent", | |
function(self, event, ...) | |
if self[event] then | |
return self[event](self, ...) | |
end | |
end | |
) | |
function PrintSpells() | |
local data = {} | |
for tabIndex = 2, GetNumSpellTabs() do | |
local tabName, tabTexture, tabOffset, numEntries = GetSpellTabInfo(tabIndex) | |
for spellIndex = tabOffset + 1, tabOffset + numEntries do | |
local spellName, spellSubName = GetSpellBookItemName(spellIndex, BOOKTYPE_SPELL) | |
local skillType, special = GetSpellBookItemInfo(spellIndex, BOOKTYPE_SPELL) | |
local isPassive = IsPassiveSpell(spellIndex, BOOKTYPE_SPELL) and "true" or "false" | |
if skillType == "FUTURESPELL" then | |
skillType = "SPELL" | |
end | |
tinsert(data, strjoin(";", "Ability", tabName, spellName, (spellSubName or ''), isPassive, skillType, special)) | |
end | |
end | |
for specIndex = 1, GetNumSpecializations() do | |
for tier = 1, MAX_TALENT_TIERS do | |
for column = 1, NUM_TALENT_COLUMNS do | |
local specName = select(2, GetSpecializationInfo(specIndex)) | |
local talentID, name, texture, selected, available, spellID, unknown, row, column, known, grantedByAura = GetTalentInfoBySpecialization(specIndex, tier, column) | |
local isPassive = IsPassiveSpell(spellID) and "true" or "false" | |
tinsert(data, strjoin(";", "Talent", specName, name, isPassive, 'Tier ' .. row, "SPELL", spellID)) | |
end | |
end | |
end | |
LibCopyPaste:Copy("Spells", table.concat(data, "\n")) | |
end | |
function Njor:PLAYER_ENTERING_WORLD() | |
PrintSpells() | |
end | |
Njor:RegisterEvent("PLAYER_ENTERING_WORLD") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment