forked from phriked/AstralKeys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnit Information.lua
51 lines (41 loc) · 1.01 KB
/
Unit Information.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
local e, L = unpack(select(2, ...))
local UNIT_LIST = {}
-- Sets a number to a unit for quicker access to table
-- @param unit Unit name and server
-- @param unitID integer value
function e.SetUnitID(unit, unitID)
UNIT_LIST[unit] = unitID
end
-- Retrieves ID number for associated unit
-- @param unit Unit name and server
function e.UnitID(unit)
return UNIT_LIST[unit] or nil
end
function e.UnitName(id)
return AstralKeys[id][1]:sub(1, AstralKeys[id][1]:find('-') - 1)
end
function e.Unit(id)
return AstralKeys[id][1]
end
-- Clears unit list
function e.WipeUnitList()
wipe(UNIT_LIST)
end
--Gets unit class from saved variables
-- @param id int ID number for the unit
function e.UnitClass(id)
if not id then return nil end
return AstralKeys[id][2]
end
function e.UnitKeyLevel(id)
if not id then return nil end
return AstralKeys[id][4]
end
function e.UnitMapID(id)
if not id then return nil end
return AstralKeys[id][3]
end
function e.UnitWeeklyBest(id)
if not id then return nil end
return AstralKeys[id][5]
end