Debug info from this code:
Lua Code:
local function UnitAttributeVisual(evt, unitTag, unitAttributeVisual, statType, attributeType, powerType, value1, value2, value3, value4)
if unitTag == "player" and unitAttributeVisual == ATTRIBUTE_VISUAL_POWER_SHIELDING and attributeType == ATTRIBUTE_HEALTH then
if evt == EVENT_UNIT_ATTRIBUTE_VISUAL_UPDATED then
d(zo_strformat("Shield Updated: <<1>>, <<2>>, <<3>>, <<4>>", value1, value2, value3, value4))
elseif evt == EVENT_UNIT_ATTRIBUTE_VISUAL_ADDED then
d(zo_strformat("Shield Added: <<1>>, <<2>>", value1, value2))
elseif evt == EVENT_UNIT_ATTRIBUTE_VISUAL_REMOVED then
d(zo_strformat("Shield Removed: <<1>>, <<2>>", value1, value2))
end
end
end
EVENT_MANAGER:RegisterForEvent(EVENT_UNIT_ATTRIBUTE_VISUAL_ADDED, UnitAttributeVisual)
EVENT_MANAGER:RegisterForEvent(EVENT_UNIT_ATTRIBUTE_VISUAL_REMOVED, UnitAttributeVisual)
EVENT_MANAGER:RegisterForEvent(EVENT_UNIT_ATTRIBUTE_VISUAL_UPDATED, UnitAttributeVisual)
Used events:
Code:
* EVENT_UNIT_ATTRIBUTE_VISUAL_ADDED (*string* _unitTag_, *integer* _unitAttributeVisual_, *integer* _statType_, *integer* _attributeType_, *integer* _powerType_, *number* _value_, *number* _maxValue_)
* EVENT_UNIT_ATTRIBUTE_VISUAL_REMOVED (*string* _unitTag_, *integer* _unitAttributeVisual_, *integer* _statType_, *integer* _attributeType_, *integer* _powerType_, *number* _value_, *number* _maxValue_)
* EVENT_UNIT_ATTRIBUTE_VISUAL_UPDATED (*string* _unitTag_, *integer* _unitAttributeVisual_, *integer* _statType_, *integer* _attributeType_, *integer* _powerType_, *number* _oldValue_, *number* _newValue_, *number* _oldMaxValue_, *number* _newMaxValue_)
Output:
Code:
Shield Updated: 91789, 94453, -36461, -33797
Shield Updated: 94453, 99707, -33797, -28543
Shield Updated: 99707, 99398, -28543, -34007
Shield Updated: 99398, 102062, -34007, -31343
Shield Updated: 102062, 101753, -31343, -36807
Shield Updated: 101753, 107007, -36807, -31553
Shield Updated: 107007, 106698, -31553, -37017
Shield Updated: 106698, 109362, -37017, -34353
Shield Updated: 109362, 109053, -34353, -39817
Shield Updated: 109053, 114307, -39817, -34563
Shield Updated: 114307, 113998, -34563, -40027
Shield Updated: 113998, 116662, -40027, -37363
Shield Updated: 116662, 116353, -37363, -42827
Shield Updated: 116353, 121607, -42827, -37573
Shield Updated: 121607, 121298, -37573, -43037
Shield Updated: 121298, 123962, -43037, -40373
Shield Updated: 123962, 121298, -40373, -43037
Shield Updated: 121298, 123962, -43037, -40373
Shield Updated: 123962, 123653, -40373, -45837
Shield Updated: 123653, 128907, -45837, -40583
Shield Updated: 128907, 128598, -40583, -46047
Shield Updated: 128598, 131262, -46047, -43383
Shield Updated: 131262, 130953, -43383, -48847
Shield Updated: 130953, 136207, -48847, -43593
Shield Updated: 136207, 135898, -43593, -49057
Shield Updated: 135898, 130644, -49057, -54311
I have started with no shield active, it was after reload UI, so some values could be present somewhere.
What I did? Activate Blazing Shield, switch weapon set, activate Healing Ward, switch weapon set, renew Blazing Shield, switch weapons etc. until I run out of magicka.
As you can see, EVENT_UNIT_ATTRIBUTE_VISUAL_ADDED and EVENT_UNIT_ATTRIBUTE_VISUAL_REMOVED wasn't fired even once and shield values in EVENT_UNIT_ATTRIBUTE_VISUAL_UPDATED are, ...hm let's say odd. Max value is negative number?