ID:142628
 
Code:
mob/training
Int
name = "{NPC}Log"
icon='training Icons.dmi'
icon_state="log"
npc = 1
verb
Train()
set category = "Taaining"
set src in oview(1)
alert("[usr] Would you like to start training)", text) in list ("Yes","No"))
if("Yes")
switch(input("Get Ready?", text) in list ("Punch","Kick","Block"))
if(prob(7.5))
if("Punch")
usr.attack += usr.random
usr.mattack += usr.random
if(prob(7.5))
if("Kick")
usr.random = rand(50,81)
usr.reiatsu += usr.random
if(prob(7.5))
if("Block")
usr.random = rand(100,310)
usr.defence += usr.random


Problem description:
OK I revised the code to give the usr a prob of getting Punch Kick or block but now im Getting this error
Input Train.dm:29:error: ): expected }
Input Train.dm:27:error: location of top-most unmatched {

Ok Now im down to just the little prob
Wrath69 wrote:
Code:
> mob/training
> Int
> name = "{NPC}Log"
> icon='training Icons.dmi'
> icon_state="log"
> npc = 1
> verb
> Train()
> set category = "Taaining"
> set src in oview(1)
> alert("[usr] Would you like to start training)", text) in list ("Yes","No")) // <---- You have a needless ')' which may be causing the error.
> if("Yes")
> switch(input("Get Ready?", text) in list ("Punch","Kick","Block"))
> if(prob(7.5))
> if("Punch")
> usr.attack += usr.random
> usr.mattack += usr.random
> if(prob(7.5))
> if("Kick")
> usr.random = rand(50,81)
> usr.reiatsu += usr.random
> if(prob(7.5))
> if("Block")
> usr.random = rand(100,310)
> usr.defence += usr.random
alert("[usr] Would you like to start training)", text) in list ("Yes","No"))


You're using alert completely wrong and your indentation is completely messed up. After the alert() line, you have if("Yes"), but that does absolutely nothing. Also, the prob(7.5) line does nothing.

if(alert("[usr], would you like to start training?", "Yes", "No")=="Yes") // You did something weird before and combined alert with input
if(!prob(7.5))return//This is more like what you want
switch(input("Get Ready?", text) in list ("Punch","Kick","Block"))
if("Punch")
usr.attack += usr.random
usr.mattack += usr.random
//And so on...


Also, prob(7.5) gives a 7.5% chance of it happening, which is pretty low - less than one in ten, which would be really frustrating if the user kept hitting Train and nothing happened.