Jump to content
  • 0
Tio Akima

Doubts - src -skill

Question

Hello guys,

 

I'm trying to do a passive skill, to count the basic attacks on the enemy.

 

And accumulate that number in a variable.

 

        if(src->type==BL_PC){
            ataq++;
        printf("basic hit number: ", ataq);    
            }

I've tried the following, but it's not working.

 

Someone with knowledge to give birth?

 

Ps: skill must be passive

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi. What's now working? Is it the increment of "ataq" or your printf? I suggest to change printf to sprintf

 

char output_message[128];
sprintf(output_message, "basic hit number: %d",ataq);
clif->messagecolor_self(sd->fd, COLOR_DEFAULT, output_message);

And can you please explain more.

 

Edit:

ataq++ won't really work because you're just simply adding + 1 with your declared ataq integer. Instead, try using the val1 or any value of sc->data[YOUR_SC_SKILL] that you're not using.

 

Sample

if(t_bl->type==BL_MOB){
    sc->data[YOUR_SC_SKILL]->val1 = sc->data[YOUR_SC_SKILL]->val1 + 1;
    sprintf(output_message, "basic hit number: %d",sc->data[YOUR_SC_SKILL]->val1);
    clif->messagecolor_self(sd->fd, COLOR_DEFAULT, output_message);
}

82388052529542e782fb52c66e064723.png

Edited by x13th

Share this post


Link to post
Share on other sites
  • 0

Hi. What's now working? Is it the increment of "ataq" or your printf? I suggest to change printf to sprintf

 

char output_message[128];
sprintf(output_message, "basic hit number: %d",ataq);
clif->messagecolor_self(sd->fd, COLOR_DEFAULT, output_message);

And can you please explain more.

 

Edit:

ataq++ won't really work because you're just simply adding + 1 with your declared ataq integer. Instead, try using the val1 or any value of sc->data[YOUR_SC_SKILL] that you're not using.

 

Sample

if(t_bl->type==BL_MOB){
    sc->data[YOUR_SC_SKILL]->val1 = sc->data[YOUR_SC_SKILL]->val1 + 1;
    sprintf(output_message, "basic hit number: %d",sc->data[YOUR_SC_SKILL]->val1);
    clif->messagecolor_self(sd->fd, COLOR_DEFAULT, output_message);
}

82388052529542e782fb52c66e064723.png

 

 

Hii x13th

thanks for helping me..
 
Now there are doubts.
 
I should create an SC for this skill, right?
 
and..
 
This if ... should i put in that part of skill.c?
 
 
I tried putting my case My_Skill inside the function int skill_attack ()
 
But it did not work there
 
 
@EDIT
... and..
 
t_bl is an undeclared identifier
 
why?
 
thanks
Edited by Tio Akima

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.