diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-11 18:16:16 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-11 19:27:32 +0100 |
commit | 5ff34fd2458dff28d664c90fb93f455231f8633c (patch) | |
tree | 533151e5f3002c1e24ce4d44e5cd32c66c026b51 /example/scripts/npcs/postman.lua | |
parent | b822dcee52d15d41c4186a250e73b85b16c9dc39 (diff) | |
download | manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.tar.gz manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.tar.bz2 manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.tar.xz manaserv-5ff34fd2458dff28d664c90fb93f455231f8633c.zip |
Register Lua script API functions into the global namespace
Scripts mostly execute the Mana script API, and it seems like just
unnecessary verbosity to refer to the 'mana' table all the time. This table
no longer exists now.
Reviewed-by: Erik Schilling
Diffstat (limited to 'example/scripts/npcs/postman.lua')
-rw-r--r-- | example/scripts/npcs/postman.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/example/scripts/npcs/postman.lua b/example/scripts/npcs/postman.lua index ef64b169..95e6844e 100644 --- a/example/scripts/npcs/postman.lua +++ b/example/scripts/npcs/postman.lua @@ -11,20 +11,20 @@ ---------------------------------------------------------------------------------- function post_talk(npc, ch) - mana.npc_message(npc, ch, "Hello " .. mana.being_get_name(ch)) - local strength = mana.being_get_attribute(ch, ATTR_STRENGTH) - mana.npc_message(npc, ch, "You have " .. tostring(strength) .. " strength") - mana.npc_message(npc, ch, "What would you like to do?") - local answer = mana.npc_choice(npc, ch, "View Mail", "Send Mail", "Nothing") + npc_message(npc, ch, "Hello " .. being_get_name(ch)) + local strength = being_get_attribute(ch, ATTR_STRENGTH) + npc_message(npc, ch, "You have " .. tostring(strength) .. " strength") + npc_message(npc, ch, "What would you like to do?") + local answer = npc_choice(npc, ch, "View Mail", "Send Mail", "Nothing") if answer == 1 then - local sender, post = mana.chr_get_post(ch) + local sender, post = chr_get_post(ch) if sender == "" then - mana.npc_message(npc, ch, "No Post right now, sorry") + npc_message(npc, ch, "No Post right now, sorry") else - mana.npc_message(npc, ch, tostring(sender) .. " sent you " .. tostring(post)) + npc_message(npc, ch, tostring(sender) .. " sent you " .. tostring(post)) end end if answer == 2 then - mana.npc_post(npc, ch) + npc_post(npc, ch) end end |