Heyo Fatshark Team,
When coding one of my mods I noticed that the Property Damage Reduction vs Area Damage is not working in the Game.
This is what I did to fix it with the help of the community:
– Fix Poison Damage Reduction not Working
local POISON_DAMAGE_TYPES = {
aoe_poison_dot = true,
poison = true,
arrow_poison = true,
arrow_poison_dot = true
}
local POISON_DAMAGE_SOURCES = {
skaven_poison_wind_globadier = true,
poison_dot = true
}
mod:hook(DamageUtils, “apply_buffs_to_damage”, function (func, current_damage, attacked_unit, attacker_unit, damage_source, …)
if ScriptUnit.has_extension(attacked_unit, “buff_system”) then
local buff_extension = ScriptUnit.extension(attacked_unit, “buff_system”)
if DAMAGE_TYPES_AOE[damage_type] or POISON_DAMAGE_TYPES[damage_type] or POISON_DAMAGE_SOURCES[damage_source] then
current_damage = buff_extension:apply_buffs_to_value(current_damage, "protection_aoe")
end
end
return func(current_damage, attacked_unit, attacker_unit, damage_source, ...)
end)
Maybe someone can take a look and fix it properly ^^
Greetings and have a nice day
Janoti!