View Single Post
  #6  
Old 10-12-2014, 01:01 AM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
Would be really easy to do then you can control the radius of your bomb detection.

PHP Code:
this.radius 3;
function 
onExplode2() {
  
attackObjects(this.x+1.5 ,this.y+1.5this.radius);
  
putNPC2(this.0.8this.0.6"join explosion;"); //Animation of your explosion
}

function 
attackObjects(tx,ty,radius) {
   for (
temp.objfindareanpcs(tx-radius,y-radius,radius*2,radius*2)) {
    
temp.npcdist = ((this.x+1.5-tx)^+ (this.y+2-ty)^2) ^ 0.5;
    
temp.obj.trigger("attack""explosion" this.owner this.damage int(temp.dist)); //Trigger NPCs hit by explosion
  
}

 
  for (
temp.plfindnearestplayers(tx,ty)) {
    
temp.dist = ((temp.pl.x+1.5-tx)^+ (temp.pl.y+2-ty)^2) ^ 0.5;
    if (
temp.dist >= radius)
      break;
    if (
temp.pl != this.owner || level.isnopkzone != true){
      
temp.pl.onHit(this.owner.account this.damage int(temp.dist), "explosion"); //Hit Players (Damage Depending on how close to center of the blast)
  
}
 }

__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote