|
求个大佬看看是哪里出问题了,为啥这么写天龙的诸我圆满没有效果
function x813651_GetAttrAttack(sceneId, selfId, ice, fire, light, posion)
--local ZongMengAttrAttack = {}
--for i = 1 , 4 do ZongMengAttrAttack[i] = 0 end
--ZongMengAttrAttack[1],ZongMengAttrAttack[2],ZongMengAttrAttack[3],ZongMengAttrAttack[4] = CallScriptFunction(813651, "GetAttrAttack", sceneId, selfId, IceAttack, FireAttack, LightAttack, PosionAttack)
--for i = 1 , 4 do print(format("ZongMengAttrAttack[%d] = %d", i, ZongMengAttrAttack[i])) end
--IceAttack = IceAttack + ZongMengAttrAttack[1]
--FireAttack = FireAttack + ZongMengAttrAttack[2]
--LightAttack = LightAttack + ZongMengAttrAttack[3]
--PosionAttack = PosionAttack + ZongMengAttrAttack[4]
local nRateLevel = 0
for i = 21348, 21352 do
if LuaFnHaveImpactOfSpecificDataIndex(sceneId, selfId, i) == 1 then
nRateLevel = i - 21347
break
end
end
if nRateLevel == 0 then
return 0, 0, 0, 0
end
local nEnhanceAttrAttackList = {0, 0, 0, 0}
local nAttrAttackList = {ice, fire, light, posion}
local nMaxAttrAttack = nAttrAttackList[1]
local nMaxAttrAttackIndex = 1
local nNotMaxAttrAttackSum = 0
for i = 2, 4 do
if nAttrAttackList[i] > nMaxAttrAttack then
nMaxAttrAttack = nAttrAttackList[i]
nMaxAttrAttackIndex = i
end
end
for i = 1, 4 do
if i ~= nMaxAttrAttackIndex then
nNotMaxAttrAttackSum = nNotMaxAttrAttackSum + nAttrAttackList[i]
end
end
local nRateList = {0.04, 0.09, 0.15, 0.22, 0.3}
nEnhanceAttrAttackList[nMaxAttrAttackIndex] = nAttrAttackList[nMaxAttrAttackIndex] * nRateList[nRateLevel]
return nEnhanceAttrAttackList[1], nEnhanceAttrAttackList[2], nEnhanceAttrAttackList[3], nEnhanceAttrAttackList[4]
end
|
|