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! (https://forums.graalonline.com/forums/showthread.php?t=83605)

Novice 01-11-2009 01:20 AM

Help with projectiles!
 
Before I went on vacation, I was working on the spells for N-Pulse Rebirth. I've just come back, and I need help getting the damage on projectiles.
PHP Code:

//THIS PART IS SERVERSIDE
function onActionServersidecmdp1 ) {
  switch ( 
cmd ) {
    case 
"Hurt":
      
temp.p1;
      
triggerclient("gui","-System/Health","Attacked",player.x,player.y,temp.h,player.account);
    break;
  }
}

//THIS PART IS CLIENTSIDE

//DIRECTLY BEFORE IT SHOOTS
setShootParams(this.spell_effect,this.spell_power,this.spell_bonus);

//LAST BIT OF CODE IN THE SCRIPT
function onActionProjectileeffectpowerbonus ) {
  switch ( 
effect ) {
    case 
"Hurt":
      
temp.hpower int(random((bonus^2*power)/(pi^4)-(bonus-3), (bonus^2*power)/(pi^4)+bonus));
      
triggerserver("gui",this.name,"Attack",temp.hpower);
    break;
  }


*Please know that the comments are specifically for the forums to show what's where, and there is code between them
It loads the effect, power, and bonus right, but it doesn't send through and do damage. How can I fix this?

Thanks for taking the time to look through this.

Chompy 01-11-2009 01:49 AM

Does onActionAttack() get triggered?

Novice 01-11-2009 03:04 AM

Quote:

Originally Posted by Chompy (Post 1456098)
Does onActionAttack() get triggered?

No, onActionClientside() gets triggered, or is supposed to. I see what you mean by this, am I doing it wrong? I have used triggerclient() much except editting some things so I'm not too sure.
Then "Attacked" is the first param
PHP Code:

function onActionClientsidecmd p1 p2 p3 p4 ) {
  switch ( 
cmd ) {
    case 
"Attacked"


LoneAngelIbesu 01-11-2009 04:13 AM

Quote:

Originally Posted by Novice (Post 1456095)
It loads the effect, power, and bonus right, but it doesn't send through and do damage. How can I fix this?

It's a bit hard without the complete code, but I'll assume that everything you're referencing to in onActionClientside/Serverside exists above. I'm also no expert on projectiles.

Clientside "Hurt" is trying to trigger serverside "Attack", but "Attack" is not a defined parameter in onActionServerside.

Novice 01-11-2009 04:31 AM

Quote:

Originally Posted by LoneAngelIbesu (Post 1456169)
It's a bit hard without the complete code, but I'll assume that everything you're referencing to in onActionClientside/Serverside exists above. I'm also no expert on projectiles.

Clientside "Hurt" is trying to trigger serverside "Attack", but "Attack" is not a defined parameter in onActionServerside.

Ah! I completely missed that! Thanks!


All times are GMT +2. The time now is 05:52 PM.

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