Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3135,6 +3135,7 @@ function calcs.offence(env, actor, activeSkill)
local totalHitMin, totalHitMax, totalHitAvg = 0, 0, 0
local totalCritMin, totalCritMax, totalCritAvg = 0, 0, 0
local ghostReaver = skillModList:Flag(nil, "GhostReaver")
local ghostReaverLifeLeech = 0
output.LifeLeech = 0
output.LifeLeechInstant = 0
output.EnergyShieldLeech = 0
Expand Down Expand Up @@ -3376,11 +3377,6 @@ function calcs.offence(env, actor, activeSkill)
manaLeech = skillModList:Sum("BASE", cfg, "DamageLeech", "DamageManaLeech", damageType.."DamageManaLeech", isElemental[damageType] and "ElementalDamageManaLeech" or nil) + enemyDB:Sum("BASE", cfg, "SelfDamageManaLeech") / 100
end

if ghostReaver and not noLifeLeech then
energyShieldLeech = energyShieldLeech + lifeLeech
lifeLeech = 0
end

if lifeLeech > 0 and not noLifeLeech then
lifeLeechTotal = lifeLeechTotal + damageTypeHitAvg * lifeLeech / 100
end
Expand Down Expand Up @@ -3413,20 +3409,31 @@ function calcs.offence(env, actor, activeSkill)
totalHitMax = totalHitMax + damageTypeHitMax
end
end
if skillData.lifeLeechPerUse then
if skillData.lifeLeechPerUse and not noLifeLeech then
lifeLeechTotal = lifeLeechTotal + skillData.lifeLeechPerUse
end
if skillData.manaLeechPerUse then
manaLeechTotal = manaLeechTotal + skillData.manaLeechPerUse
end

-- leech caps per instance
lifeLeechTotal = m_min(lifeLeechTotal, globalOutput.MaxLifeLeechInstance)
if ghostReaver then
lifeLeechTotal = m_min(lifeLeechTotal, globalOutput.MaxEnergyShieldLeechInstance)
else
lifeLeechTotal = m_min(lifeLeechTotal, globalOutput.MaxLifeLeechInstance)
end
energyShieldLeechTotal = m_min(energyShieldLeechTotal, globalOutput.MaxEnergyShieldLeechInstance)
manaLeechTotal = m_min(manaLeechTotal, globalOutput.MaxManaLeechInstance)
if ghostReaver and noEnergyShieldLeech then
lifeLeechTotal = 0
end

local portion = (pass == 1) and (output.CritChance / 100) or (1 - output.CritChance / 100)
output.LifeLeech = output.LifeLeech + lifeLeechTotal * portion
if ghostReaver then
ghostReaverLifeLeech = ghostReaverLifeLeech + lifeLeechTotal * portion
else
output.LifeLeech = output.LifeLeech + lifeLeechTotal * portion
end
output.EnergyShieldLeech = output.EnergyShieldLeech + energyShieldLeechTotal * portion
output.ManaLeech = output.ManaLeech + manaLeechTotal * portion
end
Expand Down Expand Up @@ -3474,6 +3481,11 @@ function calcs.offence(env, actor, activeSkill)
output.LifeLeechInstant = output.LifeLeech * output.LifeLeechInstantProportion
output.LifeLeech = output.LifeLeech * (1 - output.LifeLeechInstantProportion)
end
if ghostReaver and ghostReaverLifeLeech > 0 then
output.EnergyShieldLeech = output.EnergyShieldLeech + ghostReaverLifeLeech
output.LifeLeech = 0
output.LifeLeechInstant = 0
end
output.EnergyShieldLeechInstantProportion = m_max(m_min(skillModList:Sum("BASE", cfg, "InstantEnergyShieldLeech") or 0, 100), 0) / 100
if output.EnergyShieldLeechInstantProportion > 0 then
output.EnergyShieldLeechInstant = output.EnergyShieldLeech * output.EnergyShieldLeechInstantProportion
Expand Down
Loading