From 68c0625ee9a3a01090f0bc93612bf84dd71eaa67 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Sat, 15 Mar 2008 00:01:09 +0000 Subject: Implemented script binding for controllig movement of beings and fixed a crash caused by the new blocking system (thanks to peavey for reporting). --- data/test.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'data/test.lua') diff --git a/data/test.lua b/data/test.lua index 556ce33..d4a161d 100644 --- a/data/test.lua +++ b/data/test.lua @@ -6,6 +6,7 @@ atinit(function() create_npc(110, 50 * 32 + 16, 19 * 32 + 16, my_npc1) create_npc(108, 51 * 32 + 16, 25 * 32 + 16, my_npc4) create_npc(126, 45 * 32 + 16, 25 * 32 + 16, my_npc5) + create_npc(122, 58 * 32 + 16, 15 * 32 + 16, my_npc6) end) function my_npc1(npc, ch) @@ -73,4 +74,18 @@ function my_npc5(npc, ch) tmw.monster_create(1012, 46 * 32 + 16, 24 * 32 + 16) tmw.monster_create(1012, 46 * 32 + 16, 26 * 32 + 16) end +end + + +local guard_position = 1 + +function my_npc6(npc, ch) + + if guard_position == 1 then + tmw.being_walk(npc, 61 * 32 + 16, 15 * 32 + 16, 400) + guard_position = 2 + else + tmw.being_walk(npc, 55 * 32 + 16, 15 * 32 + 16, 400) + guard_position = 1 + end end \ No newline at end of file -- cgit