Basically, I've changed Provoke to apply a custom status to monsters, SC_MOBPROVOKE. I'm aiming for a behavior like this:
If the monster already has SC_MOBPROVOKE {
If the current duration of SC_MOBPROVOKE is below 6 seconds - APPLY MOBPROVOKE
//This means that, if the current duration is over 6 seconds, MOBPROVOKE is not reapplied.
} else {
APPLY MOBPROVOKE
}
Basically, the idea is that the status is only applied if the target does not have the status yet, or if the current duration of the status is below 6 seconds.
My code looks like this, on skill.c:
if (dstmd->sc.data[SC_MOBPROVOKE]){
printf ("timer: %d\n",dstmd->sc.data[SC_MOBPROVOKE]->timer);
if (dstmd->sc.data[SC_MOBPROVOKE]->timer < skill_get_time2(skill_id,2)/2) //this equals 6000
sc_start(src,bl,SC_MOBPROVOKE,100,1,skill_get_time2(skill_id,2)/2);
) else {
sc_start(src,bl,SC_MOBPROVOKE,100,1,skill_get_time2(skill_id,2)/2);
}
However, what's happening is that, no matter the duration of the status, dstmd->sc.data[SC_MOBPROVOKE]->timer is returning a very low value (around 25-40). As far as I can tell, this value isn't even correlated to the duration of the skill.
Is there another way I should be using to get the current duration of the status condition?
Question
bodibastos
Basically, I've changed Provoke to apply a custom status to monsters, SC_MOBPROVOKE. I'm aiming for a behavior like this:
If the monster already has SC_MOBPROVOKE { If the current duration of SC_MOBPROVOKE is below 6 seconds - APPLY MOBPROVOKE //This means that, if the current duration is over 6 seconds, MOBPROVOKE is not reapplied. } else { APPLY MOBPROVOKE }
Basically, the idea is that the status is only applied if the target does not have the status yet, or if the current duration of the status is below 6 seconds.
My code looks like this, on skill.c:
if (dstmd->sc.data[SC_MOBPROVOKE]){ printf ("timer: %d\n",dstmd->sc.data[SC_MOBPROVOKE]->timer); if (dstmd->sc.data[SC_MOBPROVOKE]->timer < skill_get_time2(skill_id,2)/2) //this equals 6000 sc_start(src,bl,SC_MOBPROVOKE,100,1,skill_get_time2(skill_id,2)/2); ) else { sc_start(src,bl,SC_MOBPROVOKE,100,1,skill_get_time2(skill_id,2)/2); }
However, what's happening is that, no matter the duration of the status, dstmd->sc.data[SC_MOBPROVOKE]->timer is returning a very low value (around 25-40). As far as I can tell, this value isn't even correlated to the duration of the skill.
Is there another way I should be using to get the current duration of the status condition?
Edited by bodibastosLink to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.