RegDamageCalculateEvent

NL.RegDamageCalculateEvent(Dofile, FuncName)

函数功能

战斗中计算伤害时会触发该函数

参数说明

返回值

无返回值

DamageCalculateCallBack(CharIndex, DefCharIndex, OriDamage, Damage, BattleIndex, Com1, Com2, Com3, DefCom1, DefCom2, DefCom3, Flg)

参数说明

返回值

伤害值数值型

Flg 值说明

参考实例

NL.RegDamageCalculateEvent(nil,"MyDamageCalculateEvent");

function MyDamageCalculateEvent(CharIndex, DefCharIndex, OriDamage, Damage, BattleIndex, Com1, Com2, Com3, DefCom1, DefCom2, DefCom3, Flg)
-- 如果攻击者普通攻击,防御者恰好使用防御,则伤害加倍
  if Com1 == 4 and Com3 == -1 and DefCom1 == 1 and DefCom3 == -1 then
    return Damage*2
  end
  return Damage
end