diff options
| author | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-15 00:01:09 +0000 |
|---|---|---|
| committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-15 00:01:09 +0000 |
| commit | 68c0625ee9a3a01090f0bc93612bf84dd71eaa67 (patch) | |
| tree | d1cd93e73bb2e5a2746f8cbd2c1cfac2c5dcce39 /data/test.lua | |
| parent | 4736ec595c1ed46f8b076f89bc31660ae21e9231 (diff) | |
Implemented script binding for controllig movement of beings and fixed a crash caused by the new blocking system (thanks to peavey for reporting).
Diffstat (limited to 'data/test.lua')
| -rw-r--r-- | data/test.lua | 15 |
1 files changed, 15 insertions, 0 deletions
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 |
