View Single Post
12-07-23, 02:38 PM   #2
Erdshockegon
A Defias Bandit
Join Date: Dec 2023
Posts: 3
Update: With the help of ChatGPT I've created this update:

function(allstates, event, _, subevent, _, sourceGUID, _, _, _, _, _, _, _, arg1, arg2, arg3, arg4, arg5, arg6, arg7, _, _, arg10, _, arg12, arg13)
local c = aura_env.config
-- Existing code...

-- Initialize total damage and hit/crit counters
local totalMHDamage = 0
local totalMHHits = 0
local totalMHCrits = 0

-- At the end of the function
for hand, saved_state in pairs(aura_env.saved_states) do
if hand == "MH" then
totalMHDamage = totalMHDamage + saved_state.damage
totalMHHits = totalMHHits + saved_state.hits
totalMHCrits = totalMHCrits + saved_state.crits
end
end

-- Additional logic for Windfury hits
local windfuryHits = aura_env.saved_states["Windfury"]
if windfuryHits then
totalMHDamage = totalMHDamage + windfuryHits.damage
totalMHHits = totalMHHits + windfuryHits.hits
totalMHCrits = totalMHCrits + windfuryHits.crits
end

-- Build and return a string
local resultString = "Total MH Damage: " .. totalMHDamage .. " (Hits: " .. totalMHHits .. ", Crits: " .. totalMHCrits .. ")"
return resultString
end

It is a bit fancier, becaus it also lists the Hits and crits.
But still it misses one hit of the total hit count. But I dont see how to get this, because we get the damage amout out of saved_state.damage where the combiend damage should be?



It also seems to not reset the WF hit count if two WFs proc one after another, so it can happen that hits are 4 and crit 1.
When this happens the chat output is also one hit behind.
So it seems that there must be a counting issue somewhere i guess.

Last edited by Erdshockegon : 12-07-23 at 03:12 PM. Reason: Added Image and additional Info
  Reply With Quote