diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-07 01:18:39 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-07 01:18:39 +0000 |
commit | 05de4c0aa765fb1a448687c068ddae9ecd880542 (patch) | |
tree | 2654f4eaf1984062d9f7333d09c0064242ce154f /data/test.lua | |
parent | d4ad5de48f7f1e2a84bccd68b2584ce78fed05a4 (diff) | |
download | manaserv-05de4c0aa765fb1a448687c068ddae9ecd880542.tar.gz manaserv-05de4c0aa765fb1a448687c068ddae9ecd880542.tar.bz2 manaserv-05de4c0aa765fb1a448687c068ddae9ecd880542.tar.xz manaserv-05de4c0aa765fb1a448687c068ddae9ecd880542.zip |
Implemented LUA callback function for creating monsters.
Diffstat (limited to 'data/test.lua')
-rw-r--r-- | data/test.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/data/test.lua b/data/test.lua index 47b06519..556ce33d 100644 --- a/data/test.lua +++ b/data/test.lua @@ -5,6 +5,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) end) function my_npc1(npc, ch) @@ -62,3 +63,14 @@ function my_npc4(npc, ch) end end end + +function my_npc5(npc, ch) + do_message(npc, ch, "I am the spider tamer. Do you want me to spawn some spiders?") + local answer = do_choice(npc, ch, "Yes", "No"); + if answer == 1 then + tmw.monster_create(1012, 44 * 32 + 16, 24 * 32 + 16) + tmw.monster_create(1012, 44 * 32 + 16, 26 * 32 + 16) + tmw.monster_create(1012, 46 * 32 + 16, 24 * 32 + 16) + tmw.monster_create(1012, 46 * 32 + 16, 26 * 32 + 16) + end +end
\ No newline at end of file |