Jump to content
  • 0

How to get status condition duration on skill.c?


bodibastos

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  45
  • Reputation:   0
  • Joined:  10/13/12
  • Last Seen:  

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 bodibastos
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...