Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wd.damage2 not applying targetside calculations / resists #3011

Closed
muujiza opened this issue Jun 7, 2021 · 2 comments · Fixed by #3014
Closed

wd.damage2 not applying targetside calculations / resists #3011

muujiza opened this issue Jun 7, 2021 · 2 comments · Fixed by #3014

Comments

@muujiza
Copy link
Contributor

muujiza commented Jun 7, 2021

Describe the bug
Unintended Offhand Pure Damage on SinX / Target Side card fix not applying to weapon damage 2

To Reproduce

  1. Create a SinX and target character
  2. @skillall on SinX
  3. Equip 2x weapon on SinX
  4. Unequip Main Weapon
  5. On the target character, wear any kind of resist
  6. Attack the target character, and notice that resist are not applying

Expected behavior
Resist should apply similar on how it is done on main hand attack

Screenshots
Actual behavior: https://youtu.be/OVG-PbnvEi0
Expected behavior: https://youtu.be/LaYLo5hzkjo

System specs (please complete the following information):

  • Hercules Version - April 2021 Release (no fix applied on June Release as well)
  • Mode: pre renewal
  • Packet version: HERCULES_VERSION 202011160

Plugins used or source modifications
N/A

Additional context
Actual behavior: https://youtu.be/OVG-PbnvEi0
Expected behavior: https://youtu.be/LaYLo5hzkjo

@muujiza
Copy link
Contributor Author

muujiza commented Jun 7, 2021

simple code change will fix the issue:

src/map/battle.c (line # 5733)

	//Card Fix, tsd side
	if (tsd) { //if player on player then it was already measured above
		wd.damage = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, (flag.lh ? 1 : 0), wd.flag);
	}

to

	//Card Fix, tsd side
	if (tsd) { //if player on player then it was already measured above
		wd.damage = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, (flag.lh ? 1 : 0), wd.flag);
		if (flag.lh)
			wd.damage2 = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage2, (flag.lh ? 1 : 0), wd.flag);
	}

@skyleo
Copy link
Contributor

skyleo commented Jun 7, 2021

shouldn't it be even:

	//Card Fix, tsd side
	if (tsd) { //if player on player then it was already measured above
		wd.damage = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, 0, wd.flag);
		if (flag.lh)
			wd.damage2 = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage2, 1, wd.flag);
	}

since wd.damage is damage of right hand, so flag&1 for battle->calc_cardfix should be unset. while when it's set it will return the damage for wd.damage2, since it's the damage of the left hand.

Also nice catch btw.

@MishimaHaruna MishimaHaruna added this to the Release v2021.07.07 milestone Jul 7, 2021
MishimaHaruna added a commit that referenced this issue Jul 7, 2021
issue #3011 fix - wd.damage2 not applying target side calculation (resist reductions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants