ID:164289
 
Im currently trying to make a healing skill for my assist class but on the line where it says
if("Me")
it says Im missing an expression....
mob
Assist_Skills
verb/Heal
set category = "Skill"
switch(input("Who would you like to heal?") in list("Me","Someone Else")
if("Me")
set src=usr
set category = "Skills"
if(usr.Health >= usr.Mhealth)
usr.Health = usr.Mhealth
usr.HP_MP_CHECK()
usr. << "You have full health"
else
if(Spirit < 10)
usr << "You need atleast 10 Spirit to heal."
return
Spirit -= 10
usr.Health+=10+Intelligence+rand(0,5)
usr.HP_MP_CHECK()
view() << "[src]([key]): Heal!"
usr. << "You recover some health"
usr.overlays += 'Heal.dmi'
spawn(20)
usr.overlays -= 'Heal.dmi'
if("Someone Else")
if(mob/M as mob in oview(6))
if(usr.Spirit>=10)
view() << "<b> [src]([key]) casts heal on [M]!"
M.overlays += 'Heal.dmi'
spawn(20)
M.overlays -= 'Heal.dmi'
view() << "[src]([key]): Heal!"
M << "<b>\red [usr.name] casts Heal on you!"
M.Health += 10+Intelligence+rand(0,5)
usr.Spirit -= 10
else
usr.<< "There is no one around to heal!"
Monkeykid0049 wrote:
Im currently trying to make a healing skill for my assist class but on the line where it says
if("Me")
it says Im missing an expression....


Well, it might be the 'set's that you've got in the wrong spot:
      set src=usr
set category = "Skills"


Or maybe the . that you've got after usr in this line:
      usr.<< "There is no one around to heal!"
And all the other lines like it.

Other than that, you also shouldn't be using 'usr' here you should be using 'src'. And you shouldn't be using 'view() <<' without an argument, otherwise view() defaults to usr and that can mess things up. You should specify view(src). You also should be using sleep(20) not spawn(20) if you're trying to create a delay before the rest of the code continues. (Actually I can't say that from experience, but I've never seen spawn used that way and its weird and strikes me as wrong.)
In response to Foomer
Well I changed all the usr to src and moved the sets but it still says I've got a missing expression. Also I'm not really quite sure what you mean by the view() with out an argument.
In response to Monkeykid0049
Does it tell you what line the missing expression is on?
In response to Foomer
Its still the
if("Me")
In response to Monkeykid0049
Oh, I overlooked that part. That's because the before it is missing a ) at the end.
In response to Foomer
Yeah i know that but I have the ) and it still says I'm missing an expression on that same line.

mob
Assist_Skills
verb/Heal
set category = "Skill"
switch(input("Who would you like to heal?") in list("Me","Someone Else")
if("Me")

In response to Monkeykid0049
You don't have the ). Look at it closely:

switch(input("Who would you like to heal?") in list("Me","Someone Else")


I count 1...2...3 ('s in this line. How many )'s are there?
In response to Foomer
Hmmm...now I've got 7 errors and 2 warnings
mob
Assist_Skills
verb/Heal()
set category = "Skill"
switch(input("Who would you like to heal?") in list("Me","Someone Else"))
if("Me")
set category = "Skills"
if(src.Health >= src.Mhealth)
src.Health = src.Mhealth
src.HP_MP_CHECK()
src. << "You have full health"
else
if(Spirit < 10)
src << "You need atleast 10 Spirit to heal."
return
Spirit -= 10
src.Health+=10+Intelligence+rand(0,5)
src.HP_MP_CHECK()
view() << "[src]([key]): Heal!"
src. << "You recover some health"
src.overlays += 'Heal.dmi'
sleep(20)
src.overlays -= 'Heal.dmi'
if("Someone Else")
if(mob/M as mob in oview(6))//mob:undefined var and M:undefined var and warning: statement has no effect and unused label
if(src.Spirit>=10)
view() << "<b> [src]([key]) casts heal on [M.]!"//M: undefined var
M.overlays += 'Heal.dmi'//M.overlays:undefined var as well
sleep(20)
M.overlays -= 'Heal.dmi'//same thing as before
view() << "[src]([key]): Heal!"
M << "<b>\red [usr.name] casts Heal on you!"//M:undefined var
M.Health += 10+Intelligence+rand(0,5)//M.Health: undefined var
src.Spirit -= 10
else
src << "There is no one around to heal!"

Lots of errors...I think I know the problem with some but I dunno
In response to Monkeykid0049
Well I sure don't know what the problem is. Maybe you should post what the errors were!
In response to Foomer
I put them after the line with the problem as seen in my previous post.
In response to Monkeykid0049
Maybe you should try using an input() to acquire the mob instead of the "if(mob/M as mob in oview(6))" line which doesn't work at all.

Failing that, your simplest alternative might be to use a for() loop, pick the first one in your loop, then break at the end. But healing the first random mob in view is kind of a dumb way to do it.
In response to Foomer
Well Im going back to my original two verbs but thanks for trying to help and sorry for wasting your time.