server/src/scripts/hse-grails.lua
Enno Rehling 03b2543d30 Renaming a lot of the HSE script files, because they are more generic than I
thought they would be and can be reused.

Added HSE4 rules files.

Added sorting by Race to the mapper's newfaction list, which might be a bad
idea for automated seeding.
2005-02-18 09:34:12 +00:00

26 lines
605 B
Lua

function write_grails(file)
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")
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
file:write("- " .. v .. " Grale: " .. k.name .. " (" .. itoa36(k.id) .. ")\n")
end
end
end