-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSFUtils_Characters.lua
More file actions
29 lines (23 loc) · 867 Bytes
/
SFUtils_Characters.lua
File metadata and controls
29 lines (23 loc) · 867 Bytes
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
-- LibSFUtils is already defined in prior loaded file
LibSFUtils = LibSFUtils or {}
local sfutil = LibSFUtils
----------------------------
-- Character helpers
----------------------------
-- populate table of all character names on the current account indexed by unique ID
-- returns the server name, the account name, and the list of toons belonging to the account
function sfutil.LoadAcctChars( )
local server = GetWorldName()
local acct = GetDisplayName()
local chars = {}
-- Create entries for every character on the account
for i = 1, GetNumCharacters() do
local name, gender, level, classId, raceId, alliance, id, locationId = GetCharacterInfo(i)
chars[id] = sfutil.SafeTable(chars[id])
chars[id].server = server
chars[id].account = acct
chars[id].id = id
chars[id].name = zo_strformat("<<1>>", name)
end
return server, acct, chars
end