local function getProtectionAll(item)
local absorbPercents = item:getType():getAbilities()['absorbPercent']
local count = absorbPercents[0]
if count ~= 0 then
for index = 1, 11 do
if absorbPercents[index] ~= count then
return 0
end
end
end
return count
end
local function getPlayerProtectionAll(player)
local count = 0
for slot = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
local item = player:getSlotItem(slot)
if item then
count = count + getProtectionAll(item)
end
end
return count
end