View Single Post
  #19  
Old 08-31-2006, 12:58 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Okay, added the move thing, I'm nwe to using move, so tell me if I'm wrong:
(btw, it still doesn't work)
PHP Code:
//by Excalibur
function onCreated()
{
  
showcharacter();
  
dir 2;
  
setcharani("dr_baddy_spider",NULL);
  
setshape(1,32,32);
  
hearts int(random(10,25));
  
onTimeout();
}
function 
onTimeout()
{
  if(
hearts>0)
  {
    if(
this.walk==0)
    {
      
setcharani("dr_baddy_spider_prep",NULL);
      
sleep(random(.5,1.5));
      
shootball();
      
setcharani("dr_baddy_spider_shoot",NULL);
      
this.walk=int(random(2,15));
    }
    else if(
this.walk>0)
    {
      
this.walk--;
      if(
abs(x-player.x)>=abs(y-player.y))
      {
        if(
player.x<x)
        {
          
dir 1;
        }
        if(
player.x>=x)
        {
          
dir 3;
        }
      }
      else if(
abs(x-player.x)<abs(y-player.y))
      {
        if(
player.y>y)
        {
          
dir 2;
        }
        if(
playery<=y)
        {
          
dir 0;
        }
      }  
      if(
player.x+.5<x)
      {
        if(!
onwall(x-.2,y) && !onwall(x-.2,y+2))
        {
          
move(-.2,0,1,1);
        }
      }
      else if(
player.x+.5>=x)
      {
        if(!
onwall(x+2.2,y) && !onwall(x+2.2,y+2))
        {
          
move(.2,0,1,1);
        }
      }
      if(
player.y+1<y)
      {
        if(!
onwall(x,y-.2) && !onwall(x+2,y-.2))
        {
          
move(0,-.2,1,1);
        }
      }
      else if(
player.y+1>=y)
      {
        if(!
onwall(x,y+.2) && !onwall(x+2,y+.2))
        {
          
move(0,.2,1,1);
        }
      }
    }
  }
  else if(
hearts<=0)
  {
    
hearts 0;
    
triggeraction(0,0,"serverside","-System","exp","secure",player.account,1);
    
setani(NULL,NULL);
    
sleep(random(7,20));
    
onCreated();
  }
  
settimer(.1);
}
function 
onPlayertouchsme()
{
  
setani("hurt",NULL);
  
triggeraction(0,0,"serverside","-System","hurt","secure",1);      
}
function 
onWa****()
{
  
setcharani("dr_baddy_spider_shoot",NULL);

Reply With Quote