Repository navigation
Expand file tree
/
Copy pathExporters.lua
More file actions
128 lines (111 loc) · 3.72 KB
/
Copy pathExporters.lua
File metadata and controls
128 lines (111 loc) · 3.72 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
local Talented = _G.Talented
local L = LibStub("AceLocale-3.0"):GetLocale("Talented")
local ipairs, tonumber = ipairs, tonumber
local RAID_CLASS_COLORS = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS
-------------------------------------------------------------------------------
-- Common
--
Talented.importers[".*/(.*)/talents%..-%?t?a?l?=?(%d+)$"] = function(self, url, dst)
local s, _, class, src = url:find(".*/(.*)/talents%..-%?t?a?l?=?(%d+)$")
if not s then return end
dst.class = class:upper()
local count = 1
local info = self:UncompressSpellData(dst.class)
local len = src:len()
for tab, tree in ipairs(info) do
local t = {}
dst[tab] = t
for index = 1, #tree do
t[index] = tonumber(src:sub(count, count))
count = count + 1
if count > len then
break
end
end
end
return dst
end
Talented.importers["/%??talent#"] = function(self, url, dst)
local s, _, code = url:find(".*/%??talent#(.*)$")
if not s or not code then return end
local p = code:find(":", nil, true)
if p then
code = code:sub(1, p - 1)
end
local val, class = self:StringToTemplate(code, dst, "0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevE")
dst.class = class
return dst
end
-------------------------------------------------------------------------------
-- WoTLKDB
--
Talented.exporters["WoTLKDB"] = function(self, template)
if not RAID_CLASS_COLORS[template.class] then
return self:ExportWhpetTemplate(template, "https://www.wotlkdb.com/?petcalc#%s")
end
return ("https://www.wotlkdb.com/?talent#%s"):format(self:TemplateToString(template, "0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevE"))
end
-------------------------------------------------------------------------------
-- EvoWOW
--
Talented.exporters["EvoWoW"] = function(self, template)
if not RAID_CLASS_COLORS[template.class] then
return self:ExportWhpetTemplate(template, "https://wotlk.evowow.com/?petcalc#%s")
end
return ("https://wotlk.evowow.com/?talent#%s"):format(self:TemplateToString(template, "0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevE"))
end
-------------------------------------------------------------------------------
-- TrueWoW
--
Talented.importers[".*/talent%-calculator#"] = function(self, url, dst)
local s, _, code = url:find(".*/talent%-calculator#(.*)$")
if not s or not code then return end
local p = code:find(":", nil, true)
if p then
code = code:sub(1, p - 1)
end
local val, class = self:StringToTemplate(code, dst, "0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevE")
dst.class = class
return dst
end
Talented.exporters["TrueWoW"] = function(self, template)
if not RAID_CLASS_COLORS[template.class] then
return self:ExportWhpetTemplate(template)
end
return ("https://truewow.org/talent-calculator#%s"):format(self:TemplateToString(template, "0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevE"))
end
-------------------------------------------------------------------------------
-- Altervista
--
Talented.importers["rpgworld%.altervista%.org/335/"] = function(self, url, dst)
local s, _, class, src = url:find(".*rpgworld%.altervista%.org/335/([^=]+)%.php%?([0-5]+)")
if not s then return end
dst.class = class:upper()
local count = 1
local info = self:UncompressSpellData(dst.class)
local len = src:len()
for tab, tree in ipairs(info) do
local t = {}
dst[tab] = t
for index = 1, #tree do
t[index] = tonumber(src:sub(count, count))
count = count + 1
if count > len then
break
end
end
end
return dst
end
Talented.exporters["Altervista"] = function(self, template)
if not RAID_CLASS_COLORS[template.class] then
return self:ExportWhpetTemplate(template)
end
local s = {}
for _, tree in ipairs(template) do
for _, n in ipairs(tree) do
s[#s + 1] = tostring(n)
end
end
return ("http://rpgworld.altervista.org/335/%s.php?%s"):format(template.class:lower(), table.concat(s))
end