summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example/clientdata/npcs.xml1
-rw-r--r--example/serverdata/scripts/maps/desert.lua13
2 files changed, 12 insertions, 2 deletions
diff --git a/example/clientdata/npcs.xml b/example/clientdata/npcs.xml
index f94ce494..8fe40030 100644
--- a/example/clientdata/npcs.xml
+++ b/example/clientdata/npcs.xml
@@ -14,6 +14,7 @@
<npc id="5"><sprite variant="4">npcs/static-npcs.xml</sprite></npc><!-- Smith -->
<!-- ... -->
<npc id="8"><sprite variant="7">npcs/static-npcs.xml</sprite></npc><!-- Banker -->
+ <npc id="9"><sprite variant="8">npcs/static-npcs.xml</sprite></npc><!-- Tamer -->
<!-- ... -->
<npc id="11"><sprite variant="10">npcs/static-npcs.xml</sprite></npc><!-- Welcoming girl -->
</npcs>
diff --git a/example/serverdata/scripts/maps/desert.lua b/example/serverdata/scripts/maps/desert.lua
index 70db78cb..a838ee14 100644
--- a/example/serverdata/scripts/maps/desert.lua
+++ b/example/serverdata/scripts/maps/desert.lua
@@ -35,9 +35,11 @@ atinit(function()
smith_buy_table = { {5, 10, 50}, {7, 10, 70} }
create_npc("Smith", 5, 15 * TILESIZE + TILESIZE / 2, 16 * TILESIZE + TILESIZE / 2, npclib.talk(Merchant, smith_buy_table), nil)
-
-- The most simple NPC - Welcoming new ones around.
create_npc("Harmony", 11, 4 * TILESIZE + TILESIZE / 2, 25 * TILESIZE + TILESIZE / 2, npclib.talk(Harmony, "Welcome in the template world!\nI hope you'll find here whatever you were searching for.", "Do look around to find some interesting things coming along!"), Harmony_update)
+
+ -- Creates a Monster an let it talk for testing purpose.
+ create_npc("Tamer", 9, 28 * TILESIZE + TILESIZE / 2, 21 * TILESIZE + TILESIZE / 2, Tamer, nil)
end)
-- Global variable used to know whether Harmony talked to someone.
@@ -74,4 +76,11 @@ function Harmony_update(npc)
mana.being_say(npc, "Hey! You're new! Come here...")
end
end
-end \ No newline at end of file
+end
+
+function Tamer(npc, ch, list)
+ mana.being_say(npc, "I will now spawn a monster for your training session.")
+
+ local m1 = mana.monster_create(1, mana.posX(ch), mana.posY(ch))
+ schedule_in(0.3, function() mana.being_say(m1, "Roaaarrrr!!!") end)
+end