View Single Post
  #12  
Old 08-27-2006, 04:20 PM
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
Once again, doesn't work
Movement is messed up, he doesn't shoot, and you can still only hit him once. Any thoughts?
Here's what I have now:
PHP Code:
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
    {
      
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))
        {
          
x-=.2;
        }
      }
      else if(
player.x+.5>=x)
      {
        if(!
onwall(x+2.2,y) && !onwall(x+2.2,y+2))
        {
          
x+=.2;
        }
      }
      if(
player.y+1<y)
      {
        if(!
onwall(x,y-.2) && !onwall(x+2,y-.2))
        {
          
y-=.2;
        }
      }
      else if(
player.y+1>=y)
      {
        if(!
onwall(x,y+.2) && !onwall(x+2,y+.2))
        {
          
y+=.2;
        }
      }
    }
  }
  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);


Last edited by excaliber7388; 08-27-2006 at 05:18 PM..
Reply With Quote