Jump to content
  • 0
Sign in to follow this  
bWolfie

Reflect Damage Check cannot go above 966k

Question

Hello,

I have made the following edit to status_damage in status.c.
When reflect damage is passed onto Crusader devoting player, I want it to not allow overflow above 1,000,000. However, there is some strange behavior.

Even though passed on damage can be any amount, this check can't seem to be above 966,959. If I make it higher than 966k, the check doesn't go through, even if reflect damage is in the millions.

Below is the code I'm using, labelled CUSTOM START / END

Thanks
 

#ifdef DEVOTION_REFLECT_DAMAGE
			if (src && (sce = sc->data[SC_DEVOTION]) != NULL) {
				struct block_list *d_bl = map->id2bl(sce->val1);
				struct mercenary_data *d_md = BL_CAST(BL_MER, d_bl);
				struct map_session_data *d_sd = BL_CAST(BL_PC, d_bl);

				if (d_bl != NULL
				 && ((d_md != NULL && d_md->master != NULL && d_md->master->bl.id == target->id)
				  || (d_sd != NULL && d_sd->devotion[sce->val2] == target->id))
				 && check_distance_bl(target, d_bl, sce->val3)
				) {
					// CUSTOM START
					if (hp > 1000000)
						hp = 1000000;
					// CUSTOM END
					clif->damage(d_bl, d_bl, 0, 0, hp, 0, BDT_NORMAL, 0);
					status_fix_damage(NULL, d_bl, hp, 0);
					return 0;
				}
				status_change_end(target, SC_DEVOTION, INVALID_TIMER);
			}
#endif

 

Edited by Myriad

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.