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.