Doubts - src -skill

Tio Akima

New member
Messages
349
Points
0
Age
36
Discord
TioAkima#0636
Github
Tio Akima
Emulator
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

 
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


 
Last edited by a moderator:
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
 
Last edited by a moderator:
Back
Top