From 6212b884268da5ff9eed5eb4ae3294766cc4bbef Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 19 Dec 2009 23:17:55 +0000 Subject: [PATCH] christmas 2009 --- src/scripts/e3a/xmas2009.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/scripts/e3a/xmas2009.lua diff --git a/src/scripts/e3a/xmas2009.lua b/src/scripts/e3a/xmas2009.lua new file mode 100644 index 000000000..c29c93bba --- /dev/null +++ b/src/scripts/e3a/xmas2009.lua @@ -0,0 +1,23 @@ +function xmas2009() + if not get_key("xm09") then + print("Es weihnachtet sehr (2009)") + set_key("xm09", true) + for f in factions() do + f:add_item("xmastree", 1) + f:add_notice("santa2006") + end + end +end + +function use_xmastree(u, amount) + if u.region.herb~=nil then + local trees = u.region:get_resource("tree") + u.region:set_resource("tree", 10+trees) + u:use_pooled("xmastree", amount) + local msg = message.create("usepotion") + msg:set_unit("unit", u) + msg:set_resource("potion", "xmastree") + msg:send_region(u.region) + return 0 + end +end