diff options
| author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2007-08-27 17:41:17 +0000 |
|---|---|---|
| committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2007-08-27 17:41:17 +0000 |
| commit | e2dce6bb8e122f518508c07ed6ee8431fb3e30d7 (patch) | |
| tree | 665df61555cb29cf01c2bfee7521b15e6c055ffb /src/game-server/testing.cpp | |
| parent | fb3df5df8f20cbc2e5958c64a2c70cdb98925666 (diff) | |
Enabled loading of npcs and scripts from map files.
Diffstat (limited to 'src/game-server/testing.cpp')
| -rw-r--r-- | src/game-server/testing.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/game-server/testing.cpp b/src/game-server/testing.cpp index cbff614..cf125ca 100644 --- a/src/game-server/testing.cpp +++ b/src/game-server/testing.cpp @@ -22,19 +22,6 @@ static void dropItem(MapComposite *map, int x, int y, int type) GameState::insert(i); } -static char const *npc1 = - "local nb_times = 1\n" - "function npc_handler(npc, ch)\n" - " do_message(npc, ch, \"You know what?\")\n" - " do_message(npc, ch, string.format(\"I have already asked this question %d times today.\", nb_times))\n" - " nb_times = nb_times + 1\n" - "end\n"; - -static char const *npc2 = - "function npc_handler(npc, ch)\n" - " do_message(npc, ch, \"Don't you think the guy behind me is my evil twin?\")\n" - "end\n"; - void testingMap(MapComposite *map) { switch (map->getID()) @@ -44,23 +31,6 @@ void testingMap(MapComposite *map) // Drop some items. dropItem(map, 58 * 32 + 16, 20 * 32 + 16, 508); dropItem(map, 58 * 32 + 16, 21 * 32 + 16, 524); - - // Create a Lua context. - if (Script *s = Script::create("lua")) - { - // Load a script. - s->loadFile("test.lua"); - - // Create two NPCs. - s->loadNPC(107, 53 * 32 + 16, 21 * 32 + 16, npc1); - s->loadNPC(107, 53 * 32 + 16, 23 * 32 + 16, npc2); - - // Associate the script context to the map. - map->setScript(s); - s->setMap(map); - s->prepare("initialize"); - s->execute(); - } } break; } } |
