forked from github/server
d9457a2488
At this time, only E2 is working. Fixing a lot of old code (monster is no longer id 0). package.paths configured from eressea.ini install directory configured from eressea.ini moving building_action into a seaprate module (it's deprecated)
31 lines
712 B
Lua
31 lines
712 B
Lua
function usepotion_message(u, potion)
|
|
msg = message.create("usepotion")
|
|
msg:set_unit("unit", u)
|
|
msg:set_resource("potion", potion)
|
|
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:use_pooled("stardust", amount)
|
|
return 0
|
|
end
|
|
|
|
local self = {}
|
|
|
|
function self.update()
|
|
if not get_key("xm05") then
|
|
print("Es weihnachtet sehr (2005)")
|
|
set_key("xm05", true)
|
|
for f in factions() do
|
|
f:add_item("stardust", 1)
|
|
f:add_notice("santa2005")
|
|
end
|
|
end
|
|
end
|
|
|
|
return self
|