Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GS2 Equiv of exploded? (https://forums.graalonline.com/forums/showthread.php?t=134269614)

scriptless 10-11-2014 02:22 AM

GS2 Equiv of exploded?
 
Okay so in GS1 there was a event for when an object is exploded by a classic bomb.

PHP Code:

if (exploded)
{


I don't see one in GS2 tho... is there any way to still detect if it was hit by a bomb's explosion?

Crow 10-11-2014 08:25 AM

Are default bombs even still working/supported? I suggest making your own, to be honest.

scriptless 10-11-2014 09:40 AM

Quote:

Originally Posted by Crow (Post 1731934)
Are default bombs even still working/supported? I suggest making your own, to be honest.

They do still work and are supported. I agree should make your own and I do have my own. But my own still makes an explosion and that explosion is still not detectable. On top of that you cannot name your npc's Bomb, or Bow. Because doing so wont work as the default systems will override them and cause some pretty epic failures in some cases. =/

Edit: thanks deas.. aparently onExploded() works.. but it's clientside only.. and it doesnt show up in /scripthelp in rc.. o.O

xAndrewx 10-11-2014 01:42 PM

Makes sense, all bombs are client based.

Jakov_the_Jakovasaur 10-11-2014 02:21 PM

if you have scripted your own bomb, why not script your own explosion as well?

MysticalDragon 10-12-2014 01:01 AM

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)
  
}
 }




All times are GMT +2. The time now is 07:59 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.