here is a custom command i made for the dice game, so that when you type 'bet' it is issued as a real command. i can't guarantee that my 'code' is perfect, or even efficient, but between the example here and the help file, it should help someone. i do see a cpl things i could have done better. for ex: #@dicemaster = %getMobPointer( vnum ) would most likely have been a better method, rather than a keyword.
Code:
custom_command_act
bet
Code:
if %isNpc( @actor )
return
endif
@gold = %getCharStat( @actor, gold )
@dicemaster = %getMobPointer( dicemaster )
if @gold < 1000
talk @actor You must have at least 1000 coins to play the dice games.
return
endif
protect
{
if %getVar( wager )
talk @actor Only one player at a time please.
return
endif
}
endprotect
@input = @arguments
@input = %stringToWords( @input )
@input = %filterActionWords( @input )
%setEntityVar( @i, wager, @input->1 )
%setEntityVar( @i, player, %getShortName( @actor ) )
*%setEntityVar( @i, player, @actor )
if %getVar( wager ) > %getCharStat( @actor, gold )
talk @actor You don't even have that many coins!
%deleteEntityVar( @i, wager )
%deleteEntityVar( @i, player )
return
else
talk @actor You placed a %( @input->1 ) coin wager on %( @input->2 ).
endif
if %( @input->2 ) == triple
%callScript( @dicemaster, triple_bigsmall, @actor )
else
if %( @input->2 ) == big
%callScript( @dicemaster, big_bigsmall, @actor )
else
if %( @input->2 ) == small
%callScript( @dicemaster, small_bigsmall, @actor )
else
wait 2 secs
talk @actor I think you made a mistake with your bet.
%deleteEntityVar( @i, wager )
%deleteEntityVar( @i, player )
endif
endif
endif