ID:272347
 
HOW WOULD I CREATE A REST VERB WITH THAT?? PLZ HELP IM PUZZLED


mob
var
level = 1
health = 100
max_health = 100
energy = 100
max_energy = 100
Strength = 1
Defense = 1
Magic = 1
exp = 0
max_exp = 10
var/tmp/training
var/tmp/resting

Stat() // In case you don't have something like this
stat("Level",level)
stat("Exp", "[exp]/[max_exp]")
stat("Health","[health]/[max_health]")
stat("Energy","[energy]/[max_energy]")
stat("Strength", Strength)
stat("Defense", Defense)
stat("Magic", Magic)

verb
Train()
set category = "Training"
set background = 1
//--Configuration--//
var/req_energy = 10 //amount of energy drained
var/exp_inc = 10 //amount of exp added
//-----------------//
training = !training
if(training)
if(energy < req_energy)
src << "You feel exhausted."
training=0
return
else
src << "You started training."
spawn
while(training)
if(energy < req_energy) //stop training if you dont have enough energy
src << "You feel exhausted."
training=0
return
energy -= req_energy
if(energy < 0)
energy = 0 //removes negative number
exp += exp_inc
lvl_chk() //level up check
sleep(6)
else
src << "You stopped training."

proc
lvl_chk()
spawn while(exp >= max_exp)
exp -= max_exp
lvl_up()
lvl_up()
level++
//--Stats--//
max_health += 10 //(any numbers you like)
max_energy += 10
Strength += 2
Defense += 2
Magic += 2
//---------//
max_exp *= 2 //doubles exp requirement
refresh()
src << "Level up!" //YAY!
refresh()
health = max_health
energy = max_energy
</0>
What is "that"? Also, put your code in <dm> tags, like you've been told to before.
In response to Popisfizzy
ok vm ill use diffrent training system
First off, don't shout. I did nothing to you (yet), so I don't want to be attacked by Caps Lock the moment I read your post.

Next, I'm going to try to optimistically explain to you a concept, and I want you to try and follow along.

You are continually posting in these forums, asking how to do this or that, while obviously putting insufficient self-effort into solving the issues yourself. It is not OK to post into these forums assuming that everyone wants to spend their day answering the questions you could have answered yourself, had you taken the time to research the information as you should have. What you are doing is classic help vampirism.

That said, there are two important keys to improvement here:
1) You need to understand that what you are currently doing is wrong. You can't just assume that everyone wants to solve every issue you have; you need to put forth significant effort into helping yourself before posting to the forums. This way, you're not making a new "help me" post every hour.
2) You need to take the time to learn the material properly, not just jump in and expect to make the next World of Warcraft. Start with the basics; that is, read Zilal's Beginner Tutorial, read the DM Guide (there's a reason everyone says this, and it's not because we like repeating ourselves), and look through a good demo or two (such as hub://Dantom.YourFirstWorld and hub://Deadron.StepBYOND). From there, experiment on your own and try to learn more intermediate concepts, perhaps those demonstrated in various demo resources or in helpful programming articles. Don't expect everything to happen at once! Programming is an art that takes some time to get used to.

Once you've put such effort into learning the foundation material, then try making your games. When you come to a road-block, an "I'm not sure what to do here" obstacle, try and solve it yourself. Look at your available resources. If you can't find a starting place, or you're just completely stumped, then come to the How-To forums and ask your questions, describing perhaps the effort you've already put into solving the problem (others are more inclined to lessen your load if they know you've been working hard). If you think you have an idea of how you might solve a problem, but nothing you try seems to work, ask in Code Problems (be sure to post what you tried that didn't work).

Hopefully you're as interested as I am in cleansing this community of help vampires. If you are willing to take the next step forward, the community will be here to help.

Thank you.