Thread: baddy killing
View Single Post
  #4  
Old 11-17-2010, 01:26 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Not for copying and pasting, it's more to give you an idea of some of the things you'll need.
PHP Code:
function onCreated(){
  
//set vars
  
this.respawnpos = {this.xthis.y};
  
setTimer(0.05);
}
function 
onTimeout(){
  
doMovement();
  
setTimer(0.05);
}
function 
doMovement(){
  if (
this.hp 0){
    
//do checks to see if a player is in the baddies aggro radius
   //then
    //do movement
  
}
}
function 
onActionWa****(){
  if (! (
this.hp <= 0)){
    
this.hp -= 0.5;
  } else 
doDead();
}
function 
doDead(){
  
//set animation to dead and add exp if thats what you're doing
  
scheduleevent(2"Respawn"null);
}
function 
onRespawn(){
  
//set x and y to where you want it to respawn at each time
  
this.this.respawnpos[0];
  
this.this.respawnpos[1];
  
this.hp this.maxhp;

Reply With Quote