this is my code for the pet so far:
mob//Mobs
chocobofarmer//The keeper of your NPC
icon='mobs.dmi'
icon_state="wep"//The icon of the NPC keeper
verb//A verb
getchocobo()//Verb to get a NPC
set src in oview(1)//Can only talk to him if he's 1 block away
set name="Get chocobo"//Name of verb
set desc="Recieve a chocobo."//Description of verb
set category="Commands"//The category (default is Commands, but for some reason I put it there)
if(following==0)//If you don't have a NPC...
switch(alert(usr, "Would you like to buy a chocobo?","chocobo to follow you","Yes","No"))//Asks you if you'd like one
if("Yes")//If you choose Yes...
usr.chocobo1 += 1//You recieve a NPC
following=1//You now cannot have 2
usr.chocobo=new/mob/chocobo(locate(usr.x+1,usr.y,usr.z))// Brings the NPC 1 space left of you
if("No")//
return//
else//But if you have a NPC...
usr << "You already have a NPC."//It displays this
return//And nothing happens
client//States the client
Northeast()//For the Northeast key...
return//It won't do anything
Northwest()//For the Northwest key...
return//Won't do anything either
Southeast()//For the Southeast key...
return//Not doing anything
Southwest()//For the Southwest key..
return//It is disabled so nothings happening here(The reason for the above is to disable the NPC from being stranded since I didn't insert the diagnal directions for the NPC's movement)
North()//When you use north...
if(usr:chocobo1==1)//It will first check if you have a NPC with you
step(usr,NORTH)//Then it will move you north 1 space
walk_to(usr:chocobo,usr.loc,1,1)//This is to move the NPC to make it go north too
return//After this go back to normal activity
else//If you don't have a NPC...
step(usr,NORTH)//You move north and that's all
return//After moving, nothing special happens
//Note:Just read the above because I don't feel like typing it up again (My clipboard won't work with BYOND)
South()
if(usr:chocobo1==1)
step(usr,SOUTH)
walk_to(usr:chocobo,usr.loc,1,1)
return
else
step(usr,SOUTH)
return
East()
if(usr:chocobo1==1)
step(usr,EAST)
walk_to(usr:chocobo,usr.loc,1,1)
return
else
step(usr,EAST)
return
West()
if(usr:chocobo1==1)
step(usr,WEST)
walk_to(usr:chocobo,usr.loc,1,1)
return
else
step(usr,WEST)
return
mob//A mob thing
var//Variable
chocobo1 = 0//1 of 3 vars for the NPC system
chocobo//The second var
following=0//The third disabling
how do i make the "chocobo"go thro tleporters and end up ehere i do?plz post any codes or demos!
Kablez
-=<()>=-
ID:175593
![]() Mar 30 2003, 8:59 am
|
|
The watered down version of the code is something like this:
You can't plug it into your source as is, but it will get you on the right track if you want to learn how to do it.