-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslashcmds.lua
36 lines (33 loc) · 1.09 KB
/
slashcmds.lua
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
29
30
31
32
33
34
35
36
local _, _addon = ...
local L = _addon:GetLocalization()
SLASH_LEVELUPSPELLS1 = "/lus"
SLASH_LEVELUPSPELLS2 = "/levelupspells"
SlashCmdList["LEVELUPSPELLS"] = function(arg)
if arg == "missing" then
local spells, count = _addon:GetAllTrainableSpells()
if spells == nil then
print(L["CHATLINE_ALL_LEARNED"])
return
end
if count > 1 then
print(L["CHATLINE_MISSING_SPELLS"]:format(count))
else
print(L["CHATLINE_MISSING_SPELL"])
end
_addon:OutputSpellList(spells)
return
end
local levelarg = tonumber(arg)
if levelarg and levelarg > 0 and levelarg < 61 then
local spells, count = _addon:GetSpellsForLevel(levelarg, false)
if spells == nil then
print(L["CHATLINE_NONE_AVAILABLE_AT_LEVEL"]:format(levelarg))
return
end
_addon:OutputSpellList(spells)
return
end
print(L["SLASH_COMMANDS"])
print(L["SLASH_COMMANDS_TRAIN"]:format("lus", "missing"))
print(L["SLASH_COMMANDS_LEVEL"]:format("lus", "<level>"))
end