Jump to content
  • 0

Item bonus hp p ercent regen not working (bonus2 bRegenPercentHP,n,t; )


choiboy

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Reputation:   0
  • Joined:  10/23/17
  • Last Seen:  

Hi guys, I'm quite new here. How are you today? 

I'm writing this post as I seem to be having some trouble getting

bonus2 bRegenPercentHP,n,t;        Gain n% of max HP every t milliseconds

to work. It seems like it's not doing anything at all. I put the following on Knife (id 1201) under the script column in item_db_re table and it doesn't seem to do anything.

bonus2 bRegenPercentHP,20,3000;

I can confirm that I am using the correct table and etc since other bonuses seem to work fine.

 

I haven't looked deep into it but what I can see in pc.c is:

case SP_REGEN_PERCENT_HP: // bonus2 bRegenPercentHP,n,t;
		if (sd->state.lr_flag != 2) {
			sd->percent_hp_regen.value = type2;
			sd->percent_hp_regen.rate = val;
		}
		break;

and within the pc_regen function,

if (sd->percent_hp_regen.value) {
		sd->percent_hp_regen.tick += diff_tick;
		while (sd->percent_hp_regen.tick >= sd->percent_hp_regen.rate) {
			hp += (sd->percent_hp_regen.value* sd->status.max_hp);
			sd->percent_hp_regen.tick -= sd->percent_hp_regen.rate;
		}
	}

It seems like sd->percent_hp_regen.value is a short, and it's doing hp += percent hp val * max hp. Should this percent_hp_regen.value be turned into a percentage first and then multiplied?

Also I tried hardcoding the hp+= value and it doesn't seem to do anything either.

Is anyone else having the same problem/know how to fix this?

 

Thanks in advance,

:D

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