From 61f0bc66af21de12fa3254abbc75a44463ac6a03 Mon Sep 17 00:00:00 2001 From: Warmist Date: Mon, 26 Mar 2012 18:12:32 +0300 Subject: [PATCH] small changes to tools(lua) --- plugins/Dfusion/luafiles/tools/init.lua | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/plugins/Dfusion/luafiles/tools/init.lua b/plugins/Dfusion/luafiles/tools/init.lua index 6f1384baa..2d86cec07 100644 --- a/plugins/Dfusion/luafiles/tools/init.lua +++ b/plugins/Dfusion/luafiles/tools/init.lua @@ -260,7 +260,7 @@ function tools.changesite(names) print(string.format("%x->%d",off,n2)) engine.poke(off,ptr_site.type,n2) end -function tools.empregnate(unit) +function tools.project(unit) if unit==nil then unit=getSelectedUnit() end @@ -270,10 +270,25 @@ function tools.empregnate(unit) end if unit==nil then - error("Failed to empregnate. Unit not selected/valide") + error("Failed to project unit. Unit not selected/valid") + end + -- todo: add projectile to world, point to unit, add flag to unit, add gen-ref to projectile. +end +function tools.empregnate(unit) + if unit==nil then + unit=getSelectedUnit() end - print(string.format("%x %x",df.sizeof(unit))) + if unit==nil then + unit=getCreatureAtPos(getxyz()) + end + + if unit==nil then + error("Failed to empregnate. Unit not selected/valid") + end + if unit.curse then + unit.curse.add_tags2.STERILE=false + end local arr1=unit.appearance.unk_51c local arr2=unit.appearance.unk_51c local created=false