Class SellCommand
Object
NormalCommand
SellCommand
- All Implemented Interfaces:
Command
Sells an item to a shopkeeper. Syntax : sell [<amount>] <item> to <character>.
For example "sell bucket to Karcas".
- Author:
- maartenl
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTries out the sell command.Methods inherited from class NormalCommand
getAdminService, getChatService, getEventsService, getGuildService, getHelpService, getItemService, getLogService, getPersonService, getRegExpr, parseCommand, parseCommand, setCallback
-
Constructor Details
-
SellCommand
-
-
Method Details
-
run
Tries out the sell command. There are a couple of requirements that need to be met, before a successful sale takes place.- command struct. should be "sell [<amount>] <item> to <character>", for example: "sell gold ring to Karcas".
- keeper buying the item should
- exist,
- be in the same room and
- have a god==4 to indicate a "keeper" and
- has enough money
- the customer should have the item
- the item is not being wielded
- the item is not being worn
- the item itself should NOT have a attribute called "notsellable".
- the item should not contain any items
- the item is transferred into the inventory of the keeper
- money is transferred into the inventory of the customer
- continue with next item
- Specified by:
run
in interfaceCommand
- Specified by:
run
in classNormalCommand
- Parameters:
command
- the command entered.aUser
- the character doing the selling.- Returns:
- a simple displayinterface, in our case the room.
- Throws:
MudException
- if something goes wrong.
-