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.5, this.radius);
putNPC2(this.x - 0.8, this.y - 0.6, "join explosion;"); //Animation of your explosion
}
function attackObjects(tx,ty,radius) {
for (temp.obj: findareanpcs(tx-radius,y-radius,radius*2,radius*2)) {
temp.npcdist = ((this.x+1.5-tx)^2 + (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.pl: findnearestplayers(tx,ty)) {
temp.dist = ((temp.pl.x+1.5-tx)^2 + (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)
}
}
}