-
Notifications
You must be signed in to change notification settings - Fork 16
/
mount.table.lua
66 lines (62 loc) · 2.74 KB
/
mount.table.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
58
59
60
61
62
63
64
65
66
function BeStride:buildMountTables()
BeStride:BuildMasterMountTable()
BeStride:LoadMountTables()
end
function BeStride:LoadMountTables()
mountTable["ground"] = {}
mountTable["flying"] = {}
mountTable["swimming"] = {}
mountTable["passenger"] = {}
mountTable["repair"] = {}
for key,value in pairs(mountTable["master"]) do
if value["faction"] == nil or value["faction"] == playerTable["faction"]["id"] then
--if value["faction"] then
--print("Adding Mount: " .. value["name"] .. " Id: " .. key .. " Type: " .. value["type"] .. " Faction: " .. value["faction"] .. " Player Faction: " .. playerTable["faction"]["id"] .. " SID: " .. value["spellID"] .. " MID: " .. value["mountID"])
--end
--print("Adding Mount: " .. value["name"] .. " Id: " .. key .. " Type: " .. value["type"] .. " SID: " .. value["spellID"] .. " MID: " .. value["mountID"] .. " Type: " .. value["type"])
BeStride:AddCommonMount(key)
BeStride:AddPassengerMount(key)
BeStride:AddRepairMount(key)
end
end
end
function BeStride:AddCommonMount(mountId)
local mount = mountTable["master"][mountId]
if BeStride_MountDB and BeStride_MountDB[mount.spellID] then
if BeStride_MountDB[mount.spellID].attributes.flying then
table.insert(mountTable["flying"],mountId)
end
if BeStride_MountDB[mount.spellID].attributes.ground then
table.insert(mountTable["ground"],mountId)
end
if BeStride_MountDB[mount.spellID].attributes.swimming then
table.insert(mountTable["swimming"],mountId)
end
else
if mount["type"] == "ground" then
--print("Adding Mount: " .. mount["name"] .. " Id: " .. mountId .. " Type: " .. mount["type"])
table.insert(mountTable["ground"],mountId)
elseif mount["type"] == "flying" then
--print("Adding Mount: " .. mount["name"] .. " Id: " .. mountId .. " Type: " .. mount["type"])
table.insert(mountTable["flying"],mountId)
elseif mount["type"] == "swimming" then
--print("Adding Mount: " .. mount["name"] .. " Id: " .. mountId .. " Type: " .. mount["type"])
table.insert(mountTable["swimming"],mountId)
elseif mount["type"] == "zone" then
if mountId == 373 then
table.insert(mountTable["swimming"],mountId)
end
table.insert(mountTable["zone"],mountId)
end
end
end
function BeStride:AddPassengerMount(mountId)
if BeStride_Constants.Mount.Mounts[mountTable["master"][mountId]["spellID"]] ~= nil and BeStride_Constants.Mount.Mounts[mountTable["master"][mountId]["spellID"]]["type"] == "passenger" then
table.insert(mountTable["passenger"],mountId)
end
end
function BeStride:AddRepairMount(mountId)
if BeStride_Constants.Mount.Mounts[mountTable["master"][mountId]["spellID"]] ~= nil and BeStride_Constants.Mount.Mounts[mountTable["master"][mountId]["spellID"]]["repair"] then
table.insert(mountTable["repair"],mountId)
end
end