Formula
CommonFun.calcBuff_5970
function CommonFun.calcBuff_5970(srcUser, targetUser, a, b, c, d, lv)
if srcUser == nil or targetUser == nil then
return 0
end
local FireAtk = srcUser:GetProperty("FireAtk")
local WaterAtk = srcUser:GetProperty("WaterAtk")
local WindAtk = srcUser:GetProperty("WindAtk")
local EarthAtk = srcUser:GetProperty("EarthAtk")
local GhostAtk = srcUser:GetProperty("GhostAtk")
local Max = 0
if FireAtk >= WaterAtk then
Max = FireAtk
else
Max = WaterAtk
end
if WindAtk <= Max then
else
Max = WindAtk
end
if EarthAtk <= Max then
else
Max = EarthAtk
end
if GhostAtk <= Max then
else
Max = GhostAtk
end
local skilllv = srcUser:GetLernedSkillLevel(3104_WHITESMITH:ELEMENT_BALANCE)
local skilllv1 = srcUser:GetLernedSkillLevel(1951_SNIPER:ELEMENT_BALANCE)
local ratio = (skilllv + skilllv1) * 0.1
local A = ((Max - FireAtk) * a + (Max - WaterAtk) * b + (Max - WindAtk) * c + (Max - EarthAtk) * d) * ratio
if a == 0 and b == 0 and c == 0 and d == 0 then
A = (Max - GhostAtk) * ratio
end
return A
end