ID:263518
 
Code: mob/player/POK/verb
Attack()
set category="Combat"
for(var/mob/E in get_step(usr,usr.dir))
if(E.NPC==0)
E.HP-=usr.Str
view()<<"[usr] attacks [E] for [usr.Str] HP!"
if(E.player==1)
if(E.HP<=0)
E<<"You died!"
E.HP=E.MHP
E.MP=E.MMP
E.loc=locate(2,2,1)
E.gold+=E.gold
E.gold=0
usr.Exp+=E.Exp
E.PK=0
return
else
if(E.HP<=0)
usr<<"You killed [E]!"
usr.gold+=E.gold
E.gold=0
usr.Exp+=E.Exp
del E
return
else
usr<<"You can't attack an NPC!"
return

mob
proc
LvlCheck()
if(usr.Exp>=usr.Mexp)
usr<<"You gained a level!"
usr.level+=1
usr.MHP+=rand(1,5)
usr.HP=usr.MHP
usr.MMP+=rand(1,5)
usr.MP=usr.MMP
usr.Str+=rand(1,5)
usr.Exp*=2
usr.Exp=0
usr.Mexp*=2

//here are the characters....

mob/player
P
Emerald_Hero_Boy
icon = 'mobs.dmi'

PO
Emerald_Hero_Girl
icon = 'girl.dmi'
POK
Pikachu
icon = 'Pikachu.dmi'


Problem description:
Wont give Pikachu the Attack Verbs,I want it so only Pikachu can have the Attack Verbs anyone know how to fix this,please help.

It's as easy as giving the verbs to pickachu, not the user. Then, you can call pickachu's attack verb from 'set src in range(2)' From that example, the trainer must be in view 2 for pickachu to hear it. Then, it's simply a matter of making the procedure check if the person telling pikachu to attack is the rightful owner. Also, you should be putting your code in DM tags, it makes it easier to read.


Also, bolean values can prove to make your code much neater and shorter. Look them up in the DM reference.