local statelv_mfd = GetChaStateLv ( role , STATE_MFD )
local hp = Hp(role)
local sp = Sp(role)
if dmg <= 0 then
hp = hp - dmg
SetCharaAttr(hp, role, ATTR_HP )
return
--some codes here
at the end
if statelv_mfd >= 1 then
sp_change = statelv_mfd * 0.25 + 0.5
if getMap == "garner2" then
if isMonster == 0 then
sp_change = statelv_mfd * 0.25 + 0.5
end
end
if dmg / sp_change <= sp then
sp = math.floor ( sp - dmg/sp_change )
else
hp =math.floor ( hp - ( dmg/sp_change - sp ) )
sp = 0
RemoveState ( role , STATE_MFD )
end
else
local ZSExp = GetChaAttr( role , ATTR_CSAILEXP )
if ZSExp > 0 and ZSExp < 100 then
dmg = dmg * 0.945
end
if ZSExp >= 100 and ZSExp < 12100 then
dmg = dmg * ( 0.95 - math.floor( math.pow( (ZSExp / 100) , 0.5 )) * 0.005)
end
hp = Hp(role) - dmg
end
SetCharaAttr(sp, role, ATTR_SP )
SetCharaAttr(hp, role, ATTR_HP )
end