rathena / rathena

rAthena is an open-source cross-platform MMORPG server.
https://rathena.org/board/
GNU General Public License v3.0
2.86k stars 2.29k forks source link

Swapping equipment/cards with combo leads to incorrect HP/SP #6564

Closed kutsuru closed 2 years ago

kutsuru commented 2 years ago
aleos89 commented 2 years ago

Are you able to reproduce this after #6162? Your hash is several years old now.

Atemo commented 2 years ago

I can't reproduce on https://github.com/rathena/rathena/commit/c092c8711beef4630c8c9894a3763c7176960b03

kutsuru commented 2 years ago

I could reproduce on 701c6f6239faff10a8719a3b0578b6ec0e805bbb, will check this weekend on latest commit

kutsuru commented 2 years ago

I can't reproduce on c092c87

What did you test ? I've just tested on up to date repo, still reproducible.

Atemo commented 2 years ago

Fricco's Shoes + Odin's Blessing + Falcon Muffler with and without Dark Illusion + Dark Lord and you?

kutsuru commented 2 years ago

Exactly same as in the initial picture, I replace the Fricco's with another Fricco's and HP drops, and it should not.

Daraen1 commented 2 years ago

I can reproduce too, i use 2018-04-18b client date and my source is up to date. I use Pre-renewal. bug frico 1 bug frico 2

aleos89 commented 2 years ago

The reason your HP/SP drops is because you're effectively unequipping the first item -> status update applied to HP/SP lowering the max and current since bonus is gone -> equipping second item -> status update applied to HP/SP increasing max but current stays at current value.

Can you prove on kRO that a players HP/SP doesn't change when switching with the same item? What happens if the same item has cards or enchants that adjusts HP/SP?

kutsuru commented 2 years ago

Sorry @aleos89 I have no way to prove the behaviour on kRO, but you would expect the same behaviour as when no combos are involved image Naked => 4311 HP image Diablos Boots => 5301 HP image Swapping to Sleipnir[0] => 5173 HP

Swapping to Sleipnir[0] did not reset HP to base HP

kutsuru commented 2 years ago

Hello @aleos89, would not it make more sense to have the same behaviour for both scenario ?

Playtester commented 2 years ago

Tested on official servers: If you change your equip, it will first unequip an item, this will reduce your HP/SP, then on equipping the new item, your current HP/SP remain the same.

So yes, you get effectively damaged by changing equip, even if you change to the same type of equip.

Same behavior for combos. First the combo is unequipeed - you lose HP/SP, then combo bonus is reactivated, keep current HP/SP, only max MaxHP/SP returns to previous value.

So yeah, it should have the same behavior for both scenarios, but it should be the other way around.

kutsuru commented 2 years ago

Thanks for the investigation/fix, well that was not the expected result but the purpose is to match official behaviour, I guess :)