From 20fe6419f8d9564e7ab098ead53c6ef5da1519fa Mon Sep 17 00:00:00 2001 From: David Athay Date: Fri, 24 Oct 2008 15:18:02 +0000 Subject: Added post callback for getting post. Added GM command for changing player attributes. Changed GM command to @ as '/' was already being used by client for local commands. --- data/scripts/test.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'data/scripts/test.lua') diff --git a/data/scripts/test.lua b/data/scripts/test.lua index d3cd14a..344ca10 100644 --- a/data/scripts/test.lua +++ b/data/scripts/test.lua @@ -187,4 +187,14 @@ function post_talk(npc, ch) do_message(npc, ch, "Hello " .. tmw.being_get_name(ch)) local strength = tmw.being_get_attribute(ch, ATTR_STRENGTH) do_message(npc, ch, "You have " .. tostring(strength) .. " strength") + do_message(npc, ch, "Would you like to see your mail?") + local answer = do_choice(npc, ch, "Yes", "No") + if answer == 1 then + local sender, post = getpost(ch) + if sender == "" then + do_message(npc, ch, "No Post right now, sorry") + else + do_message(npc, ch, tostring(sender) .. " sent you " .. tostring(post)) + end + end end -- cgit