summaryrefslogtreecommitdiff
path: root/example/scripts/npcs/postman.lua
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-04-14 15:10:06 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-04-14 15:10:06 +0200
commit080ddbe822b03416934a875b2d949e3afc84fb96 (patch)
tree8915d1c92fdd0e609952afc492cbc3ea1152d1ae /example/scripts/npcs/postman.lua
parent3a132996f798dbf552ac858b06fa656b6790a501 (diff)
downloadmanaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.gz
manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.bz2
manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.xz
manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.zip
Removed NPC and character parameters from NPC functions
These functions can only be used in the context of a character talking to an NPC, so these parameters can be deduced from that context rather than passing them explicitly all the time. Simplifies NPC scripting.
Diffstat (limited to 'example/scripts/npcs/postman.lua')
-rw-r--r--example/scripts/npcs/postman.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/example/scripts/npcs/postman.lua b/example/scripts/npcs/postman.lua
index 95e6844e..c0901f8d 100644
--- a/example/scripts/npcs/postman.lua
+++ b/example/scripts/npcs/postman.lua
@@ -11,17 +11,17 @@
----------------------------------------------------------------------------------
function post_talk(npc, ch)
- npc_message(npc, ch, "Hello " .. being_get_name(ch))
+ npc_message("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")
+ npc_message("You have " .. tostring(strength) .. " strength")
+ npc_message("What would you like to do?")
+ local answer = npc_choice("View Mail", "Send Mail", "Nothing")
if answer == 1 then
local sender, post = chr_get_post(ch)
if sender == "" then
- npc_message(npc, ch, "No Post right now, sorry")
+ npc_message("No Post right now, sorry")
else
- npc_message(npc, ch, tostring(sender) .. " sent you " .. tostring(post))
+ npc_message(tostring(sender) .. " sent you " .. tostring(post))
end
end
if answer == 2 then