ID:143274
 
Code:
mob/var
DotonRyokou=0
Bodyswitch=0

mob
verb
DotonRyokou(mob/M in oview(1))
set category = "Techs"
set name = "Doton Ryokou"
if(usr.chakra <=7000)
usr<<"You dont have enough chakra!"
return
if(usr.firing&&!usr.fseal)
usr<<"Not now."
return
if(usr.resting)
return
if(!usr.fseal&&!usr.firing)
view()<<"<font color = red>[usr]: Doton Ryokou!"
usr.fseal =1
usr.overlays = usr.overlays.Remove(usr.overlays)
usr.icon = 'Dotontravel.dmi'
usr.overlays += 'Dotondown.dmi'
sleep(7)
usr.overlays -= 'Dotondown.dmi'
usr.verbs += Bodyswitch
if(usr.fseal)
usr.chakra -=50
if(usr.chakra <= 4)
usr.overlays += 'Dotonup.dmi'
usr.fseal = 0
return
else
if(usr.fseal)
view()<<"<font color = red>[usr]: Doton Ryokou!"
usr.fseal=0
usr.overlays += 'Dotonup.dmi'
sleep(7)
usr.overlays -= 'Dotonup.dmi'
usr.icon = usr.Oicon
return
mob
verb
Bodyswitch(mob/M in oview(1))
set category = "Techs"
set name = "Body Switch"
M<<"Your body was taken underground by [usr]."
usr<<"You took [M]s body underground"
var/Sleeptime = round(usr.gen/10)
if(Sleeptime <= 1)
Sleeptime = 55
M.Frozen = 1
M.froze = 1
sleep(Sleeptime)
if(M)
M.Frozen=0
M<<"You dig your way out."
usr<<"[M] dug out from the ground!"
M.froze = 0
sleep(8)
else
M.Frozen=1
M.froze = 1
sleep(Sleeptime)
if(M)
M.Frozen=0
M<<"You dig your way out."
usr<<"[M] dug out from the ground!"
M.froze = 0
sleep(8)
sleep(100)
if(M)
M.froze=0
usr.verbs -= /mob/verb/Bodyswitch


Problem description:

This coding is for a underground traveling technique used in Naruto... The user goes underground and is able to move freely, then if the user goes nears someone, they have the option to pull the other person underground, thus immobilizing them, and allowing the user to attack freely...

The problem with my code is that i want the body switch to appear when i get near the person, and i want to be able to do the underground jutsu whenever im not in a non-pk zone... i also can't get the body switch verb to disappear once i already used it, but i want it to appear again once i go underground again...
how bout you just use jinketsu format for it and have it once your under ground and walk over them it auto pulls em underground that would be easier
In response to Mastergamerxxx
I can try that, but wouldn't it be better if i give the players a choice to pull the player down, or stay hidden?
Biggyneo88 wrote:
Code:
> mob/var
> DotonRyokou=0
> Bodyswitch=0
>
> mob
> verb
> DotonRyokou(mob/M in oview(1))
> set category = "Techs"
> set name = "Doton Ryokou"
> if(usr.chakra <=7000)
> usr<<"You dont have enough chakra!"
> return
> if(usr.firing&&!usr.fseal)
> usr<<"Not now."
> return
> if(usr.resting)
> return
> if(!usr.fseal&&!usr.firing)
> view()<<"<font color = red>[usr]: Doton Ryokou!"
> usr.fseal =1
> usr.overlays = usr.overlays.Remove(usr.overlays)
> usr.icon = 'Dotontravel.dmi'
> usr.overlays += 'Dotondown.dmi'
> sleep(7)
> usr.overlays -= 'Dotondown.dmi'
> usr.verbs += Bodyswitch
> if(usr.fseal)
> usr.chakra -=50
> if(usr.chakra <= 4)
> usr.overlays += 'Dotonup.dmi'
> usr.fseal = 0
> return
> else
> if(usr.fseal)
> view()<<"<font color = red>[usr]: Doton Ryokou!"
> usr.fseal=0
> usr.overlays += 'Dotonup.dmi'
> sleep(7)
> usr.overlays -= 'Dotonup.dmi'
> usr.icon = usr.Oicon
> return
> mob
> verb
> Bodyswitch(mob/M in oview(1))
> set category = "Techs"
> set name = "Body Switch"
> M<<"Your body was taken underground by [usr]."
> usr<<"You took [M]s body underground"
> var/Sleeptime = round(usr.gen/10)
> if(Sleeptime <= 1)
> Sleeptime = 55
> M.Frozen = 1
> M.froze = 1
> sleep(Sleeptime)
> if(M)
> M.Frozen=0
> M<<"You dig your way out."
> usr<<"[M] dug out from the ground!"
> M.froze = 0
> sleep(8)
> else
> M.Frozen=1
> M.froze = 1
> sleep(Sleeptime)
> if(M)
> M.Frozen=0
> M<<"You dig your way out."
> usr<<"[M] dug out from the ground!"
> M.froze = 0
> sleep(8)
> sleep(100)
> if(M)
> M.froze=0
> usr.verbs -= /mob/verb/Bodyswitch
>
>

Problem description:

This coding is for a underground traveling technique used in Naruto... The user goes underground and is able to move freely, then if the user goes nears someone, they have the option to pull the other person underground, thus immobilizing them, and allowing the user to attack freely...

The problem with my code is that i want the body switch to appear when i get near the person, and i want to be able to do the underground jutsu whenever im not in a non-pk zone... i also can't get the body switch verb to disappear once i already used it, but i want it to appear again once i go underground again...


Hmm, I see a couple of indent errors, not sure if you're having a problem with that though.

Mike
In response to Kichimichi
ok.. i'll play around with that
mob
verb
DotonRyokou()
set hidden = 1
else if(src in oview(1)
set hidden = 0
set category = "Techs"
set name = "Doton Ryokou"

Try this
In response to XICPX
thanks.. i can try that...
and i fixed everything else now...

Thanks everyone for all your help