server/src/scripts/hse-grails.lua

27 lines
605 B
Lua
Raw Normal View History

function write_grails(file)
2005-01-08 12:40:14 +01:00
grails = {}
for f in factions() do
for u in f.units do
if u:get_item("grail") > 0 then
if grails[f.id] == nil then
grails[f.id] = u:get_item("grail")
else
grails[f.id] = grails[f.id] + u:get_item("grail")
2005-01-08 12:40:14 +01:00
end
end
end
end
file:write("Parteien mit mehr oder weniger als einem Gral:\n")
for k in factions() do
v = 0
if grails[k.id] ~= nil then
v = grails[k.id]
end
if v~= 1 then
2005-01-08 12:40:14 +01:00
file:write("- " .. v .. " Grale: " .. k.name .. " (" .. itoa36(k.id) .. ")\n")
end
end
end