server/scripts/tools/reimburse.lua

38 lines
1,007 B
Lua
Raw Permalink Normal View History

2014-04-25 08:41:52 +02:00
function main()
for f in factions() do
if f.race=="demon" then
f.flags = 2147484672
2014-04-25 08:41:52 +02:00
for u in f.units do
u.building.size = 2
u.building.name = u.region.name .. " Keep"
u.name = "Lord " .. u.region.name
u:add_item("money", 1000-u:get_item("money"))
2014-04-25 08:41:52 +02:00
end
else
u = f.units()
u:add_item("money", 1000-u:get_item("money"))
u:add_item("adamantium", 1-u:get_item("adamantium"))
end
end
for r in regions() do for u in r.units do
print(u)
things = ""
comma = ""
for i in u.items do
things = things .. comma .. u:get_item(i) .. " " .. i
comma = ", "
end
print(' - ' .. things)
end end
end
if eressea==nil then
print("this script is part of eressea")
else
read_xml()
2014-04-25 08:41:52 +02:00
eressea.read_game('0.dat')
main()
eressea.write_game('0.dat')
print('done')
end