mob
verb
Rest()
set category = "Commands"
savedicon = usr.icon
savedicons = usr.icon_state
usr.icon = 'base.dmi'
usr.icon_state = "meditate"
if(src.resting)
src.resting = 2
while(usr.stamina < usr.maxstamina || usr.chakra < usr.maxchakra)
if(src.resting == 2)
usr << "You stop resting"
usr.icon = 'base.dmi'
usr.icon_state = ""
src.resting = 0
move = 1
break
else
move = 0
usr.resting = 1
usr.stamina += rand(100,500)
usr.chakra += rand(100,500)
if(usr.stamina >= usr.maxstamina && usr.chakra >= usr.maxchakra)
usr.stamina = usr.maxstamina
usr.chakra = usr.maxchakra
move = 1
break
sleep(1)
The it does not end the loop,when I do not want to continue resting.
while(usr.stamina < usr.maxstamina || usr.chakra < usr.maxchakra)
I think should be
you also want to remove all the usr in this verb and put src
or leave it empty usr is not needed
thou I cant check it you might have to add one more |