Jump to content
  • 0

Heal Over Time - How can I add ticks?


Hyllok

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   5
  • Joined:  08/27/16
  • Last Seen:  

Hey everyone!

I’m trying to modify the NV_FIRSTAID skill to turn it into a Heal Over Time (HoT) skill, healing 2% of Max HP per second for 4 seconds. I attempted to use add_timer and skill_addtimerskill, but unfortunately, I wasn't able to get it working.

Could someone please help me understand how to make this work? Any guidance would be greatly appreciated! /no1
 

case NV_FIRSTAID:
{
    int healAmount = (sd->status.max_hp * 2) / 100;
    status_heal(bl, healAmount, 0, 2);
    clif_skill_nodamage(src, *bl, NV_FIRSTAID, healAmount, true);
    clif_updatestatus(*sd, SP_HP);

    // Scheduling ticks
    for (int i = 1; i <= 3; i++) {
        skill_addtimerskill(src, tick + (i * 1000), bl->id, 0, 0, NV_FIRSTAID, skill_lv, 0, 2);
    }

    break;
}

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.05
  • Content Count:  7
  • Reputation:   2
  • Joined:  03/10/25
  • Last Seen:  

This behavior seems similar to Geneticist's Hell Plant, which is a status that deals damage around the player every 0.3 seconds.
In status.cpp you can see in status_change_timer:

case SC_HELLS_PLANT:
	tick_time = status_get_sc_interval(type);
	val4 = tick - tick_time; // Remaining time
	break;

In status_change_timer_sub:
 

case SC_HELLS_PLANT:
	if( sce->val4 >= 0 ){
		skill_castend_damage_id( bl, bl, GN_HELLS_PLANT_ATK, sce->val1, tick, 0 );
	}
	break;

Might not be the best way but maybe you could create a status that handles the healing over time following that structure, and make the skill apply the status for 4 seconds?

  • Upvote 1
Link to comment
Share on other sites

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...