-
Notifications
You must be signed in to change notification settings - Fork 16
/
MountTable.lua
57 lines (51 loc) · 1.59 KB
/
MountTable.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
52
53
54
55
56
57
function BeStride:BuildMasterMountTable()
local num = GetNumCompanions("MOUNT")
for i=1, GetNumCompanions("MOUNT") do
local mountID,name,spellID,icon,isSummoned, mountTypeID = GetCompanionInfo("MOUNT", i)
if mountTable["master"][spellID] == nil then
BeStride:AddNewMount(i)
end
end
--print("End mount table")
end
function BeStride:AddNewMount(mountId)
local mountID,name,spellID,icon,isSummoned = GetCompanionInfo("MOUNT", mountId)
if not BeStride_MountDB[spellID] then
print("Mount not in DB:")
print("\tMount Number:" .. mountId)
print("\tSpell ID:" .. spellID)
print("\tMount ID:" .. mountID)
if name then
print("\tName: " .. name)
end
return
end
if BeStride_MountDB[spellID].attributes.flying == true then
mountType = "flying"
elseif BeStride_MountDB[spellID].attributes.ground == true then
mountType = "ground"
else
mountType = "unknown"
end
if not name and BeStride_MountDB[spellID].name then
name = BeStride_MountDB[spellID].name
end
mountTable["master"][mountID] = {
["name"] = name,
["spellID"] = spellID,
["mountID"] = mountID,
["isActive"] = isSummoned,
["faction"] = nil,
["icon"] = icon,
["source"] = BeStride_MountDB[spellID].source,
["type"] = mountType,
}
end
function BeStride:PrintAllMounts()
local num = GetNumCompanions("MOUNT")
print("MountID:name:spellID,icon,isSummoned,mountTypeID")
for i=1, GetNumCompanions("MOUNT") do
local mountID,name,spellID,icon,isSummoned, mountTypeID = GetCompanionInfo("MOUNT", i)
print("" + MountID + ":" + name + ":" + spellID + ":" + icon + ":" + isSummoned + ":" + mountTypeID+"")
end
end