Formula
CommonFun.GetDamReduceValue
function CommonFun.GetDamReduceValue(srcUser, targetUser, value)
local damage = value
if damage ~= 0 then
end
local mapid, maptype = srcUser:GetMapInfo()
if damage ~= 0 and targetUser.zoneType == 24 then
damage = damage / 500
end
if damage ~= 0 and mapid == WHITESTAR_AIRSHIP then
damage = damage / (math.random(0, 1) * 4 + 48) / 10
end
if damage ~= 0 and targetUser.zoneType == 25 then
damage = damage / (math.random(0, 1) * 60 + 570)
end
if damage ~= 0 and targetUser.zoneType == 26 then
damage = damage / (math.random(0, 1) * 20 + 190)
end
if damage ~= 0 and (mapid == TOWER_OF_EVILNESS_V or mapid == TOWER_OF_HEAT_V or mapid == TOWER_OF_WORLDLINE_V or mapid == TOWER_OF_DOOM_V) then
damage = damage / (math.random(0, 1) * 10 + 95)
end
if damage ~= 0 and (mapid == TOWER_OF_EVILNESS_IV or mapid == TOWER_OF_HEAT_IV or mapid == TOWER_OF_WORLDLINE_IV or mapid == TOWER_OF_DOOM_IV) then
damage = damage / 10
end
if GameConfig.Prestige.ValidMap[mapid] == 1 then
local shengwang1 = srcUser:GetPrestigeLevel()
local shengwang2 = targetUser:GetPrestigeLevel()
if damage ~= 0 and shengwang1 * shengwang2 ~= 0 then
local xishu = shengwang2 - shengwang1
local jianshang = 1
if 1 <= xishu then
if xishu <= 3 then
jianshang = 1 - xishu * 0.3
else
jianshang = 0.01
end
end
if xishu <= -1 and targetUser:GetNpcID() == 0 then
jianshang = -xishu * 2
end
damage = damage * jianshang
end
end
if damage <= 1 then
return 1
end
if 2147483647 <= damage then
damage = 2147483647
end
return damage
end