补充下,忘记加判断自身等级或心法等级(满级的前提下)比对方高(满级的前提下),是否经脉加点附加。
--计算攻击威力(返回输出威力,根据攻击者的等级,等级比对方高,造成额外伤害)
function on_GetAttackPower2(actor, Target, nPoint)
local incPoint = 0
local RaceId = actor:getRace()--种族ID
if (RaceId == 66) or (RaceId == 0) then--(英雄或人物)按角色的等级,进行威力加倍输出
local level = actor:getLevel() --取角色(攻击者)等级
local objlevel = Target:getLevel() --取角色(目标对象)等级
local sublv = level - objlevel
local RaceId2 = Target:getRace()--种族ID
local a1 = s.share.getMaxLevel()
if level < a1 or objlevel < a1 then
return
else
--判断附加的等级是否经脉加点所附加,若不是则返回
local Level = actor:getHumanVar("主号角色等级")
local HeroLevel = actor:getHumanVar("英雄角色等级")
if Level == 0 then
return
end
if HeroLevel == 0 then
return
end
end
if sublv > 0 then
if (RaceId2 == 66) or (RaceId2 == 0) then--(目标是英雄或人物)按攻击角色的等级,进行威力加倍承受
for i = 1,sublv do
incPoint= math.round(nPoint * (1 + i * 0.2))
end
local point = nPoint + incPoint
actor:sendMsg(1,"["..actor:getCharName().."]等级比对手".."["..Target:getCharName().."]高["..tostring(sublv).."]级,每级造成的威力加成20%,造成额外伤害["..tostring(incPoint).."]".."总威力为:"..point,-1,-1)
end
end
end
return nPoint + incPoint
end
--计算攻击威力(返回输出威力,根据攻击者的心法等级,心法等级比对方高,造成额外伤害)
function on_GetAttackPower3(actor, Target, nPoint)
local incPoint = 0
local RaceId = actor:getRace()--种族ID
if (RaceId == 66) or (RaceId == 0) then--(英雄或人物)按角色的等级,进行威力加倍输出
local level = actor:getHeartLevel() --取角色(攻击者)心法等级
local objlevel = Target:getHeartLevel() --取角色(目标对象)心法等级
local sublv = level - objlevel
local RaceId2 = Target:getRace()--种族ID
if level < 999 or objlevel < 999 then
return
else
--判断附加的心法等级是否经脉加点所附加,若不是则返回
local Level = actor:getHumanVar("主号心法等级")
local HeroLevel = actor:getHumanVar("英雄心法等级")
if Level == 0 then
return
end
if HeroLevel == 0 then
return
end
end
if sublv > 0 then
if (RaceId2 == 66) or (RaceId2 == 0) then--(目标是英雄或人物)按攻击心法的等级,进行威力加倍承受
for i = 1,sublv do
incPoint= math.round(nPoint * (1 + i * 0.3))
end
local point = nPoint + incPoint
actor:sendMsg(1,"["..actor:getCharName().."]心法等级比对手".."["..Target:getCharName().."]高["..tostring(sublv).."]级,每级造成的威力加成30%,造成额外伤害["..tostring(incPoint).."]".."总威力为:"..point,-1,-1)
end
end
end
return nPoint + incPoint
end
|