You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Classes/ModStore.lua
+23-1Lines changed: 23 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -235,13 +235,21 @@ function ModStoreClass:GetMultiplier(var, cfg, noMod)
235
235
end
236
236
237
237
functionModStoreClass:GetStat(stat, cfg)
238
+
-- Checks if any buff in buffList matches
239
+
-- Was needed for skills that provide multiple buffs (e.g. Herald of Agony) and can't be accesses with `buffList[1]`
240
+
localfunctionisNameInBuffList(buffList, name)
241
+
for_, buffinipairs(buffList) do
242
+
ifbuff.name==namethenreturntrueend
243
+
end
244
+
returnfalse
245
+
end
238
246
ifstat=="ManaReservedPercent" then
239
247
localreservedPercentMana=0
240
248
-- Check if mana is 0 (i.e. from Blood Magic) to avoid division by 0.
241
249
localtotalMana=self.actor.output["Mana"]
242
250
iftotalMana==0thenreturn0else
243
251
for_, activeSkillinipairs(self.actor.activeSkillList) do
244
-
if (activeSkill.skillTypes[SkillType.Aura] andnotactiveSkill.skillFlags.disableandactiveSkill.buffListandactiveSkill.buffList[1] andactiveSkill.buffList[1].name==cfg.skillName) then
252
+
if (activeSkill.skillTypes[SkillType.HasReservation] andnotactiveSkill.skillFlags.disableandactiveSkill.buffListandactiveSkill.buffList[1] andcfgand (isNameInBuffList(activeSkill.buffList, cfg.skillName) orisNameInBuffList(activeSkill.buffList, cfg.summonSkillName)) ) then
@@ -250,6 +258,20 @@ function ModStoreClass:GetStat(stat, cfg)
250
258
returnm_min(reservedPercentMana, 100) --Don't let people get more than 100% reservation for aura effect.
251
259
end
252
260
end
261
+
ifstat=="LifeReservedPercent" then
262
+
localreservedPercentLife=0
263
+
localtotalLife=self.actor.output["Life"]
264
+
iftotalLife==0thenreturn0else
265
+
for_, activeSkillinipairs(self.actor.activeSkillList) do
266
+
if (activeSkill.skillTypes[SkillType.HasReservation] andnotactiveSkill.skillFlags.disableandactiveSkill.buffListandactiveSkill.buffList[1] andcfgand (isNameInBuffList(activeSkill.buffList, cfg.skillName) orisNameInBuffList(activeSkill.buffList, cfg.summonSkillName)) ) then
0 commit comments