Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help with projectiles (again) (https://forums.graalonline.com/forums/showthread.php?t=83849)

Novice 01-24-2009 06:17 AM

Help with projectiles (again)
 
I'm trying to set up N-Pulse Rebirth's spell system so that it checks for if the projectile is hitting a baddy.
I have no clue how to go about doing this, but getting it to hit players works perfectly.
I'm only going to give all the shooting param stuff that works for players, but not baddies.

In the main Spell system:
PHP Code:

function onActionServersidecmdp1 ) {
  switch ( 
cmd ) {
    case 
"Attack":
      
triggerclient("gui","-System/Health","Attacked",player.x,player.y,p1,player.account);
    break;
  }
}
//#CLIENTSIDE
//a bunch of spell loads here\\

function onCast() {
  
//mp and cooldown checks here\\
      
setShootParams(this.spell_effect,this.spell_power,this.spell_bonus);
      
this.spell_angle getangle(vecx(player.dir),vecy(player.dir));
      
shoot(player.x+vecx(player.dir), player.y+vecy(player.dir), player.zthis.spell_angle10this.spell_shootaninull);
  
//some more checking\\
}

function 
onActionProjectileeffectpowerbonus ) {
  switch ( 
effect ) {
    
    case 
"Hurt":
   
//hurt loads\\
      
triggerserver("gui",this.name,"Attack",temp.hpower);
    break;
  }


All of that works for players. I've got no clue how to make it check to baddies. How would I go about doing this?

xXziroXx 01-24-2009 01:23 PM

Use onActionProjectile() on NPC's serversided to detect when they're hit.


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

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