diff options
Diffstat (limited to 'example/serverdata')
-rw-r--r-- | example/serverdata/scripts/maps/desert.lua | 32 | ||||
-rw-r--r-- | example/serverdata/scripts/npcs/barber.lua | 4 |
2 files changed, 34 insertions, 2 deletions
diff --git a/example/serverdata/scripts/maps/desert.lua b/example/serverdata/scripts/maps/desert.lua new file mode 100644 index 00000000..6491b8ca --- /dev/null +++ b/example/serverdata/scripts/maps/desert.lua @@ -0,0 +1,32 @@ +---------------------------------------------------------- +-- Tulimshar Bazaar -- +---------------------------------------------------------------------------------- +-- Copyright 2008 The Mana World Development Team -- +-- -- +-- This file is part of The Mana World. -- +-- -- +-- The Mana World is free software; you can redistribute it and/or modify it -- +-- under the terms of the GNU General Public License as published by the Free -- +-- Software Foundation; either version 2 of the License, or any later version. -- +---------------------------------------------------------------------------------- + +-- From scripts/ +require "scripts/lua/npclib" +-- From example/serverdata/scripts +require "scripts/npcs/banker" +require "scripts/npcs/barber" + +atinit(function() + create_npc("Barber", 100, 14 * TILESIZE + TILESIZE / 2, 9 * TILESIZE + TILESIZE / 2, Barber, nil) + create_npc("Barber 2", 100, 20 * TILESIZE + TILESIZE / 2, 11 * TILESIZE + TILESIZE / 2, npclib.talk(Barber, {14, 15, 16}, {}), nil) + create_npc("Banker", 149, 35 * TILESIZE + TILESIZE / 2, 24 * TILESIZE + TILESIZE / 2, Banker, nil) + + create_npc("Test", 102, 4 * TILESIZE + TILESIZE / 2, 25 * TILESIZE + TILESIZE / 2, npclib.talk(Test, "String1", "String2", "String3", "Etc"), nil) +end) + +function Test(npc, ch, list) + for i = 1, #list do + do_message(npc, ch, list[i]) + end + do_npc_close(npc, ch) +end diff --git a/example/serverdata/scripts/npcs/barber.lua b/example/serverdata/scripts/npcs/barber.lua index 24ad8c9b..bf872a0c 100644 --- a/example/serverdata/scripts/npcs/barber.lua +++ b/example/serverdata/scripts/npcs/barber.lua @@ -92,7 +92,7 @@ function Barber(npc, ch, data) -- Repeat until the user selects nothing repeat if (result == 1) then -- Do styles - result = do_choice(npc, ch, "Bald", styles, "Supprise me", "Never mind") + result = do_choice(npc, ch, "Bald", styles, "Surprise me", "Never mind") result = result -1 @@ -114,7 +114,7 @@ function Barber(npc, ch, data) result = 3 end elseif (result == 2) then -- Do colors - result = do_choice(npc, ch, colors, "Supprise me", "Never mind") + result = do_choice(npc, ch, colors, "Surprise me", "Never mind") --Random if (result == #colors + 1) then |