Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-11-2009, 01:20 AM
Novice Novice is offline
Developer
Join Date: Dec 2008
Posts: 90
Novice is an unknown quantity at this point
Send a message via MSN to Novice
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.

Last edited by Novice; 01-11-2009 at 01:40 AM..
Reply With Quote
  #2  
Old 01-11-2009, 01:49 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Does onActionAttack() get triggered?
__________________
Reply With Quote
  #3  
Old 01-11-2009, 03:04 AM
Novice Novice is offline
Developer
Join Date: Dec 2008
Posts: 90
Novice is an unknown quantity at this point
Send a message via MSN to Novice
Quote:
Originally Posted by Chompy View Post
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"
Reply With Quote
  #4  
Old 01-11-2009, 04:13 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by Novice View Post
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.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #5  
Old 01-11-2009, 04:31 AM
Novice Novice is offline
Developer
Join Date: Dec 2008
Posts: 90
Novice is an unknown quantity at this point
Send a message via MSN to Novice
Quote:
Originally Posted by LoneAngelIbesu View Post
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!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:33 AM.


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