diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_fr> | 2010-05-28 02:59:45 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_fr> | 2010-05-28 03:42:16 +0200 |
commit | 39b00578c249a3396bb03faa92bc9cccdcb1c68a (patch) | |
tree | fb9376dd3229f37c4b8d988c569493178ee130bd /src/game-server/buysell.hpp | |
parent | e6ce3d52648aec7139f1c3383a0ef0921411f0d4 (diff) | |
download | manaserv-39b00578c249a3396bb03faa92bc9cccdcb1c68a.tar.gz manaserv-39b00578c249a3396bb03faa92bc9cccdcb1c68a.tar.bz2 manaserv-39b00578c249a3396bb03faa92bc9cccdcb1c68a.tar.xz manaserv-39b00578c249a3396bb03faa92bc9cccdcb1c68a.zip |
Modified the npc_trade() lua function to permit selling the whole player inventory.
It permits to open a sell box with every items in the player inventory
as requested by Striker.
Also added different return value support to both the buy selling functions,
and made fixes where relevant.
The test.lua script will be upgraded to show examples in a next commit.
What's left to be done is to fix the inventory handling for both selling
functions. (Sigh...)
Concerns: Manasource mantis: #78, #101.
Reviewed-by: Jaxad0127
Diffstat (limited to 'src/game-server/buysell.hpp')
-rw-r--r-- | src/game-server/buysell.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/game-server/buysell.hpp b/src/game-server/buysell.hpp index dc1df16d..514200ac 100644 --- a/src/game-server/buysell.hpp +++ b/src/game-server/buysell.hpp @@ -43,13 +43,21 @@ class BuySell /** * Registers an item and indicates how many the NPC is ready to trade * and how much it will cost. + * @return true if at least one item was registered. */ - void registerItem(int id, int amount, int cost); + bool registerItem(int id, int amount, int cost); + + /** + * Registers every player's item at an average cost given by the ItemDB. + * @return the number of different soldable items. + */ + int registerPlayerItems(); /** * Sends the item list to player. + * @return true if at least one item was registered before start. */ - void start(Actor *actor); + bool start(Actor *actor); /** * Performs the trade. |