PDA

View Full Version : Help with projectiles (again)


Novice
01-24-2009, 06:17 AM
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:
function onActionServerside( cmd, p1 ) {
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.z, this.spell_angle, 1, 0, this.spell_shootani, null);
//some more checking\\
}

function onActionProjectile( effect, power, bonus ) {
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.