How can I check whether a modifier is dispellable or not?
This doesn't work because IsPurgable is a CDOTA_Modifier_Lua function
local modifiers = enemy:FindAllModifiers()
if #modifiers > 0 then
for _,modifier in pairs(modifiers) do
if not modifier:IsDebuff() and modifier:IsPurgable() then
if caster:GetHealth() > hp_cost_per_modifier then
caster:SetHealth(caster:GetHealth() - hp_cost_per_modifier)
modifier_count = modifier_count + 1
modifier:Destroy()
end
end
end
end
This is for an ability that dispels an enemy target at the cost of the caster's hp for each debuff, so it stops dispelling when hp gets too low
Is there a way to do this without manually creating a list of dispellable modifiers?