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/libs/libtmw.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'data/scripts/libs/libtmw.lua') diff --git a/data/scripts/libs/libtmw.lua b/data/scripts/libs/libtmw.lua index 5df9e3c..251e20a 100644 --- a/data/scripts/libs/libtmw.lua +++ b/data/scripts/libs/libtmw.lua @@ -123,6 +123,12 @@ function get_quest_var(ch, name) return coroutine.yield(3, name) end +-- Gets the post for a user. +function getpost(ch) + tmw.chr_get_post(ch) + return coroutine.yield(3) +end + -- Processes as much of an NPC handler as possible. local function process_npc(w, ...) local co = w[2] @@ -234,6 +240,19 @@ function quest_reply(ch, name, value) states[ch] = nil end +function post_reply(ch, sender, letter) + local w = states[ch] + if w then + local w3 = w[3] + if (w3 == 3 or w3 == 4) then + if process_npc(w, sender, letter) then + return + end + end + end + states[ch] = nil +end + -- Called by the game every tick for each NPC. function npc_update(npc) local h = npc_update_functs[npc]; -- cgit