|

楼主 |
发表于 2020-10-13 20:13:22
|
显示全部楼层
function on_GetAttackPower(actor, Target, nPoint)
local incPoint = 0
local RaceId = actor:getRace()--种族ID
if (RaceId == 66) or (RaceId == 0) then--(英雄或人物)按角色的幸运值,进行威力加倍输出
local luck = actor:getLuck()--取人物的幸运值
if luck > 7 then
if luck > 10 then
incPoint= math.round(nPoint * 1.5)
elseif luck == 10 then
incPoint= math.round(nPoint * 1.3)
elseif luck == 9 then
incPoint= math.round(nPoint * 1.2)
elseif luck == 8 then
incPoint= math.round(nPoint * 1.1)
end
print("["..actor:getCharName().."]幸运值["..tostring(luck).."]造成威力加成["..tostring(incPoint).."]--[计算攻击威力(返回输出威力)]")
end
end
return nPoint + incPoint
end |
|