Thread: move
View Single Post
  #12  
Old 01-08-2004, 05:41 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Jagen's script edit.

NPC Code:

if (created){
showcharacter;
setcharprop #3,bomy_golg0.png;
setcharani g2k2bomy_idle,;
setstring this.name,Bomy;
message Ask me to "Come Here".;
timeout = 0.05;
}
if (playerchats){
if (strequals(#c,Come Here)){
move();
message Coming sir.;
}
}

function move(){
this.dx = playerx-x;
this.dy = playery-y;
this.dis = (this.dx^2 + this.dy^2)^0.5;
this.angle = getangle(this.dx,this.dy);
i = 0;
gox = x;
goy = y;
while (i<this.dis){
newx = gox + cos(this.angle);
newy = goy - sin(this.angle);
if (onwall(newx+1.5,newy+2) || onwater(newx+1.5,newy+2))
break;
gox = newx;
goy = newy;
i++;
}
if (i > 0) {
setcharani g2k2bomy_walk,;
move gox-x,goy-y,2,1+4+8+16;
}
}
if (movementfinished){
message Here.;
setcharani g2k2bomy_idle,;
}

if(timeout){
showtext 0,x+0.3,y+2.5,,,#s(this.name);
changeimgzoom 0,0.8;
changeimgvis 0,1;
timeout = 0.05;
}

__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote