Through StatusGetEnterChance
local fireResistanceStatuses = {}
---@param status EsvStatus
---@param isEnterCheck boolean
Ext.RegisterListener("StatusGetEnterChance", function(status, isEnterCheck)
if fireResistanceStatuses[status.StatusId] then
---@type EsvCharacter
local target = Ext.GetGameObject(status.TargetHandle)
if target and getmetatable(target) == "esv::Character" and target.Stats.TALENT_Demon then
return 0
end
end
end)
Ext.RegisterListener("SessionLoaded", function()
for i,v in pairs(Ext.GetStatEntries("StatusData")) do
local potion = Ext.StatGetAttribute(v, "StatsId")
if potion and potion ~= "" then
if string.find(potion, ",") then
--Multi-potion statuses, like SUPERCHARGE
for m in string.gmatch(potion, "([^;,]+,)") do
local stat = string.gsub(m, ",", "")
local fireResistance = Ext.StatGetAttribute(stat, "FireResistance")
if fireResistance and fireResistance < 0 then
fireResistanceStatuses[v] = true
end
end
else
local fireResistance = Ext.StatGetAttribute(potion, "FireResistance")
if fireResistance and fireResistance < 0 then
fireResistanceStatuses[v] = true
end
end
end
end
if Ext.IsDeveloperMode() then
Ext.Print("Negative Fire Resistance Statuses:")
Ext.Print(Ext.JsonStringify(fireResistanceStatuses))
end
end)