diff options
| author | David Athay <ko2fan@gmail.com> | 2008-10-24 15:18:02 +0000 |
|---|---|---|
| committer | David Athay <ko2fan@gmail.com> | 2008-10-24 15:18:02 +0000 |
| commit | 20fe6419f8d9564e7ab098ead53c6ef5da1519fa (patch) | |
| tree | 5313713cd9f12ca3fc503db2ceaccaa73f12a355 /data/scripts/libs/libtmw.lua | |
| parent | ef9852cddecfc5abce38438ca2138defb1a9b1bf (diff) | |
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.
Diffstat (limited to 'data/scripts/libs/libtmw.lua')
| -rw-r--r-- | data/scripts/libs/libtmw.lua | 19 |
1 files changed, 19 insertions, 0 deletions
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]; |
