Welcome to the Builder Academy

Question Intermediate Trigger of the Day - Array Questshop

More
01 Aug 2012 23:10 #508 by Rumble
By Fizban
This does the same thing as Rumble's questshop posted earlier except it's a few lines longer, but more customizable for adding more items to it in that each item only requires a single line.
Code:
if %cmd.mudcommand% == list %send% %actor% ## Available Item Cost in Questpoints %send% %actor% ------------------------------------------------------------------------- %send% %actor% 1) Unlimited War's Blood 100 %send% %actor% 2) Unlimited shadow stealer 100 %send% %actor% 3) Unlimited the staff of spellfire 100 elseif %cmd.mudcommand% == buy set object[1] 1 21 100 set object[2] 2 22 100 set object[3] 3 23 100 set i 1 set found 0 while %i% < 4 eval tmp %%object[%i%]%% extract number 1 %tmp% if %number% == %arg% extract vnum 2 %tmp% extract price 3 %tmp% set found 1 break end eval i %i% + 1 done if !%found% %send% %actor% You must provide either the number of the item you want to buy, %send% %actor% such as 'buy 1' halt end if %actor.qp% < %price% tell %actor.name% You don't have enough questpoints for that. else nop %actor.qp(-%price%)% %load% obj %vnum% %actor% tell %actor.name% Here is your new item for %price% QP. end elseif %cmd.mudcommand% == sell tell %actor.name% I don't purchase items from players. 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

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

Time to create page: 0.174 seconds