server/scripts/eressea/eternath.lua
Enno Rehling d9457a2488 rewrite of the Lua module system.
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)
2014-07-26 22:52:25 +02:00

36 lines
764 B
Lua

-- DEPRECATED
-- implements parts of a quest in E2
-- this module is deprecated, because it puts functions in the global environment for at_building_action
local gates = require('eressea.gates')
local b1 = nil
local b2 = nil
function eternathgate_action(b)
if b1 == nil then
b1 = b
elseif b2 == nil then
b2 = b
else
eressea.log.error("data contains more than two Ethernath gates")
end
return 1
end
local eternath = {}
function eternath.update()
if b1 and b2 then
local units1 = gates.units(b1, size)
local units2 = gates.units(b2, size)
gates.travel(b2, units1)
gates.travel(b1, units2)
else
eressea.log.error("data contains fewer than two Ethernath gates")
end
end
return eternath