From 0b10fd63ad74a5c1fad4e1cc59e2b623e7049e44 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Thu, 27 Jan 2011 01:31:17 +0100 Subject: Updates to the example data. - Fixed monsters Id. - Added collision layer to the desert map. - Added a few simple NPCs on the map (They still need a sprite.) - Added player and hairstyles sprites files and definition in items.xml. --- example/serverdata/scripts/maps/desert.lua | 32 ++++++++++++++++++++++++++++++ example/serverdata/scripts/npcs/barber.lua | 4 ++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 example/serverdata/scripts/maps/desert.lua (limited to 'example/serverdata') diff --git a/example/serverdata/scripts/maps/desert.lua b/example/serverdata/scripts/maps/desert.lua new file mode 100644 index 0000000..6491b8c --- /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 24ad8c9..bf872a0 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 -- cgit