Fixes for Kel'Thuzad and Painsmith encounters
This commit is contained in:
+105
-7
@@ -2026,14 +2026,24 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
return Details:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh
|
||||
|
||||
else
|
||||
|
||||
if (keyName == "enemies") then
|
||||
|
||||
--/run Details:Dump(Details:GetCurrentCombat():GetActor(1, "Injured Steelspine 1"))
|
||||
if (keyName == "enemies") then
|
||||
--amount, total = Details:ContainerSortEnemies (conteudo, amount, "total")
|
||||
amount, total = Details:ContainerSortEnemies (conteudo, amount, "damage_taken")
|
||||
--keyName = "enemies"
|
||||
--> grava o total
|
||||
instancia.top = conteudo[1][keyName]
|
||||
|
||||
--remove actors with zero damage taken
|
||||
local newAmount = 0
|
||||
for i = 1, #conteudo do
|
||||
if (conteudo[i].damage_taken < 1) then
|
||||
newAmount = i-1
|
||||
break
|
||||
end
|
||||
end
|
||||
amount = newAmount
|
||||
|
||||
--keyName = "damage_taken"
|
||||
--result of the first actor
|
||||
instancia.top = conteudo[1] and conteudo[1][keyName]
|
||||
|
||||
elseif (modo == modo_ALL) then --> mostrando ALL
|
||||
|
||||
@@ -5410,6 +5420,94 @@ function atributo_damage:ColetarLixo (lastevent)
|
||||
return Details:ColetarLixo (class_type, lastevent)
|
||||
end
|
||||
|
||||
|
||||
--actor 1 is who will receive the sum from actor2
|
||||
function Details.SumDamageActors(actor1, actor2, actorContainer)
|
||||
--general
|
||||
actor1.total = actor1.total + actor2.total
|
||||
actor1.damage_taken = actor1.damage_taken + actor2.damage_taken
|
||||
actor1.totalabsorbed = actor1.totalabsorbed + actor2.totalabsorbed
|
||||
actor1.total_without_pet = actor1.total_without_pet + actor2.total_without_pet
|
||||
actor1.friendlyfire_total = actor1.friendlyfire_total + actor2.friendlyfire_total
|
||||
|
||||
--damage taken from
|
||||
for actorName in pairs(actor2.damage_from) do
|
||||
actor1.damage_from[actorName] = true
|
||||
|
||||
--add the damage done to actor2 into the damage done to target1
|
||||
if (actorContainer) then
|
||||
--get the actor that caused the damage on actor2
|
||||
local actorObject = actorContainer:GetActor(actorName)
|
||||
if (actorObject) then
|
||||
local damageToActor2 = (actorObject.targets[actor2.nome]) or 0
|
||||
actorObject.targets[actor1.nome] = (actorObject.targets[actor1.nome] or 0) + damageToActor2
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--targets
|
||||
for actorName, damageDone in pairs(actor2.targets) do
|
||||
actor1.targets[actorName] = (actor1.targets[actorName] or 0) + damageDone
|
||||
end
|
||||
|
||||
--pets
|
||||
for i = 1, #actor2.pets do
|
||||
DetailsFramework.table.addunique(actor1.pets, actor2.pets[i])
|
||||
end
|
||||
|
||||
--raid targets
|
||||
for raidTargetFlag, damageDone in pairs(actor2.raid_targets) do
|
||||
actor1.raid_targets[raidTargetFlag] = (actor1.raid_targets[raidTargetFlag] or 0) + damageDone
|
||||
end
|
||||
|
||||
--friendly fire
|
||||
for actorName, ffTable in pairs(actor2.friendlyfire) do
|
||||
actor1.friendlyfire[actorName] = actor1.friendlyfire[actorName] or actor1:CreateFFTable(actorName)
|
||||
actor1.friendlyfire[actorName].total = actor1.friendlyfire[actorName].total + ffTable.total
|
||||
|
||||
for spellId, damageDone in pairs(ffTable.spells) do
|
||||
actor1.friendlyfire[actorName].spells[spellId] = (actor1.friendlyfire[actorName].spells[spellId] or 0) + damageDone
|
||||
end
|
||||
end
|
||||
|
||||
--spells
|
||||
local ignoredKeys = {
|
||||
id = true,
|
||||
spellschool = true,
|
||||
}
|
||||
|
||||
local actor1Spells = actor1.spells
|
||||
for spellId, spellTable in pairs(actor2.spells._ActorTable) do
|
||||
|
||||
local actor1Spell = actor1Spells:GetOrCreateSpell(spellId, true, "DAMAGE_DONE")
|
||||
|
||||
--genetal spell attributes
|
||||
for key, value in pairs(spellTable) do
|
||||
if (type(value) == "number") then
|
||||
if (not ignoredKeys[key]) then
|
||||
if (key == "n_min" or key == "c_min") then
|
||||
if (actor1Spell[key] > value) then
|
||||
actor1Spell[key] = value
|
||||
end
|
||||
elseif (key == "n_max" or key == "c_max") then
|
||||
if (actor1Spell[key] < value) then
|
||||
actor1Spell[key] = value
|
||||
end
|
||||
else
|
||||
actor1Spell[key] = actor1Spell[key] + value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--spell targets
|
||||
for targetName, damageDone in pairs(spellTable) do
|
||||
actor1Spell.targets[targetName] = (actor1Spell.targets[targetName] or 0) + damageDone
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
atributo_damage.__add = function (tabela1, tabela2)
|
||||
|
||||
--> tempo decorrido
|
||||
@@ -5463,7 +5561,7 @@ atributo_damage.__add = function (tabela1, tabela2)
|
||||
|
||||
--> soma os alvos
|
||||
for target_name, amount in _pairs (habilidade.targets) do
|
||||
habilidade_tabela1.targets = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
habilidade_tabela1.targets[target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount
|
||||
end
|
||||
|
||||
--> soma os extras
|
||||
|
||||
Reference in New Issue
Block a user