diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2011-08-04 23:31:17 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-08-10 21:09:27 +0200 |
commit | 38eb4fa16f9ac0775bb4cab968c13ef594d355e1 (patch) | |
tree | 2f70b2a5b2a3b6989317912c8bdc6d91218eb853 /example/serverdata | |
parent | f57ff09c26cf1cb441e20e5798c78ff4c43c04a2 (diff) | |
download | manaserv-38eb4fa16f9ac0775bb4cab968c13ef594d355e1.tar.gz manaserv-38eb4fa16f9ac0775bb4cab968c13ef594d355e1.tar.bz2 manaserv-38eb4fa16f9ac0775bb4cab968c13ef594d355e1.tar.xz manaserv-38eb4fa16f9ac0775bb4cab968c13ef594d355e1.zip |
Made chr_inv_count and npc_trade capable of taking a name or an id.
Resolves: Mana-Mantis #318.
Reviewed-by: Bertram.
Diffstat (limited to 'example/serverdata')
-rw-r--r-- | example/serverdata/scripts/maps/desert.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/example/serverdata/scripts/maps/desert.lua b/example/serverdata/scripts/maps/desert.lua index b2eb9a46..6d88b374 100644 --- a/example/serverdata/scripts/maps/desert.lua +++ b/example/serverdata/scripts/maps/desert.lua @@ -28,12 +28,12 @@ atinit(function() create_npc("Banker", 8, 35 * TILESIZE + TILESIZE / 2, 24 * TILESIZE + TILESIZE / 2, Banker, nil) -- A simple merchant. - merchant_buy_table = { {1, 10, 20}, {2, 10, 30}, {3, 10, 50} } - merchant_sell_table = { {1, 10, 19}, {5, 10, 30}, {6, 10, 200}, {7, 10, 300} } + merchant_buy_table = { {"Candy", 10, 20}, {"Regenerative trinket", 10, 30}, {"Minor health potion", 10, 50} } + merchant_sell_table = { {"Candy", 10, 19}, {"Sword", 10, 30}, {"Bow", 10, 200}, {"Leather shirt", 10, 300} } create_npc("Merchant", 3, 4 * TILESIZE + TILESIZE / 2, 16 * TILESIZE + TILESIZE / 2, npclib.talk(Merchant, merchant_buy_table, merchant_sell_table), nil) -- Another Merchant, selling some equipment, and buying everything... - smith_buy_table = { {5, 10, 50}, {7, 10, 70} } + smith_buy_table = { {"Sword", 10, 50}, {7, 10, 70} } create_npc("Smith", 5, 15 * TILESIZE + TILESIZE / 2, 16 * TILESIZE + TILESIZE / 2, npclib.talk(Merchant, smith_buy_table), nil) -- The most simple NPC - Welcoming new ones around. @@ -85,6 +85,7 @@ function Harmony_update(npc) end function Tamer(npc, ch, list) + mana.being_say(npc, string.format("You have %s Swords.", mana.chr_inv_count(ch, "Sword"))) mana.being_say(npc, string.format("You are %s pixel away.", mana.get_distance(npc, ch))) mana.being_say(npc, "I will now spawn a monster for your training session.") |