forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpellbookDump.lua
More file actions
28 lines (27 loc) · 1.01 KB
/
SpellbookDump.lua
File metadata and controls
28 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- Will dump all spells to a json
abotSpellResult='[';
tabCount = GetNumSpellTabs()
for a=1,tabCount do
tabName,tabTexture,tabOffset,numEntries=GetSpellTabInfo(a)
for b=tabOffset+1,tabOffset+numEntries do
abSpellName, abSpellRank = GetSpellName(b,"BOOKTYPE_SPELL")
if abSpellName then
abName, abRank, _, abCosts, _, _, abCastTime, abMinRange, abMaxRange = GetSpellInfo(abSpellName, abSpellRank)
abotSpellResult=abotSpellResult..
'{'..
'"spellbookName": "'..tostring(tabName or 0)..'",'..
'"spellbookId": "'..tostring(a or 0)..'",'..
'"name": "'..tostring(abSpellName or 0)..'",'..
'"rank": "'..tostring(abSpellRank or 0)..'",'..
'"castTime": "'..tostring(abCastTime or 0)..'",'..
'"minRange": "'..tostring(abMinRange or 0)..'",'..
'"maxRange": "'..tostring(abMaxRange or 0)..'",'..
'"costs": "'..tostring(abCosts or 0)..'"'..
'}';
if a < tabCount or b < tabOffset+numEntries then
abotSpellResult=abotSpellResult..','
end
end
end
end
abotSpellResult=abotSpellResult..']'