server/src/scripts/eressea/xmas2005.lua

32 lines
713 B
Lua
Raw Normal View History

function usepotion_message(u, potion)
2005-12-25 20:13:51 +01:00
msg = message("usepotion")
msg:set_unit("unit", u)
msg:set_resource("potion", potion)
2005-12-25 20:13:51 +01:00
return msg
end
function use_stardust(u, amount)
local p = u.region:get_resource("peasant")
p = math.ceil(1.5 * p)
u.region:set_resource("peasant", p)
local msg = usepotion_message(u, "stardust")
msg:send_region(u.region)
u:add_item("stardust", -amount)
return 0
2005-12-25 20:13:51 +01:00
end
2005-12-18 19:09:53 +01:00
function xmas2005()
if get_gamename() == "Eressea" then
if not get_flag("xm05") then
print("Es weihnachtet sehr (2005)")
2005-12-18 19:09:53 +01:00
set_flag("xm05", true)
for f in factions() do
f:add_item("stardust", 1)
f:add_notice("santa2005")
end
end
end
end
xmas2005()