Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.