-
Notifications
You must be signed in to change notification settings - Fork 402
Expand file tree
/
Copy pathquestRewards.lua
More file actions
34 lines (33 loc) · 1.38 KB
/
Copy pathquestRewards.lua
File metadata and controls
34 lines (33 loc) · 1.38 KB
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
if not loadStatFile then
dofile("statdesc.lua")
end
loadStatFile("stat_descriptions.csd")
local out = io.open("../Data/QuestRewards.lua", "w")
out:write('-- This file is automatically generated, do not edit!\n')
out:write('-- Item data (c) Grinding Gear Games\n\nreturn {\n')
for _, pin in pairs(dat("MapPins"):GetRowList("HasReward", true)) do
if #pin.ShowFlags == 1 then
local questReward = dat("QuestStaticRewards"):GetRow("QuestFlag", pin.ShowFlags[1])
if questReward then
out:write('\t{\n')
out:write('\t\t["Act"] = ', pin.Act, ',\n')
out:write('\t\t["Area"] = "', pin.Name, '",\n')
local stats = { }
local hasStat = false
for i, stat in pairs(questReward.Stats) do
hasStat = true
local statValue = questReward.StatValues[i]
stats[stat.Id] = { min = statValue, max = statValue }
end
if hasStat then
out:write('\t\t["Stat"] = "', table.concat(describeStats(stats), ","), '",\n')
end
out:write('\t\t["questPoints"] = ', questReward.WeaponSetPointsRewarded, ',\n')
local worldArea = dat("WorldAreas"):GetRow("Id", pin.BaseMapPin.Id)
out:write('\t\t["AreaLevel"] = ', worldArea.AreaLevel, ',\n')
out:write('\t},\n')
end
end
end
out:write('}')
out:close()