EC: take into account invigorate bard buff in character sheet

ForeverFunForeverFun Posts: 802
edited May 2023 in Bugs
This thread mentions issues in the character sheet for stat values.   Intriguingly, that thread is locked, so I wasn't able to reply to it (???)

If you pickup the changes from that post, an additional change below takes into account the bard buff invigorate, being enabled and disabled.

charactersheet.lua,  function CharacterSheet.HealthStaminaManaBonus

		if (CharacterSheet.Caps[which] ~= nil) then
local cap = CharacterSheet.Caps[which]

-- check for invigorate bard buff. buff icon is delayed removal after stat change, so BuffDebuff.HandleBuffRemoved will invoke CharacterSheet.HealthStaminaManaBonus()
if(which == "IncreaseHitPoints" and BuffDebuff.BuffData[1056] ~= nil) then -- AB_BARD_INVIGORATE
local buffData = BuffDebuff.BuffData[1056]
local location = wstring.find(buffData.ToolTipWStringVector[1], L"+.* "..GetStringFromTid(1075630)) -- +9 .. +26 hit point increase
if(location) then
local hpi= wstring.sub( buffData.ToolTipWStringVector[1], location+1, 3 )
cap = cap + tonumber(hpi)
end
end

-- heal = L"(+" .. StringToWString(tostring(max)) .. L" / " .. StringToWString(tostring(CharacterSheet.Caps[which])) .. L")"
-- heal = L"(+" .. towstring(max) .. L" / " .. towstring(CharacterSheet.Caps[which]) .. L")"
heal = L"(+" .. towstring(max) .. L" / " .. towstring(cap) .. L")"


buffdebuffwindow.lua,function BuffDebuff.HandleBuffRemoved


if (buffId == 1056) then -- AB_BARD_INVIGORATE: refresh max hit points.
CharacterSheet.UpdateSpecialStats()
end

WindowUtils.SaveWindowPosition(iconName)

Sign In or Register to comment.