summaryrefslogtreecommitdiff
path: root/example/scripts/npcs/merchant.lua
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-04-14 15:41:33 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-04-14 15:41:33 +0200
commit0f1449567d5a2ccab9ff6fdc9975150299482834 (patch)
tree9d03df41026928cc5cecd6801a0f214fabd1d77e /example/scripts/npcs/merchant.lua
parent080ddbe822b03416934a875b2d949e3afc84fb96 (diff)
downloadmanaserv-0f1449567d5a2ccab9ff6fdc9975150299482834.tar.gz
manaserv-0f1449567d5a2ccab9ff6fdc9975150299482834.tar.bz2
manaserv-0f1449567d5a2ccab9ff6fdc9975150299482834.tar.xz
manaserv-0f1449567d5a2ccab9ff6fdc9975150299482834.zip
Simplified some script function names
npc_message -> say npc_choice -> ask npc_ask_integer -> ask_number npc_ask_string -> ask_string npc_trade -> trade
Diffstat (limited to 'example/scripts/npcs/merchant.lua')
-rw-r--r--example/scripts/npcs/merchant.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/example/scripts/npcs/merchant.lua b/example/scripts/npcs/merchant.lua
index bcec5fa0..185ce342 100644
--- a/example/scripts/npcs/merchant.lua
+++ b/example/scripts/npcs/merchant.lua
@@ -12,8 +12,6 @@
function Merchant(npc, ch, buy_sell_table)
- local say = npc_message
-
-- Important note: You can add two tables made of trinoms here when calling the
-- merchant function. E.g.: Merchant(npc, ch, buy_table, sell_table)
-- Even though, the function here will see only one table:
@@ -54,7 +52,7 @@ function Merchant(npc, ch, buy_sell_table)
table.insert (choice_table, "Tell me about the objects on this map")
table.insert (choice_table, "Nevermind...")
- local v = npc_choice(choice_table)
+ local v = ask(choice_table)
--Debug and learning purpose
--for i,k in ipairs(choice_table) do print(i,k) end
@@ -65,7 +63,7 @@ function Merchant(npc, ch, buy_sell_table)
if v == 1 then
-- "To buy."
- local buycase = npc_trade(false, buy_sell_table[1])
+ local buycase = trade(false, buy_sell_table[1])
if buycase == 0 then
say "What do you want to buy?"
elseif buycase == 1 then
@@ -78,7 +76,7 @@ function Merchant(npc, ch, buy_sell_table)
if buy_sell_table[2] == nil then
-- "To sell stuff..."
- local sellcase = npc_trade(true)
+ local sellcase = trade(true)
if sellcase == 0 then
say "Ok, what do you want to sell?"
elseif sellcase == 1 then
@@ -88,7 +86,7 @@ function Merchant(npc, ch, buy_sell_table)
end
else
-- "Can you make me a price for what I have?"
- local sellcase = npc_trade(true, buy_sell_table[2])
+ local sellcase = trade(true, buy_sell_table[2])
if sellcase == 0 then
say "Here we go:"
elseif sellcase == 1 then