Welcome to the Builder Academy

Question Trigger of the Day - Pawn Shop

More
25 Jul 2013 00:35 - 25 Jul 2013 00:36 #3555 by Rumble
This is a script that allows a player to sell most anything to it for 1/4 of the item's value. He buys more item types than most mobs shops typically will, but he also gives them less money than a lot of shops would, so he's useful as a player if you can't find another shop that will buy an item.
Code:
Name: 'Pawn Shop', VNum: [57771], RNum: [ 3916] Trigger Intended Assignment: Mobiles Trigger Type: Command , Numeric Arg: 100, Arg list: * Commands: if %cmd% == sell if %actor.canbeseen% if %arg% set checkobj %actor.inventory% while %checkobj% if %checkobj.name% == %arg% set object %checkobj% else set checkobj %checkobj.next_in_list% end done if %object% %send% %actor% Found %object.name% of type %object.type% switch %object.type% case LIGHT case WAND case STAFF case WEAPON case TREASURE case ARMOR case WORN case CONTAINER case LIQ CONTAINER case DUAL case GEM case FISHING POLE eval value ((%object.cost% * 4) / 10) set %actor.gold(%value%)% %purge% %object% if %value% == 1 say There you go %actor.name% I took that %object.name% off your hands for 1 gold coin. else say There you go %actor.name% I took that %object.name% off your hands for %value% gold coins. end break default say Sorry %actor.name% but I don't buy these types of items. break done else %send% %actor% You don't have a %arg% to sell. end else %send% %actor% Yes, sell, but sell what?? That is the question. end else say I don't buy from people I can't see. end else return 0 end
If this was helpful please vote or leave a review for TBA.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com
Last edit: 25 Jul 2013 00:36 by Rumble.

Please Log in or Create an account to join the conversation.

Time to create page: 0.163 seconds