summaryrefslogtreecommitdiff
path: root/data/test.lua
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-11 09:52:32 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-11 09:52:32 +0000
commit797f8b0f29d8cfcefe8777bf337d75406210f71c (patch)
tree85833a464cbf80959c5f14f384249e409f686dce /data/test.lua
parentde75c0a271c06e5569ec280ea04daadb9d4fea0c (diff)
downloadmanaserv-797f8b0f29d8cfcefe8777bf337d75406210f71c.tar.gz
manaserv-797f8b0f29d8cfcefe8777bf337d75406210f71c.tar.bz2
manaserv-797f8b0f29d8cfcefe8777bf337d75406210f71c.tar.xz
manaserv-797f8b0f29d8cfcefe8777bf337d75406210f71c.zip
Added Lua functions for handling inventories.
Diffstat (limited to 'data/test.lua')
-rw-r--r--data/test.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/data/test.lua b/data/test.lua
index 5252b825..6b914634 100644
--- a/data/test.lua
+++ b/data/test.lua
@@ -107,9 +107,20 @@ function my_npc1(npc, ch)
do_message(npc, ch, "Hello! I am the testing NPC")
do_message(npc, ch, "This message is just here for testing intertwined connections.")
do_message(npc, ch, "What do you want?")
- local v = do_choice(npc, ch, "Guns! Lots of guns!", "Nothing.")
+ local v = do_choice(npc, ch, "Guns! Lots of guns!", "A christmas party!", "Nothing.")
if v == 1 then
do_message(npc, ch, "Sorry, this is a heroic-fantasy game, I do not have any gun.")
+ elseif v == 2 then
+ local n1, n2 = tmw.chr_inv_count(ch, 524, 511)
+ if n1 == 0 or n2 ~= 0 then
+ do_message(npc, ch, "Yeah right...")
+ else
+ do_message(npc, ch, "I can't help you with the party. But I see you have a fancy hat. I could change it into a santa hat. Not much of a party, but it would get you going.")
+ v = do_choice(npc, ch, "Please do.", "No way! Fancy hats are classier.")
+ if v == 1 then
+ tmw.chr_inv_change(ch, 524, -1, 511, 1)
+ end
+ end
end
end