forked from pot0to/pot0to-SND-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.lua
58 lines (54 loc) · 2.54 KB
/
functions.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
-- Svc.AetheryteList.FirstOrDefault(x => x.AetheryteId == aetheryteID)?.AetheryteData.GameData?.PlaceName.Value?.Name ?? string.Empty;
function GetAetheryteName(aetheryteId)
for i=0,AetheryteList.Count do
if AetheryteList[i] ~= nil then
if AetheryteList[i].AetheryteId == aetheryteId then
if AetheryteList[i].AetheryteData.GameData ~= nil then
if AetheryteList[i].AetheryteData.GameData.PlaceName.Value ~= nil then
if AetheryteList[i].AetheryteData.GameData.PlaceName.Value.Name ~= nil then
LogInfo(AetheryteList[i].AetheryteData.GameData.PlaceName.Value.Name)
return tostring(AetheryteList[i].AetheryteData.GameData.PlaceName.Value.Name):match("(.+):")
end
end
end
end
end
end
end
-- Svc.AetheryteList.Where(x => x.TerritoryId == zoneID).Select(x => x.AetheryteId).ToList();
function GetAetherytesInZone(zoneId)
local aetherytes = {}
for i=0,AetheryteList.Count do
if AetheryteList[i] ~= nil then
if AetheryteList[i].TerritoryId == zoneId then
yield("/echo "..AetheryteList[i].AetheryteId)
table.insert(aetherytes, AetheryteList[i].AetheryteId)
end
end
end
return aetherytes
end
-- Svc.AetheryteList.FirstOrDefault(x => x.AetheryteId == aetheryteID)?.AetheryteData.GameData?.Level.FirstOrDefault()?.Value?.X ?? 0;
function GetAetheryteRawPos(aetheryteId)
for i=0,AetheryteList.Count do
if AetheryteList[i] ~= nil then
if AetheryteList[i].AetheryteId == aetheryteId then
if AetheryteList[i].AetheryteData.GameData ~= nil then
if AetheryteList[i].AetheryteData.GameData.Map ~= nil then
yield("/echo map not nil")
local level = AetheryteList[i].AetheryteData.GameData.Map
LogInfo(AetheryteList[i].AetheryteData.GameData.Level[1].X)
if AetheryteList[i].AetheryteData.GameData.Level[1].Value ~= nil then
yield("/echo level value not nil")
return level.Value.X, level.Value.Y, level.Value.Z
end
yield("/echo level value is nil")
end
end
end
end
end
return 0, 0, 0
end
local x,y,z = GetAetheryteRawPos(210)
yield("/echo "..x..", "..y..", "..z)