Armitage reported that Fizban's trigger above didn't work. I fixed the first problem by replacing
extract number 1 %%object[%i%]%%
with
extract number 1 %object[%%i%%]%
but the follow on extracts won't work!
extract object_vnum 2 %object[%%i%%]%
extract quest_price 3 %object[%%i%%]%
Though they are the exact same format as the above working extract...
Any ideas?
Full trig below:
The echo to test the variables for "buy 1" outputs: Arg: 1 number: 1 vnum: price:
vnum and price return nothing
Name: 'Questshop', VNum: [60878], RNum: [ 4435]
Trigger Intended Assignment: Mobiles
Trigger Type: Command , Numeric Arg: 100, Arg list: *
Commands:
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
extract number 1 %object[%%i%%]%
**********moved here for testing
extract object_vnum 2 %object[%%i%%]%
extract quest_price 3 %object[%%i%%]%
%echo% arg: %arg% number: %number% vnum: %object_vnum% price: %quest_price%
**********
if %number% == %arg%
set found 1
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.questpoints% < %quest_price%
tell %actor.name% You don't have enough questpoints for that.
else
nop %actor.questpoints(-%quest_price%)%
%load% obj %object_vnum% %actor% inv
tell %actor.name% Here is your new item for %quest_price% QP.
end
elseif %cmd.mudcommand% == sell
tell %actor.name% I don't purchase items from players.
else
return 0
end