Tio Akima 74 Posted November 12, 2016 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 Quote Share this post Link to post Share on other sites
0 x13th 7 Posted November 15, 2016 (edited) 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); } Edited November 15, 2016 by x13th 1 Tio Akima reacted to this Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted November 19, 2016 (edited) 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); } 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 November 19, 2016 by Tio Akima Quote Share this post Link to post Share on other sites
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.
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