Skip to content
Merged
Show file tree
Hide file tree
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
36 changes: 17 additions & 19 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ local function getTriggerDefaultCooldown(supportList, name)
return 100
end

local function slotMatch(env, skill)
local fromItem = (env.player.mainSkill.activeEffect.grantedEffect.fromItem or skill.activeEffect.grantedEffect.fromItem)
fromItem = fromItem or (env.player.mainSkill.activeEffect.srcInstance.fromItem or skill.activeEffect.srcInstance.fromItem)
local match1 = fromItem and skill.socketGroup and skill.socketGroup.slot == env.player.mainSkill.socketGroup.slot
local match2 = (not env.player.mainSkill.activeEffect.grantedEffect.fromItem) and skill.socketGroup == env.player.mainSkill.socketGroup
return (match1 or match2)
end

-- Merge an instance of a buff, taking the highest value of each modifier
local function mergeBuff(src, destTable, destKey)
if not destTable[destKey] then
Expand Down Expand Up @@ -1508,12 +1516,10 @@ function calcs.perform(env, avoidCache, fullDPSSkipEHP)
activeSkill.skillData.triggered = true
local spellCount, quality = 0
for _, skill in ipairs(env.player.activeSkillList) do
local match1 = skill.activeEffect.grantedEffect.fromItem and skill.socketGroup and skill.socketGroup.slot == activeSkill.socketGroup.slot
local match2 = not skill.activeEffect.grantedEffect.fromItem and skill.socketGroup == activeSkill.socketGroup
if skill.skillData.triggeredByBrand and (match1 or match2) then
if skill.skillData.triggeredByBrand and slotMatch(env, skill) then
spellCount = spellCount + 1
end
if skill.activeEffect.grantedEffect.name == "Arcanist Brand" and (match1 or match2) then
if skill.activeEffect.grantedEffect.name == "Arcanist Brand" and slotMatch(env, skill) then
quality = skill.activeEffect.quality / 2
end
end
Expand Down Expand Up @@ -3417,12 +3423,10 @@ function calcs.perform(env, avoidCache, fullDPSSkipEHP)
local trigRate = 0
local source = nil
for _, skill in ipairs(env.player.activeSkillList) do
local match1 = env.player.mainSkill.activeEffect.grantedEffect.fromItem and skill.socketGroup and skill.socketGroup.slot == env.player.mainSkill.socketGroup.slot
local match2 = (not env.player.mainSkill.activeEffect.grantedEffect.fromItem) and skill.socketGroup == env.player.mainSkill.socketGroup
if skill.skillTypes[SkillType.Attack] and skill ~= env.player.mainSkill and (match1 or match2) then
if skill.skillTypes[SkillType.Attack] and skill ~= env.player.mainSkill and slotMatch(env, skill) then
source, trigRate = findTriggerSkill(env, skill, source, trigRate)
end
if skill.skillData.triggeredByCoC and (match1 or match2) then
if skill.skillData.triggeredByCoC and slotMatch(env, skill) then
local cooldownOverride = skill.skillModList:Override(env.player.mainSkill.skillCfg, "CooldownRecovery")
t_insert(spellCount, { uuid = cacheSkillUUID(skill), cd = cooldownOverride or (skill.skillData.cooldown / icdr), next_trig = 0, count = 0 })
end
Expand Down Expand Up @@ -3469,12 +3473,10 @@ function calcs.perform(env, avoidCache, fullDPSSkipEHP)
local trigRate = 0
local source = nil
for _, skill in ipairs(env.player.activeSkillList) do
local match1 = env.player.mainSkill.activeEffect.grantedEffect.fromItem and skill.socketGroup and skill.socketGroup.slot == env.player.mainSkill.socketGroup.slot
local match2 = (not env.player.mainSkill.activeEffect.grantedEffect.fromItem) and skill.socketGroup == env.player.mainSkill.socketGroup
if skill.skillTypes[SkillType.Attack] and skill.skillTypes[SkillType.Melee] and skill ~= env.player.mainSkill and (match1 or match2) then
if skill.skillTypes[SkillType.Attack] and skill.skillTypes[SkillType.Melee] and skill ~= env.player.mainSkill and slotMatch(env, skill) then
source, trigRate = findTriggerSkill(env, skill, source, trigRate)
end
if skill.skillData.triggeredByMeleeKill and (match1 or match2) then
if skill.skillData.triggeredByMeleeKill and slotMatch(env, skill) then
local cooldownOverride = skill.skillModList:Override(env.player.mainSkill.skillCfg, "CooldownRecovery")
t_insert(spellCount, { uuid = cacheSkillUUID(skill), cd = cooldownOverride or (skill.skillData.cooldown / icdr), next_trig = 0, count = 0 })
end
Expand Down Expand Up @@ -3518,12 +3520,10 @@ function calcs.perform(env, avoidCache, fullDPSSkipEHP)
local trigRate = 0
local source = nil
for _, skill in ipairs(env.player.activeSkillList) do
local match1 = env.player.mainSkill.activeEffect.grantedEffect.fromItem and skill.socketGroup and skill.socketGroup.slot == env.player.mainSkill.socketGroup.slot
local match2 = (not env.player.mainSkill.activeEffect.grantedEffect.fromItem) and skill.socketGroup == env.player.mainSkill.socketGroup
if skill.skillTypes[SkillType.Channel] and skill ~= env.player.mainSkill and (match1 or match2) then
if skill.skillTypes[SkillType.Channel] and skill ~= env.player.mainSkill and slotMatch(env, skill) then
source, trigRate = findTriggerSkill(env, skill, source, trigRate)
end
if skill.skillData.triggeredWhileChannelling and (match1 or match2) then
if skill.skillData.triggeredWhileChannelling and slotMatch(env, skill) then
t_insert(spellCount, { uuid = cacheSkillUUID(skill), cd = skill.skillData.cooldown, next_trig = 0, count = 0 })
end
end
Expand Down Expand Up @@ -3714,9 +3714,7 @@ function calcs.perform(env, avoidCache, fullDPSSkipEHP)
local hexCastRate = 0

for _, skill in ipairs(env.player.activeSkillList) do
local match1 = env.player.mainSkill.activeEffect.grantedEffect.fromItem and skill.socketGroup.slot == env.player.mainSkill.socketGroup.slot
local match2 = (not env.player.mainSkill.activeEffect.grantedEffect.fromItem) and skill.socketGroup == env.player.mainSkill.socketGroup
if skill.skillTypes[SkillType.Hex] and (match1 or match2) then
if skill.skillTypes[SkillType.Hex] and slotMatch(env, skill) then
source, hexCastRate = findTriggerSkill(env, skill, source, hexCastRate)
end
end
Expand Down
1 change: 1 addition & 0 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ function calcs.initEnv(build, mode, override, specEnv)
quality = 0,
enabled = true,
}
activeGemInstance.fromItem = grantedSkill.sourceItem ~= nil
activeGemInstance.gemId = nil
activeGemInstance.level = grantedSkill.level
activeGemInstance.enableGlobal1 = true
Expand Down
13 changes: 9 additions & 4 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1795,10 +1795,15 @@ local function extraSupport(name, level, slot)
if skillId then
local gemId = data.gemForBaseName[data.skills[skillId].name .. " Support"]
if gemId then
return {
mod("ExtraSupport", "LIST", { skillId = data.gems[gemId].grantedEffectId, level = level }, { type = "SocketedIn", slotName = slot }),
mod("ExtraSupport", "LIST", { skillId = data.gems[gemId].secondaryGrantedEffectId, level = level }, { type = "SocketedIn", slotName = slot })
}
local mods = {mod("ExtraSupport", "LIST", { skillId = data.gems[gemId].grantedEffectId, level = level }, { type = "SocketedIn", slotName = slot })}
if data.gems[gemId].secondaryGrantedEffect then
if data.gems[gemId].secondaryGrantedEffect.support then
t_insert(mods, mod("ExtraSupport", "LIST", { skillId = data.gems[gemId].secondaryGrantedEffectId, level = level }, { type = "SocketedIn", slotName = slot }))
else
t_insert(mods, mod("ExtraSkill", "LIST", { skillId = data.gems[gemId].secondaryGrantedEffectId, level = level }))
end
end
return mods
else
return {
mod("ExtraSupport", "LIST", { skillId = skillId, level = level }, { type = "SocketedIn", slotName = slot }),
Expand Down