ID:144015
 
Code:
mob
verb
Learn_Jutsu()
set category = "Commands"
if(usr.Village=="Leaf")
if(usr.Mgen == 200&&usr.Village=="Leaf")
usr << "<B><font color = blue>You learned Katon Housenka!"
usr.verbs += new /mob/katon/verb/KatonHousenka()
if(usr.Village=="Leaf"&&usr.Mnin==1500)
usr << "<B><font color = blue>You learned Katon No Jutsu!"
usr.verbs += new /mob/uchiha/verb/FireArmor()
if(usr.Village=="Leaf"&&usr.Mnin==750)
usr << "<B><font color = blue>You learned Katon Goukakyuu!!"
usr.verbs += new /mob/katon/verb/KatonGoukakyuu()
if(usr.Village=="Leaf"&&usr.Mnin==1200)
usr << "<B><font color = blue>You learned Katon Karyuu Endan!!"
usr.verbs += new /mob/katon/verb/KatonKaryuuEndan()
if(usr.Village=="Leaf"&&usr.Mnin==2000)
usr << "<B><font color = blue>You have acquired Katon Ryuuka No Jutsu!!"
usr.verbs += new /mob/katon/verb/KatonRyuukanoJutsu()
if(usr.rank=="Chuunin"&&usr.Mchakra==15000)
usr << "<B><font color = blue>You have learned Chidori!"
usr.verbs += new /mob/jutsu/verb/Chidori()
if(usr.rank=="Chuunin"&&usr.Mchakra==30000)
usr<<"<b><font color=blue> You have learned Rasengan!"
usr.verbs += new /mob/jutsu/verb/Rasengan()
if(usr.KawaN >= 100)
usr << "<B><font color = blue>You learned Shushin No Jutsu!!"
usr.verbs += new /mob/jutsu/verb/ShushinNoJutsu()
if(usr.hengeN >= 100)
usr << "<B><font color = blue>You learned Mei Mei No Jutsu!!"
usr.verbs += new /mob/jutsu/verb/MieMie()
return
if(usr.Village=="Mist")
if(usr.Mnin==500&&usr.Village == "Mist")
usr << "<B><font color = blue>You learned Suiton Suiryuudan no Jutsu!!"
usr.verbs += new /mob/Suiton/verb/SuitonSuiryuudannoJutsu()
if(usr.Mgen==500&&usr.Village == "Mist")
usr << "<B><font color = blue>You learned Suirou No Jutsu!!"
usr.verbs += new /mob/suiton/verb/SuirouNoJutsu()
if(usr.Mnin==2500&&usr.Village == "Mist")
usr << "<B><font color = blue>You learned Suiton Suikoudan no Jutsu!!"
usr.verbs += new /mob/Suiton/verb/SuitonSuikoudannoJutsu()
if(usr.Village=="Mist"&&usr.Mgen==1500&&usr.Mnin==1500)
usr<<"<b><font color=blue> You have learned Kirigakure!"
usr.verbs += new /mob/mist/verb/KirigakurenoJutsu()
if(usr.Village=="Mist"&&usr.Mgen==1500)
usr<<"<b><font color=blue> You have Mist No Jutsu!"
usr.verbs += new /mob/mist/verb/MistArmor()
if(usr.rank=="Chuunin"&&usr.Mchakra==15000)
usr << "<B><font color = blue>You have learned Chidori!"
usr.verbs += new /mob/jutsu/verb/Chidori()
if(usr.rank=="Chuunin"&&usr.Mchakra==30000)
usr<<"<b><font color=blue> You have learned Rasengan!"
usr.verbs += new /mob/jutsu/verb/Rasengan()
if(usr.KawaN >= 100)
usr << "<B><font color = blue>You learned Shushin No Jutsu!!"
usr.verbs += new /mob/jutsu/verb/ShushinNoJutsu()
if(usr.hengeN >= 100)
usr << "<B><font color = blue>You learned Mei Mei No Jutsu!!"
usr.verbs += new /mob/jutsu/verb/MieMie()
return
if(usr.Village=="Sand")
if(usr.Mnin==1000&&usr.Village == "Sand")
usr << "<B><font color = blue>You have acquired Fuuton: Kaze Dangan No Jutsu!!"
usr.verbs += new /mob/fuuton/verb/FuutonKazeDangan()
if(usr.Mgen==1500&&usr.Mnin==1500&&usr.Village == "Sand")
usr << "<B><font color = blue>You have acquired Flight!!"
usr.verbs += new /mob/flight/verb/Fly()
if(usr.Mnin==2000&&usr.Village == "Sand")
usr << "<B><font color = blue>You have acquired Fuuton: Renkuudan No Jutsu!!"
usr.verbs += new /mob/fuuton/verb/FuutonRenkuudan()
if(usr.Mnin==1500&&usr.Village == "Sand")
usr << "<B><font color = blue>You have acquired Fuuton: Daitoppa No Jutsu!!"
usr.verbs += new /mob/fuuton/verb/Fuuton_Daitoppa()
if(usr.rank=="Chuunin"&&usr.Mchakra==15000)
usr << "<B><font color = blue>You have learned Chidori!"
usr.verbs += new /mob/jutsu/verb/Chidori()
if(usr.rank=="Chuunin"&&usr.Mchakra==30000)
usr<<"<b><font color=blue> You have learned Rasengan!"
usr.verbs += new /mob/jutsu/verb/Rasengan()
if(usr.KawaN >= 100)
usr << "<B><font color = blue>You learned Shushin No Jutsu!!"
usr.verbs += new /mob/jutsu/verb/ShushinNoJutsu()
if(usr.hengeN >= 100)
usr << "<B><font color = blue>You learned Mei Mei No Jutsu!!"
usr.verbs += new /mob/jutsu/verb/MieMie()
return
if(usr.Village=="Sound")
if(usr.Mgen==500&&usr.rank=="Genin"&&usr.Village == "Sound")
usr << "<B><font color = blue>You learned Zankuuha!!"
usr.verbs += new /mob/sound/verb/Zankuuha()
if(usr.Mgen==500&&usr.rank=="Genin"&&usr.Village == "Sound")
usr << "<B><font color = blue>You learned Sen'eijashu!!"
usr.verbs += new /mob/sound/verb/Seneijashu()
if(usr.Mtai==500&&usr.rank=="Genin"&&usr.Village == "Sound")
usr << "<B><font color = blue>You learned Zan No Jutsu!!"
usr.verbs += new /mob/sound/verb/ZanArmor()
if(usr.maxhealth==10000&&usr.rank=="Genin"&&usr.Village == "Sound")
usr << "<B><font color = blue>You learned Zankyokukuuha!!"
usr.verbs += new /mob/sound/verb/Zankyokukuuha()
if(usr.maxhealth==5000&&usr.rank=="Genin"&&usr.Village == "Sound")
usr << "<B><font color = blue>You learned Kyoumeisen!!"
usr.verbs += new /mob/sound/verb/Kyoumeisen()
if(usr.rank=="Chuunin"&&usr.Mchakra==15000)
usr << "<B><font color = blue>You have learned Chidori!"
usr.verbs += new /mob/jutsu/verb/Chidori()
if(usr.rank=="Chuunin"&&usr.Mchakra==30000)
usr<<"<b><font color=blue> You have learned Rasengan!"
usr.verbs += new /mob/jutsu/verb/Rasengan()
if(usr.KawaN >= 100)
usr << "<B><font color = blue>You learned Shushin No Jutsu!!"
usr.verbs += new /mob/jutsu/verb/ShushinNoJutsu()
if(usr.hengeN >= 100)
usr << "<B><font color = blue>You learned Mei Mei No Jutsu!!"
usr.verbs += new /mob/jutsu/verb/MieMie()
else
return


Problem description: OK. This what you see is verb that should give jutsu if user have enough stat's for it...but dunno why, it dont work..

take out new and the () at the end of the verbs.
mob
verb
Learn_Jutsu()
set category = "Commands"
if(usr.Village=="Leaf")
if(usr.Mgen == 200&&usr.Village=="Leaf")
usr << "<B><font color = blue>You learned Katon Housenka!"
usr.verbs += /mob/katon/verb/KatonHousenka
In response to Gooseheaded
take out new and the () at the end of the verbs.
That isn't actually a problem.

By what I've seen, it should work fine, so I'm just going to assume you used the wrong operator.

if(usr.Mgen == 200&&usr.Village=="Leaf") // user's Mgen MUST be 200
if(usr.Mgen >= 200&&usr.Village=="Leaf") // user's Mgen must be 200 or above.


And while you're at it, you've already told it to check the mobile based on their village, so you don't need to further clarify it afterwards.

            if(usr.Village=="Leaf")
if(usr.Mgen >= 200)
In response to Keeth
Keeth wrote:
take out new and the () at the end of the verbs.
That isn't actually a problem.

Actually, it is. It does work, however you can't remove the verb later, if wanted. There may also be other problems with it, with verb saving and whatnot. There's no reason to add verbs with new, especially if you're not using the arguments, just directly add the type path.
In response to Kaioken
It does work, however you can't remove the verb later, if wanted.
You can remove the verb at a later time either way you do it.

There may also be other problems with it, with verb saving and whatnot.
It saves just fine.

There's no reason to add verbs with new
Yes, there is no real reason to do it that way, but it still works.
In response to Keeth
Ah, yes, its only removable if you actually use the arguments and change the name of the verb. Oops, didn't remember correctly,
Dont use the WOTS source
http://byond.com/docs/guide
In response to Kaioken
mob/verb
add()
usr.verbs += new /test/verb/remove(usr) // usr just added for the sake of required arguments

test/verb
remove()
usr.verbs -= /test/verb/remove
/// you can alternatively remove it with new /test/verb/remove()
In response to Keeth
...?
Whats the point of that post? Trying to, what, prove me wrong or something? If so it'll help to understand what I'm saying in the first place; that code isn't using the [2nd] argument to change the verb name.

Keeth wrote:
usr just added for the sake of required arguments

? You know it isn't required. The 1st argument is who the verb goes to; if you're already using 'X.verbs += new ...' it is unneeded that you use the argument as well, you only need to manually add the verb to the list yourself OR use the first argument. If already using 'new', you should use the arg.