diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-05-19 15:07:45 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-05-19 15:07:45 +0000 |
commit | 502d5c892c92b4a71eceae1d275032100d42dd23 (patch) | |
tree | 81f29c3ce0bda3d2a4221a485c9695d4e56eb568 /data/scripts | |
parent | 4b4b6d0865f5f04f73e04926fb9e6b610f0a71a7 (diff) | |
download | manaserv-502d5c892c92b4a71eceae1d275032100d42dd23.tar.gz manaserv-502d5c892c92b4a71eceae1d275032100d42dd23.tar.bz2 manaserv-502d5c892c92b4a71eceae1d275032100d42dd23.tar.xz manaserv-502d5c892c92b4a71eceae1d275032100d42dd23.zip |
Implemented NPC names. Implemented the theoretical possibility to have named monsters along the way. Note that the syntax of the LUA functions for creating NPCs has changed.
Diffstat (limited to 'data/scripts')
-rw-r--r-- | data/scripts/libtmw.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/data/scripts/libtmw.lua b/data/scripts/libtmw.lua index 0eabf1bc..681b4340 100644 --- a/data/scripts/libtmw.lua +++ b/data/scripts/libtmw.lua @@ -38,8 +38,8 @@ local timer -- Creates an NPC and associates the given handler. -- Note: Cannot be called until map initialization has started. -function create_npc(id, x, y, talkfunct, updatefunct) - local npc = tmw.npc_create(id, x, y) +function create_npc(name, id, x, y, talkfunct, updatefunct) + local npc = tmw.npc_create(name, id, x, y) if talkfunct then npc_talk_functs[npc] = talkfunct end if updatefunct then npc_update_functs[npc] = updatefunct end end @@ -228,10 +228,10 @@ end -- Called by the game for creating NPCs embedded into maps. -- Delays the creation until map initialization is performed. -- Note: Assumes that the "npc_handler" global field contains the NPC handler. -function create_npc_delayed(id, x, y) +function create_npc_delayed(name, id, x, y) -- Bind the name to a local variable first, as it will be reused. local h = npc_handler - atinit(function() create_npc(id, x, y, h, nil) end) + atinit(function() create_npc(name, id, x, y, h, nil) end) npc_handler = nil end |