[Bug Fix] SPA214 SE_MaxHPChange calculation errors corrected. (#4238)

* [Bug Fix] HP Bar not updating when applying HP Buff with a heal.

Bug: When an HP buff with a heal effect is applied for first time, the heal portion of the effect heals the client and updates HPs currently server side, but client side the HP bar does not register it as a heal thus you display as less than full HP. However due to server thinking your healed, you are unable to correct it by healing.

Solution: You need to resend the HP update after buff completed and action packet resent.

* add SE_MaxHPChange to fix

would result in same bug

* [Bug Fix] SPA214 Percent HP change calculation fix

Fix how spell and item bonuses using SPA 214 are calculated. Will now be calculated consistent with client.

* [Bug Fix] SPA214 SE_MaxHPChange calculation errors corrected.

removed code from other PR
This commit is contained in:
KayenEQ
2024-04-02 02:12:55 -04:00
committed by GitHub
parent dc48c45421
commit e9a0c79301
5 changed files with 8 additions and 9 deletions
+1 -3
View File
@@ -461,15 +461,13 @@ int64 Merc::CalcMaxHP() {
//but the actual effect sent on live causes the client
//to apply it to (basehp + itemhp).. I will oblige to the client's whims over
//the aa description
nd += aabonuses.MaxHP; //Natural Durability, Physical Enhancement, Planar Durability
nd += aabonuses.MaxHP + spellbonuses.MaxHPChange + itembonuses.MaxHPChange; //Natural Durability, Physical Enhancement, Planar Durability
max_hp = (float)max_hp * (float)nd / (float)10000; //this is to fix the HP-above-495k issue
max_hp += spellbonuses.HP + aabonuses.HP;
max_hp += GroupLeadershipAAHealthEnhancement();
max_hp += max_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f);
if (current_hp > max_hp)
current_hp = max_hp;