Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 01-16-2009, 01:16 AM
[email protected] zeektheman2@hotmail.com is offline
SirZeek
Join Date: May 2008
Posts: 37
zeektheman2@hotmail.com is on a distinguished road
PHP Code:
function onTimeOut()
{
 
canwarp();
 
canwarp2();
 
this.attacker "Graal713758";
  
 if ( 
client.task[3] == "halfway" )
 {  
 
hideimg(200);
  if (
thiso.smovement == "walk")
  {
  
chat this.attacker;
  
this.timer 11;
   if (
this.to_check.x in |this.x-3,this.x+3| && this.to_check.y in |this.y-3,this.y+3|)
    {
      
thiso.smovement "idle";
      
setcharani("idle",NULL);
    } 
       
thiso.smovement "walk";
  
chat thiso.smovement;
        
  if ( 
this.timer 10 )
  { 
   
with findplayer this.attacker ) )
  {
   
this.newDir getdirplayer.this.x,  player.this.);
  }
 } 
 
this.to_check findnearestplayer(this.x,this.y);
   
this.dir this.newDir;
    
this.new_x this.vecx(this.dir) * this.mov_speed;
    
this.new_y this.vecy(this.dir) * this.mov_speed;
    
this.count--;
   if (
this.count 0)
    {
      
this.to_add_x this.new_x 1.5 vecx(this.dir);
      
this.to_add_y this.new_y vecy(this.dir);
     if (
onwall(this.to_add_x,this.to_add_y)) 
      {
        
this.dir = (this.dir+2)%4;
        
this.timer 0;
      } else 
     if (
onwater(this.to_add_x,this.to_add_y)) 
      {
        
setcharani("swim",NULL);
      }else
       {
         
setcharani("spawn_weapon9mm-walk","");
         
this.new_x;
         
this.new_y;
       }
    } else
     {
       
this.count int(random(10,40));
     }
  }
 
 }
    
setTimer(0.05);  

Reply With Quote
 


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 01:00 AM.


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