function onStatsChange(cid, attacker, type, combat, value)
if getCreatureStorage(cid, STORAGE_ABSORB-1) == 1 then
doCreatureSetStorage(cid, STORAGE_ABSORB-1, -1)
return true
end
local combats =
{
[1] = {1},
[2] = {2},
[4] = {3},
[8] = {4},
[32] = {5},
[64] = {6},
[512] = {7},
[1024] = {8},
[2048] = {9}
}
local COMBATS = combats[combat]
if COMBATS then
if exhaustion.check(cid,COMBATS[1]+ STORAGE_ABSORB + 100) then
storage = getCreatureStorage(cid, STORAGE_ABSORB + COMBATS[1])
value = (value * (storage/100))
doCreatureSetStorage(cid, STORAGE_ABSORB-1, 1)
doTargetCombatHealth(attacker, cid, combat, -value, -value, INVISIBLE_EFFECT)
return false
end
end
return true
end