From 05de4c0aa765fb1a448687c068ddae9ecd880542 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Thu, 7 Feb 2008 01:18:39 +0000 Subject: Implemented LUA callback function for creating monsters. --- data/test.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'data/test.lua') 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 -- cgit v1.2.3-60-g2f50