3296 lines
140 KiB
Lua
3296 lines
140 KiB
Lua
local floor = math.floor
|
||
local min = math.min
|
||
local max = math.max
|
||
--local RoleDataName = RoleDataName
|
||
--local BattleLogic = BattleLogic
|
||
--local BattleUtil = BattleUtil
|
||
|
||
local function buffRandomAction(random, target, buff)
|
||
|
||
-- 检测被动技能对技能的加成
|
||
local rate = random
|
||
local _ControlRatePassivitying = function(finalRate)
|
||
rate = finalRate
|
||
end
|
||
buff.caster.Event:DispatchEvent(BattleEventName.SkillRandomBuff, target, buff, rate, _ControlRatePassivitying)
|
||
|
||
-- 计算概率
|
||
local b = Random.Range01() <= rate
|
||
if b then
|
||
target:AddBuff(buff)
|
||
return true
|
||
else
|
||
target.Event:DispatchEvent(BattleEventName.BuffDodge, buff)
|
||
BattleLogic.BuffMgr:PutBuff(buff)
|
||
end
|
||
end
|
||
|
||
local function calBuffHit(caster, target, baseRandom)
|
||
if caster.isTeam then --异妖不走效果命中公式
|
||
return baseRandom
|
||
end
|
||
local hit = (1 + caster:GetRoleData(RoleDataName.Hit) / (1 + target:GetRoleData(RoleDataName.Dodge)))
|
||
hit = baseRandom + caster:GetRoleData(RoleDataName.Hit)
|
||
return baseRandom
|
||
end
|
||
|
||
local function clearBuffPredicate(buff, type)
|
||
local flag = false
|
||
if type == 1 then --持续恢复
|
||
flag = buff.type == BuffName.HOT
|
||
elseif type == 2 then --护盾
|
||
flag = buff.type == BuffName.Shield
|
||
elseif type == 3 then --增益状态
|
||
flag = buff.isBuff == true
|
||
elseif type == 4 then --减益状态
|
||
flag = buff.isDeBuff == true
|
||
elseif type == 5 then --持续伤害
|
||
flag = buff.type == BuffName.DOT
|
||
elseif type == 6 then --负面状态(控制状态、减益状态和持续伤害状态)
|
||
flag = buff.type == BuffName.Control or buff.isDeBuff or buff.type == BuffName.DOT
|
||
end
|
||
return flag
|
||
end
|
||
|
||
--效果表
|
||
local effectList = {
|
||
|
||
--造成[a]%的[b]伤害
|
||
--a[float],b[伤害类型]
|
||
[1] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
-- LogError("造成伤害"..os:clock());
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害【AOE】
|
||
--a[float],b[伤害类型]
|
||
[2] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
-- caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end,
|
||
--[a]%概率[b],持续[c]秒
|
||
--a[float],b[控制状态],c[float]
|
||
[3] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local cb1 = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomControl(f1, cb1, caster, target, f2,skill)
|
||
end)
|
||
end,
|
||
--[a]属性[b]%,持续[c]秒[d]改变
|
||
--a[属性],b[float],c[int],d[改变类型]
|
||
[4] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
local ct = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local buff = Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct)
|
||
if f2 == 0 then
|
||
buff.cover = true
|
||
end
|
||
target:AddBuff(buff)
|
||
end)
|
||
end,
|
||
--持续恢复[a]*[b]%生命,持续[c]秒
|
||
--a[属性],b[float],c[int]
|
||
[5] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(f1, caster:GetRoleData(BattlePropList[pro1])))
|
||
target:AddBuff(Buff.Create(caster, BuffName.HOT, f2, 1, val))
|
||
end)
|
||
end,
|
||
--造成[a]到[b]次[c]%的[d]伤害
|
||
--a[int],b[int],c[float],d[伤害类型]
|
||
[6] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local i2 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
|
||
local count = Random.RangeInt(i1, i2)
|
||
local d = interval / count
|
||
for i=1, count do
|
||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end)
|
||
end
|
||
end,
|
||
--造成[a]到[b]次[c]%的[d]伤害【AOE】
|
||
--a[int],b[int],c[float],d[伤害类型]
|
||
[7] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local i2 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
|
||
local count = Random.RangeInt(i1, i2)
|
||
local d = interval / count
|
||
for i=1, count do
|
||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end)
|
||
end
|
||
end,
|
||
--[b]%改变[c]下次重击技能CD[a]秒
|
||
--a[float],b[float],c[改变类型]
|
||
[8] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local f2 = args[2]
|
||
local ct = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(f2, function ()
|
||
target:AddSkillCD(f1, ct)
|
||
end)
|
||
end)
|
||
end,
|
||
--添加[a]的[b]%护盾,持续[c]秒,盾消失的时候反射吸收伤害的[d]%
|
||
--a[属性],b[float],c[int],d[float]
|
||
[9] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(f1, caster:GetRoleData(BattlePropList[pro1])))
|
||
target:AddBuff(Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, val, f3))
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,自身恢复造成伤害[c]%的生命
|
||
--a[float],b[伤害类型],c[float]
|
||
[10] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local dmg = BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if f2==0 or dmg==nil then
|
||
return
|
||
end
|
||
BattleUtil.CalTreat(caster, caster, floor(dmg * f2),1,skill)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,对[c]造成额外[d]%伤害
|
||
--a[float],b[伤害类型,]c[职业],d[float]
|
||
[11] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local i1 = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if target.roleData.professionId == i1 then
|
||
f1 = f1*(1+f2)
|
||
end
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end,
|
||
--每秒造成[a]的[b]的伤害,持续[c]秒
|
||
--a[float],b[伤害类型],c[int]
|
||
[12] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local buff=Buff.Create(caster, BuffName.DOT, f2, 1, 0, dt, f1)
|
||
buff.skill=skill
|
||
target:AddBuff(buff)
|
||
end)
|
||
end,
|
||
--造成[a],每秒造成[b]的[c]的伤害,持续[d]秒
|
||
--a[持续伤害状态].b[float],c[伤害类型],d[int]
|
||
[13] = function(caster, target, args, interval, skill)
|
||
local d1 = args[1]
|
||
local f1 = args[2]
|
||
local dt = args[3]
|
||
local f2 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
target:AddBuff(Buff.Create(caster, BuffName.DOT, f2, 1, d1, dt, f1))
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,[c]%概率[d]专属伤害加深印记(如果有印记,[a]*(1+印记数量*[e])),印记最多[f]层(减益印记,不可驱散)
|
||
--a[float],b[伤害类型],c[float],d[角色id],e[float],f[int]
|
||
[14] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local rid = args[4]
|
||
local f3 = args[5]
|
||
local i1 = args[6]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local layer
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
|
||
local b = buff.flag == rid
|
||
if b then
|
||
layer = buff.layer
|
||
end
|
||
return b
|
||
end) then
|
||
BattleUtil.CalDamage(skill, caster, target, dt,f1 * (1 + min(layer, i1) * f3))
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
local buff = Buff.Create(caster, BuffName.Brand, 0, rid)
|
||
buff.isDeBuff = true
|
||
buff.clear = false
|
||
buffRandomAction(f2, target, buff)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,如果击杀,则其他人再受到此次伤害的[c]%的伤害
|
||
--a[float],b[伤害类型],c[float]
|
||
[15] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if target:IsDead() then
|
||
local arr = RoleManager.Query(function (r) return r.camp ~= caster.camp and r.uid ~= target.uid end)
|
||
for i=1, #arr do
|
||
BattleUtil.ApplyDamage(skill, caster, arr[i], floor(dmg * f2))
|
||
end
|
||
end
|
||
end)
|
||
end,
|
||
--吸取[a]%的[b],持续[c]秒(属于增益),累积不高于自身该属性的[d]%
|
||
--a[float],b[属性],c[float],d[float]
|
||
[16] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local pro = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
--计算上限值
|
||
local total = caster.data:GetOrginData(BattlePropList[pro]) * (1 + f3)
|
||
--计算预期吸取后的值
|
||
local targetValue = caster:GetRoleData(BattlePropList[pro]) + target:GetRoleData(BattlePropList[pro]) * f1
|
||
--计算有效吸收值
|
||
local delta = min(targetValue, total) - caster:GetRoleData(BattlePropList[pro])
|
||
|
||
if delta > 0 then
|
||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro], delta, 3))
|
||
caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro], delta, 1))
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,如果是[c],有[d]%必定暴击
|
||
--a[float],b[伤害类型],c[职业],d[float]
|
||
[17] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local i1 = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if target.roleData.professionId == i1 then
|
||
BattleUtil.RandomAction(f2, function ()
|
||
target.isFlagCrit = true
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.isFlagCrit = false
|
||
end)
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,若暴击,则减少下次发动技能CD[c]秒。
|
||
--a[float],b[伤害类型],c[float]
|
||
[18] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local d, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if crit then
|
||
caster:AddSkillCD(f2, 3)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,有[c]%的概率追加伤害,最多可追加[d]次。(0无限追加)
|
||
--a[float],b[伤害类型],c[float],d[int]
|
||
[19] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local i1 = args[4]
|
||
|
||
if i1 == 0 then
|
||
i1 = floor(interval*BattleLogic.GameFrameRate)
|
||
end
|
||
local count = 1
|
||
while Random.Range01() <= f2 and count <= i1 do
|
||
count = count + 1
|
||
end
|
||
local d = interval / count
|
||
for i=1, count do
|
||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end)
|
||
end
|
||
end,
|
||
--造成[a]%的[b]伤害,对[c]造成额外[d]%伤害
|
||
--a[float],b[伤害类型,]c[控制状态],d[float]
|
||
[20] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local i1 = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return i1 == 0 or buff.ctrlType == i1 end) then
|
||
f1 = f1*(1+f2)
|
||
end
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,对[c]有[d]%造成[e],持续[f]秒【AOE】
|
||
--a[float],b[伤害类型,]c[持续伤害状态],d[float],e[控制状态],f[int]
|
||
[21] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local dot = args[3]
|
||
local f2 = args[4]
|
||
local ct = args[5]
|
||
local f3 = args[6]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end,caster,dot) then
|
||
BattleUtil.RandomControl(f1, ct, caster, target, f3,skill)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,对[c]造成额外[d]%伤害【AOE】
|
||
--a[float],b[伤害类型,]c[持续伤害状态],d[float]
|
||
[22] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local dot = args[3]
|
||
local f2 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end,caster,dot) then
|
||
f1 = f1*(1+f2)
|
||
end
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,对[c]造成额外[d]%伤害
|
||
--a[float],b[伤害类型,]c[持续回复状态],d[float]
|
||
[23] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local ht = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.HOT, function (buff) return true end) then
|
||
f1 = f1*(1+f2)
|
||
end
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end,
|
||
--瞬间恢复[a]*[b]%生命
|
||
--a[属性],b[float]
|
||
[24] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
|
||
BattleUtil.CalTreat(caster, target, val,1,skill)
|
||
end)
|
||
end,
|
||
--对[a]的伤害[b]%,持续[c]秒
|
||
--a[持续伤害状态],b[float],c[int]
|
||
[25] = function(caster, target, args, interval, skill)
|
||
local dot = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local trigger = function(defRole, damageFunc, damage)
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff)
|
||
return dot == 0 or buff.damageType == dot
|
||
end,caster,dot) then
|
||
damage = damage + floor(damage * f1)
|
||
end
|
||
damageFunc(damage)
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleBeDamagedAfter, trigger)
|
||
if f2 > 0 then
|
||
BattleLogic.WaitForTrigger(f2, function ()
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeDamagedAfter, trigger)
|
||
end)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]的伤害【AOE】(真实伤害)
|
||
--a[int]
|
||
[26] = function(caster, target, args, interval, skill)
|
||
local d = args[1]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if not target:IsRealDead() then
|
||
BattleUtil.ApplyDamage(skill, caster, target, d)
|
||
end
|
||
end)
|
||
end,
|
||
--每秒造成[d]的伤害,持续[f]秒【AOE】(真实伤害)
|
||
--d[float],f[int]
|
||
[27] = function(caster, target, args, interval, skill)
|
||
local d1 = args[1]
|
||
local d2 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local buff=Buff.Create(caster, BuffName.DOT, d2, 1, 0, d1, 1)
|
||
buff.skill=skill
|
||
target:AddBuff(buff)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,对[c]造成额外[d]%伤害
|
||
--a[float],b[伤害类型,]c[持续伤害状态],d[float]
|
||
[28] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local dot = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end,caster,dot) then
|
||
f1 = f1*(1+f2)
|
||
end
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end,
|
||
--造成[a]到[b]次[c]%的[d]伤害,对[e]造成额外[f]%伤害
|
||
--a[int],b[int],c[float],d[伤害类型],e[职业],f[float]
|
||
[29] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local i2 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
local pt = args[5]
|
||
local f2 = args[6]
|
||
|
||
local count = Random.RangeInt(i1, i2)
|
||
local d = interval / count
|
||
for i=1, count do
|
||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
if target.roleData.professionId == pt then
|
||
f1 = f1*(1+f2)
|
||
end
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end)
|
||
end
|
||
end,
|
||
--造成[a]%的[b]伤害,若为[c],则无视敌人[d]%的防御
|
||
--a[float],b[伤害类型,]c[控制状态],d[float]
|
||
[30] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local ct = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return ct == 0 or buff.ctrlType == ct end) then
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1, f2)
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
end)
|
||
end,
|
||
--[a]%概率[b],持续[c]秒
|
||
--a[float],b[免疫buff],c[int]
|
||
[31] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local ib1 = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
buffRandomAction(f1, target, Buff.Create(caster, BuffName.Immune, f2, ib1))
|
||
end)
|
||
end,
|
||
--[b]%改变[d]重击技能CD[a]秒 ,持续[c]秒 (0代表清除所有)
|
||
--a[float],b[float],c[改变类型]
|
||
[32] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local f2 = args[2]
|
||
local ct = args[3]
|
||
local d = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(f2, function ()
|
||
target:AddSkillCD(f1, ct)
|
||
local trigger = function(skill) --新增监听事件,在印记技能结束回调时移除(印记buff可覆盖旧buff)
|
||
target:AddSkillCD(f1, ct)
|
||
end
|
||
target.Event:AddEvent(BattleEventName.SkillCast, trigger)
|
||
target:AddBuff(Buff.Create(caster, BuffName.Brand, d, "cd", function ()
|
||
target.Event:RemoveEvent(BattleEventName.SkillCast, trigger)
|
||
end))
|
||
end)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,[c]%概率添加[d]的印记,该角色在攻击拥有印记的目标时,额外获得(印记层数*[e])的暴击伤害,印记最多叠加[f]层。(减益印记,不可驱散)
|
||
--a[folat],b[伤害类型],c[float],d[角色id],e[float],f[float]
|
||
[33] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local rid = args[4]
|
||
local f3 = args[5]
|
||
local i1 = args[6]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local layer
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
|
||
local b = buff.flag == rid
|
||
if b then
|
||
layer = buff.layer
|
||
end
|
||
return b
|
||
end) then
|
||
local OnPassiveCriting = function(crit)
|
||
crit(layer * f3)
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.PassiveCriting, OnPassiveCriting)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.Event:RemoveEvent(BattleEventName.PassiveCriting, OnPassiveCriting)
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
local brand = Buff.Create(caster, BuffName.Brand, 0, rid)
|
||
brand.maxLayer = i1
|
||
brand.clear = false
|
||
brand.isDeBuff = true
|
||
buffRandomAction(f2, target, brand)
|
||
end)
|
||
end,
|
||
--对[a]职业,[e]改变目标的[b]属性[c]%,持续[d]秒
|
||
--a[职业],b[属性],c[float],d[int],e[改变类型]
|
||
[34] = function(caster, target, args, interval, skill)
|
||
local pt = args[1]
|
||
local pro1 = args[2]
|
||
local f1 = args[3]
|
||
local f2 = args[4]
|
||
local ct = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if target.roleData.professionId == pt then
|
||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct))
|
||
end
|
||
end)
|
||
end,
|
||
--对[a]的伤害[b]%,持续[c]秒
|
||
--a[控制状态],b[float],c[int]
|
||
[35] = function(caster, target, args, interval, skill)
|
||
local ct = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local trigger = function(defRole, damageFunc, damage)
|
||
if BattleLogic.BuffMgr:HasBuff(defRole, BuffName.Control, function (buff) return ct == 0 or buff.ctrlType == ct end) then
|
||
damage = damage + floor(damage * f1)
|
||
end
|
||
damageFunc(damage)
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleDamageAfter, trigger)
|
||
if f2 > 0 then
|
||
BattleLogic.WaitForTrigger(f2, function ()
|
||
target.Event:RemoveEvent(BattleEventName.RoleDamageAfter, trigger)
|
||
end)
|
||
end
|
||
end)
|
||
end,
|
||
|
||
--[d]改变[a]属性[b]%,最大叠加[c]层
|
||
--a[属性],b[float],c[int],d[改变类型]
|
||
[36] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
local i1 = args[3]
|
||
local ct = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local changeBuff = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[pro1], f1, ct)
|
||
changeBuff.cover = true
|
||
changeBuff.maxLayer = i1
|
||
|
||
target:AddBuff(changeBuff)
|
||
end)
|
||
end,
|
||
--清除[a]状态
|
||
--a[控制状态]
|
||
[37] = function(caster, target, args, interval, skill)
|
||
local ct = args[1]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
|
||
return buff.type == BuffName.Control and (ct == 0 or buff.ctrlType == ct)
|
||
end)
|
||
end)
|
||
end,
|
||
--造成[a]的伤害(真实伤害)
|
||
--a[int]
|
||
[38] = function(caster, target, args, interval, skill)
|
||
local d = args[1]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if not target:IsRealDead() then
|
||
BattleUtil.ApplyDamage(skill, caster, target, d)
|
||
end
|
||
end)
|
||
end,
|
||
--每秒造成[d]的伤害,持续[f]秒(真实伤害)
|
||
--d[float],f[int]
|
||
[39] = function(caster, target, args, interval, skill)
|
||
local d1 = args[1]
|
||
local d2 = args[2]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local dot = Buff.Create(caster, BuffName.DOT, d2, 1, 0, d1, 1)
|
||
dot.skill=skill
|
||
dot.isRealDamage = true
|
||
target:AddBuff(dot)
|
||
end)
|
||
end,
|
||
--添加[a]的伤害吸收护盾,持续[b]秒,盾消失的时候反射吸收伤害的[c]%
|
||
--a[int],b[int],c[float]
|
||
[40] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local f2 = args[2]
|
||
local f3 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
target:AddBuff(Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, f1, f3))
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,同时有[c]%的概率对该敌人造成[d]%的伤害,若该技能造成击杀,则有[e]%的概率清除自身CD
|
||
--a[folat],b[伤害类型],c[float],d[float],e[float]
|
||
[41] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
local f4 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(f2, function ()
|
||
f1 = f1 + f3
|
||
end)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if target:IsDead() then
|
||
BattleUtil.RandomAction(f4, function ()
|
||
caster:AddSkillCD(0)
|
||
end)
|
||
end
|
||
end)
|
||
end,
|
||
--进入虚弱状态,有[a]%的概率受到额外[b]%的伤害,状态持续[c]秒
|
||
--a[folat],b[float],c[int]
|
||
[42] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local f2 = args[2]
|
||
local f3 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local brand = Buff.Create(caster, BuffName.Brand, f3, "weak")
|
||
brand.exDmg = f2
|
||
brand.coverFunc = function (oldBuff)
|
||
brand.exDmg = brand.exDmg + (oldBuff.exDmg or 0)
|
||
end
|
||
local trigger = function(atkRole, damagingFunc, damageType)
|
||
BattleUtil.RandomAction(f1, function()
|
||
damagingFunc(brand.exDmg)
|
||
end)
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||
brand.endFunc = function()
|
||
brand.exDmg = nil
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||
end
|
||
target:AddBuff(brand)
|
||
end)
|
||
end,
|
||
--瞬间恢复[a]的生命
|
||
--a[int]
|
||
[43] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalTreat(caster, target, i1,1,skill)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,计算伤害时额外计算[c]%的[d][e]和[f]%的[g][h]
|
||
--a[float],b[伤害类型],c[float],d[属性],e[改变类型],f[float],g[属性],h[改变类型]
|
||
[44] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local pro1 = args[4]
|
||
local ct1 = args[5]
|
||
local f3 = args[6]
|
||
local pro2 = args[7]
|
||
local ct2 = args[8]
|
||
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local proTran1 = {proName = BattlePropList[pro1], tranProName = BattlePropList[pro1], tranFactor = f2, changeType = ct1}
|
||
local proTran2 = {proName = BattlePropList[pro2], tranProName = BattlePropList[pro2], tranFactor = f3, changeType = ct2}
|
||
caster.proTranList:Add(proTran1)
|
||
caster.proTranList:Add(proTran2)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.proTranList:Remove(caster.proTranList.size)
|
||
caster.proTranList:Remove(caster.proTranList.size)
|
||
end)
|
||
end,
|
||
--[e][a]%概率改变[b]属性[c]%,持续[d]秒
|
||
--a[float],b[属性],c[float],d[int],e[改变类型]
|
||
[45] = function(caster, target, args, interval, skill)
|
||
local f3 = args[1]
|
||
local pro1 = args[2]
|
||
local f1 = args[3]
|
||
local f2 = args[4]
|
||
local ct = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
buffRandomAction(f3, target, Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct))
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,如果击杀,则永久增加[c]%的[d],最大[e]层(0为无限)
|
||
--a[float],b[伤害类型],c[float],d[属性],e[int]
|
||
[46] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local pro1 = args[4]
|
||
local i1 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if target:IsDead() then
|
||
local buff = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[pro1], f2, 2)
|
||
buff.cover = true
|
||
buff.maxLayer = i1
|
||
caster:AddBuff(buff)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,若为[c],则无视[d]%的防御,并造成额外[e]%伤害
|
||
--a[float],b[伤害类型,]c[职业],d[float],e[float]
|
||
[47] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local pt = args[3]
|
||
local f2 = args[4]
|
||
local f3 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if target.roleData.professionId == pt then
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1*(1+f3), f2)
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]*[b]%的伤害(真实伤害)(目标最大生命值伤害总上限为施法者2.5倍攻击)
|
||
--a[属性],b[float]
|
||
[48] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local d = args[2]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local v1 = BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro]), d)
|
||
local v2 = BattleUtil.FP_Mul(caster:GetRoleData(RoleDataName.Attack), 2.5)
|
||
BattleUtil.ApplyDamage(skill, caster, target, floor(min(v1, v2)))
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,提升自身下个技能[c]%的伤害
|
||
--a[float],b[伤害类型],c[float]
|
||
[49] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
local OnPassiveDamaging = function(damagingFunc, defRole, damage)
|
||
damagingFunc(-floor(f2 * damage))
|
||
end
|
||
local OnSkillCast, OnSkillCastEnd
|
||
OnSkillCast = function(skill)
|
||
caster.Event:RemoveEvent(BattleEventName.SkillCast, OnSkillCast)
|
||
caster.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
end
|
||
OnSkillCastEnd = function(skill)
|
||
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,防止触发帧和结束帧为同一帧时,被动未移除
|
||
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
end)
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害【AOE】,如果目标受到此次伤害前,生命低于最大生命[c]%,则直接击杀(击杀值不超过攻击者10倍攻击)。
|
||
--a[float],b[伤害类型],c[float]
|
||
[50] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleUtil.GetHPPencent(target) < f2 then
|
||
BattleUtil.ApplyDamage(skill, caster, target, min(target:GetRoleData(RoleDataName.Hp), caster:GetRoleData(RoleDataName.Attack)*10))
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
end)
|
||
end,
|
||
--增加[c]层缚灵印记,每层使受到的伤害增加[d],减少[e]%的受治疗效果,最大[f]层(0为无限)(减益印记,不可驱散)
|
||
--c[int],d[float],e[float],f[int]
|
||
[51] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local f2 = args[2]
|
||
local f3 = args[3]
|
||
local i2 = args[4]
|
||
local flag = "fuling"..caster.uid
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
for i=1, i1 do
|
||
local brand = Buff.Create(caster, BuffName.Brand, 0, flag)
|
||
brand.exDmg = f2
|
||
brand.exHeal = f3
|
||
brand.maxLayer = i2
|
||
brand.clear = false
|
||
brand.isDeBuff = true
|
||
brand.coverFunc = function (oldBuff)
|
||
if i2 == 0 or oldBuff.layer < i2 then
|
||
brand.exDmg = brand.exDmg + (oldBuff.exDmg or 0)
|
||
brand.exHeal = brand.exHeal + (oldBuff.exHeal or 0)
|
||
else
|
||
brand.exDmg = (oldBuff.exDmg or 0)
|
||
brand.exHeal = (oldBuff.exHeal or 0)
|
||
end
|
||
end
|
||
local trigger = function(atkRole, damagingFunc, damageType)
|
||
damagingFunc(brand.exDmg)
|
||
end
|
||
local OnPassiveBeTreated = function(treatingFunc)
|
||
treatingFunc(-brand.exHeal)
|
||
end
|
||
|
||
target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||
target.Event:AddEvent(BattleEventName.PassiveBeTreated, OnPassiveBeTreated)
|
||
brand.endFunc = function ()
|
||
brand.exDmg = nil
|
||
brand.exHeal = nil
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||
target.Event:RemoveEvent(BattleEventName.PassiveBeTreated, OnPassiveBeTreated)
|
||
end
|
||
target:AddBuff(brand)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,引爆目标身上所有缚灵印记,每层造成攻击*[c]的真实伤害。
|
||
--a[float],b[伤害类型],c[float]
|
||
[52] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
local flag = "fuling"..caster.uid
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
local layer, brandBuff
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
|
||
local b = buff.flag == flag
|
||
if b then
|
||
layer = buff.layer
|
||
brandBuff = buff
|
||
end
|
||
return b
|
||
end) then
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(RoleDataName.Attack), f2, layer))
|
||
BattleUtil.ApplyDamage(skill, caster, target, val)
|
||
brandBuff.disperse = true
|
||
if brandBuff.linkBuff1 then
|
||
brandBuff.linkBuff1.disperse = true
|
||
end
|
||
if brandBuff.linkBuff2 then
|
||
brandBuff.linkBuff2.disperse = true
|
||
end
|
||
end
|
||
end)
|
||
end,
|
||
--若目标生命低于最大生命的[a]%,则有[b]%概率[c],持续[d]秒
|
||
--a[float],b[float],c[控制状态],d[int]
|
||
[53] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local f2 = args[2]
|
||
local ct = args[3]
|
||
local f3 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleUtil.GetHPPencent(target) < f1 then
|
||
BattleUtil.RandomControl(f2, ct, caster, target, f3,skill)
|
||
end
|
||
end)
|
||
end,
|
||
--[e]改变[a]属性*[b]%的[c],持续[d]秒
|
||
--a[属性],b[float],c[属性],d[int],e[改变类型]
|
||
[54] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
local pro2 = args[3]
|
||
local f2 = args[4]
|
||
local ct = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1], f1)))
|
||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro2], val, ct))
|
||
end)
|
||
end,
|
||
--清除[a]状态
|
||
--a[清除状态]
|
||
[55] = function(caster, target, args, interval, skill)
|
||
local ct = args[1]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
|
||
return clearBuffPredicate(buff, ct)
|
||
end)
|
||
end)
|
||
end,
|
||
--造成目标当前生命[a]%的真实伤害,为我方角色回复此技能所有由此效果带来的伤害,平均分配给我方生命最低的[b]个角色。
|
||
--a[float],b[int]
|
||
[56] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local i1 = args[2]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(target:GetRoleData(RoleDataName.Hp), f1))
|
||
local damage = BattleUtil.ApplyDamage(skill, caster, target, val)
|
||
local arr = BattleUtil.ChooseTarget(caster, 10110)
|
||
local count = min(#arr, i1)
|
||
local heal = floor(damage / count)
|
||
for i=1, count do
|
||
BattleUtil.CalTreat(caster, arr[i], heal,1,skill)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,若目标血量低于最大生命值的[c]%,则必定暴击。
|
||
--a[float],b[伤害类型],c[float]
|
||
[57] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleUtil.GetHPPencent(target) < f2 then
|
||
target.isFlagCrit = true
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.isFlagCrit = false
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,计算伤害时无视目标[c]%的[d]。
|
||
--a[float],b[伤害类型],c[float],d[属性]
|
||
[58] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local pro1 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local proTran1 = {proName = BattlePropList[pro1], tranProName = BattlePropList[pro1], tranFactor = f2, changeType = 4}
|
||
target.proTranList:Add(proTran1)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.proTranList:Remove(target.proTranList.size)
|
||
end)
|
||
end,
|
||
--造成[a]次[b]%的[c]伤害,每段攻击随机选择敌方目标。
|
||
--a[int],b[float],c[伤害类型]
|
||
[59] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local f1 = args[2]
|
||
local dt = args[3]
|
||
|
||
local d = interval / i1
|
||
for i=1, i1 do
|
||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||
local arr = BattleUtil.ChooseTarget(caster, 20001)
|
||
if arr[1] then
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, arr[1], d)
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
BattleUtil.CalDamage(skill, caster, arr[1], dt, f1)
|
||
end)
|
||
end
|
||
end)
|
||
end
|
||
end,
|
||
--施加印记,拥有印记的角色受到暴击攻击后会[b]改变[a]秒技能cd,印记持续[c]秒。(专属印记,属于增益)
|
||
--a[int],b[float]c[int]
|
||
[60] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local ct = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local trigger = function(atkRole, damage, bCrit, finalDmg, damageType) --新增监听事件,在印记技能结束回调时移除(印记buff可覆盖旧buff)
|
||
target:AddSkillCD(f1, ct)
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleBeCrit, trigger)
|
||
local buff = Buff.Create(caster, BuffName.Brand, f2, "crit", function ()
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeCrit, trigger)
|
||
end)
|
||
buff.isBuff = true
|
||
target:AddBuff(buff)
|
||
end)
|
||
end,
|
||
--消耗自身[a]%的当前生命值,为我方生命百分比最低的角色造成[b]%最大生命值的治疗。若目标为施法者,则不消耗生命。
|
||
--a[float],b[float]
|
||
[61] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local f2 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local arr = BattleUtil.ChooseTarget(caster, 10210)
|
||
if arr[1] then
|
||
if arr[1] ~= caster then
|
||
caster.data:SubValue(RoleDataName.Hp, floor(caster:GetRoleData(RoleDataName.Hp) * f1))
|
||
end
|
||
BattleUtil.CalTreat(caster, arr[1], floor(caster:GetRoleData(RoleDataName.MaxHp) * f2),1,skill)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]到[b]段[c]%的[d]伤害,若任意一段攻击前目标已死亡,则目标变为敌方生命最低的角色,继续造成后续伤害。
|
||
--a[int],b[int],c[float],d[伤害类型]
|
||
[62] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local i2 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
|
||
local count = Random.RangeInt(i1, i2)
|
||
local d = interval / count
|
||
local delayDmgTrigger
|
||
delayDmgTrigger = function(less, d)
|
||
if less > 0 then
|
||
local role = target:IsRealDead() and BattleUtil.ChooseTarget(caster, 20110)[1] or target
|
||
if role then
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, role, d)
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
BattleUtil.CalDamage(skill, caster, role, dt, f1)
|
||
delayDmgTrigger(less-1, d)
|
||
end)
|
||
end
|
||
end
|
||
end
|
||
delayDmgTrigger(count, d)
|
||
end,
|
||
--造成[a]%的[b]伤害,若造成击杀,[c]的概率立即发动一次上滑技。
|
||
--a[float],b[伤害类型],c[float]
|
||
[63] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if target:IsDead() then
|
||
-- BattleUtil.RandomAction(f2, function ()
|
||
-- if caster.superSkill then
|
||
-- caster.superSkill:Cast()
|
||
-- end
|
||
-- end)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,自身每种/每层增益状态会提高此技能[c]%的伤害。【aoe】
|
||
--a[float],b[伤害类型],c[float]
|
||
[64] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local factor = 0
|
||
BattleLogic.BuffMgr:QueryBuff(caster, function (buff)
|
||
if buff.isBuff then
|
||
if buff.layer then
|
||
factor = factor + buff.layer
|
||
else
|
||
factor = factor + 1
|
||
end
|
||
end
|
||
end)
|
||
|
||
local OnPassiveDamaging = function(damagingFunc, defRole, damage)
|
||
damagingFunc(-floor(BattleUtil.FP_Mul(f2, factor, damage)))
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,[c]的概率造成眩晕,持续[d]秒。若未造成眩晕,则为目标施加增伤印记。最大[e]层(减益印记,不可驱散)
|
||
--a[float],b[伤害类型],c[float],d[int],e[int]
|
||
[65] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
local i1 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
-- 伤害
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
-- 控制未命中则施加增伤印记
|
||
if not BattleUtil.RandomControl(f2, 1, caster, target, f3,skill) then
|
||
local brand = Buff.Create(caster, BuffName.Brand, 0, "zengshang")
|
||
brand.maxLayer = i1
|
||
brand.clear = false
|
||
brand.isDeBuff = true
|
||
target:AddBuff(brand)
|
||
end
|
||
|
||
-- if Random.Range01() <= f2 then
|
||
-- target:AddBuff(Buff.Create(caster, BuffName.Control, f3, 1))
|
||
-- else
|
||
-- local brand = Buff.Create(caster, BuffName.Brand, 0, "zengshang")
|
||
-- brand.maxLayer = i1
|
||
-- brand.clear = false
|
||
-- brand.isDeBuff = true
|
||
-- target:AddBuff(brand)
|
||
-- end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,[c]的概率附加一层增伤印记,最大[d]层。目标身上每层印记增加此技能[e]%的伤害。(减益印记,不可驱散)
|
||
--a[float],b[伤害类型],c[float],d[int],e[float]
|
||
[66] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local i1 = args[4]
|
||
local f3 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local brand = Buff.Create(caster, BuffName.Brand, 0, "zengshang")
|
||
brand.maxLayer = i1
|
||
brand.clear = false
|
||
brand.isDeBuff = true
|
||
buffRandomAction(f2, target, brand)
|
||
local layer = 0
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
|
||
local b = buff.flag == "zengshang"
|
||
if b then
|
||
layer = buff.layer
|
||
end
|
||
return b
|
||
end) then
|
||
local OnPassiveDamaging = function(damagingFunc, defRole, damage)
|
||
damagingFunc(-floor(BattleUtil.FP_Mul(f3, layer, damage)))
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]到[b]段[c]%的[d]伤害,每段伤害有[e]的概率改变[g]目标[f]秒技能cd。
|
||
--a[int],b[int],c[float],d[伤害类型],e[float],f[float],g[改变类型]
|
||
[67] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local i2 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
local f2 = args[5]
|
||
local f3 = args[6]
|
||
local ct = args[7]
|
||
|
||
local count = Random.RangeInt(i1, i2)
|
||
local d = interval / count
|
||
for i=1, count do
|
||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
BattleUtil.RandomAction(f2, function ()
|
||
target:AddSkillCD(f3, ct)
|
||
end)
|
||
end)
|
||
end)
|
||
end
|
||
end,
|
||
--造成[a]%的[b]伤害,附带持续伤害,每秒造成自身最大生命值[c]%的真实伤害,持续[d]秒。【aoe】
|
||
--a[float],b[伤害类型],c[float],d[int]
|
||
[68] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(RoleDataName.MaxHp), f2))
|
||
local dot = Buff.Create(caster, BuffName.DOT, f3, 1, 0, val, 1)
|
||
dot.skill=skill
|
||
dot.isRealDamage = true
|
||
target:AddBuff(dot)
|
||
end)
|
||
end,
|
||
--损失自身[c]%的[d]的生命。
|
||
--c[float],d[属性]
|
||
[69] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local pro1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local hp = min(floor(BattleUtil.FP_Mul(target:GetRoleData(BattlePropList[pro1]), f1)), target:GetRoleData(RoleDataName.Hp)-1)
|
||
target.data:SubValue(RoleDataName.Hp, hp)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,每损失[c]%的生命,增加本技能[d]%的伤害。【aoe】
|
||
--a[float],b[伤害类型],c[float],d[float]
|
||
[70] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local factor = 1 - BattleUtil.GetHPPencent(caster)
|
||
local OnPassiveDamaging = function(damagingFunc, defRole, damage)
|
||
damagingFunc(-floor(BattleUtil.FP_Mul(f2, factor, damage)))
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
end)
|
||
end,
|
||
--造成[a]到[b]段[c]%的[d]伤害,每段伤害有[e]的概率造成[f],持续[g]秒。若目标处于[h]状态,则必定暴击。
|
||
--a[int],b[int],c[float],d[伤害类型],e[float],f[控制状态],g[int],h[控制状态]
|
||
[71] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local i2 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
local f2 = args[5]
|
||
local c1 = args[6]
|
||
local f4 = args[7]
|
||
local c2 = args[8]
|
||
|
||
local count = Random.RangeInt(i1, i2)
|
||
local d = interval / count
|
||
for i=1, count do
|
||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return c2 == 0 or buff.ctrlType == c2 end) then
|
||
target.isFlagCrit = true
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.isFlagCrit = false
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
BattleUtil.RandomControl(f2, c1, caster, target, f4,skill)
|
||
end)
|
||
end)
|
||
end
|
||
end,
|
||
--[b]概率造成[c],每秒造成[d]的[e]的伤害,持续[f]秒(属于减益)
|
||
--b[float],c[持续伤害状态].d[float],e[伤害类型],f[int]
|
||
[72] = function(caster, target, args, interval, skill)
|
||
local f3 = args[1]
|
||
local d1 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
local f2 = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local buff=Buff.Create(caster, BuffName.DOT, f2, 1, d1, dt, f1)
|
||
buff.skill=skill
|
||
buffRandomAction(f3, target,buff)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,立即结算目标身上所有dot的剩余伤害。【aoe】
|
||
--a[float],b[伤害类型]
|
||
[73] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff)
|
||
if buff.duration > 0 and buff.roundInterval > 0 then
|
||
local remainFrame = buff.roundDuration - buff.roundPass
|
||
local remainCount = floor(remainFrame / buff.roundInterval)+1
|
||
buff.disperse = true
|
||
if buff.caster and not buff.caster.isTeam then
|
||
local trigger = function(defRole, damageFunc, damage) damageFunc(damage * remainCount) end
|
||
buff.caster.Event:AddEvent(BattleEventName.RoleDamageAfter, trigger)
|
||
BattleUtil.CalDamage(skill, buff.caster, buff.target, buff.damagePro, buff.damageFactor,0, buff.damageType)
|
||
buff.caster.Event:RemoveEvent(BattleEventName.RoleDamageAfter, trigger)
|
||
end
|
||
end
|
||
return true
|
||
end)
|
||
end)
|
||
end,
|
||
--[a]概率瞬间恢复[b]*[c]%生命
|
||
--a[float],b[属性],c[float]
|
||
[74] = function(caster, target, args, interval, skill)
|
||
local f2 = args[1]
|
||
local pro1 = args[2]
|
||
local f1 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(f2, function ()
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
|
||
BattleUtil.CalTreat(caster, target, val,1,skill)
|
||
end)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,计算伤害时额外计算[c]%的[d][e],若该技能造成击杀,则有[f]%的概率清除自身CD
|
||
--a[float],b[伤害类型],c[float],d[属性],e[改变类型],f[float]
|
||
[75] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local pro1 = args[4]
|
||
local ct = args[5]
|
||
local f3 = args[6]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local proTran = {proName = BattlePropList[pro1], tranProName = BattlePropList[pro1], tranFactor = f2, changeType = ct}
|
||
caster.proTranList:Add(proTran)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.proTranList:Remove(caster.proTranList.size)
|
||
if target:IsDead() then
|
||
BattleUtil.RandomAction(f3, function ()
|
||
caster:AddSkillCD(0)
|
||
end)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,对拥有护盾的敌人额外造成[c]%伤害。
|
||
--a[float],b[伤害类型],c[float]
|
||
[76] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Shield, function (buff) return true end) then
|
||
f1 = f1*(1+f2)
|
||
end
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
end,
|
||
--[a]%概率对敌方全体造成[b],持续[c]秒,对技能目标概率上升[d]。
|
||
--a[float],b[控制状态],c[int],d[float]
|
||
[77] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local cb1 = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local arr = BattleUtil.ChooseTarget(caster, 20000)
|
||
for i=1, #arr do
|
||
if arr[i] == target then
|
||
BattleUtil.RandomControl(f1+f3, cb1, caster, arr[i], f2,skill)
|
||
else
|
||
BattleUtil.RandomControl(f1, cb1, caster, arr[i], f2,skill)
|
||
end
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,挂控制印记,最大[c]层。若暴击,[d]概率为敌方随机其他1人挂控制印记。(减益印记,可以驱散)
|
||
--a[float],b[伤害类型],c[int],d[float]
|
||
[78] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local i1 = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
local brand = Buff.Create(caster, BuffName.Brand, 0, "kongzhi")
|
||
brand.maxLayer = i1
|
||
brand.isDeBuff = true
|
||
target:AddBuff(brand)
|
||
if crit then
|
||
local arr = BattleUtil.ChooseTarget(caster, 20001)
|
||
local other
|
||
if arr[1] then
|
||
if arr[1] == target and arr[2] then
|
||
other = arr[2]
|
||
else
|
||
other = arr[1]
|
||
end
|
||
end
|
||
if other then
|
||
local brand2 = Buff.Create(caster, BuffName.Brand, 0, "kongzhi")
|
||
brand2.maxLayer = i1
|
||
brand2.isDeBuff = true
|
||
buffRandomAction(f2, other, brand2)
|
||
end
|
||
end
|
||
end)
|
||
end,
|
||
--[a]%概率[b],持续[c]秒,每层控制印记提高[d]%概率。
|
||
--a[float],b[控制状态],c[int],d[float]
|
||
[79] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local ct = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local layer = 0
|
||
BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
|
||
local b = buff.flag == "kongzhi"
|
||
if b then
|
||
layer = buff.layer
|
||
end
|
||
return b
|
||
end)
|
||
BattleUtil.RandomControl(f1+f3*layer, ct, caster, target, f2,skill)
|
||
end)
|
||
end,
|
||
--添加[a]的[b]%护盾,持续[c]秒。为自身挂护盾印记,每层额外增加护盾值[d]%,印记最多[e]层。印记不显示。(增益印记,不可驱散)
|
||
--a[属性],b[float],c[int],d[float],e[int]
|
||
[80] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
local i1 = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local layer = 0
|
||
BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
|
||
local b = buff.flag == "shieldLayerFlag"
|
||
if b then
|
||
layer = buff.layer
|
||
end
|
||
return b
|
||
end)
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1, 1+layer*f3))
|
||
local shield = Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, val, 0)
|
||
target:AddBuff(shield)
|
||
|
||
local brand = Buff.Create(caster, BuffName.Brand, 0, "shieldLayerFlag")
|
||
brand.maxLayer = i1
|
||
brand.isBuff = true
|
||
brand.clear = false
|
||
target:AddBuff(brand)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,附加受控印记,受到控制时回复[c]*[d]%生命,印记持续[e]秒。(增益印记,不可驱散)
|
||
--a[float],b[伤害类型],c[属性],d[float],e[int]
|
||
[81] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local pro1 = args[3]
|
||
local f2 = args[4]
|
||
local f3 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
local OnBuffStart = function(buff)
|
||
if buff.type == BuffName.Control then
|
||
local val = floor(BattleUtil.FP_Mul(buff.target:GetRoleData(BattlePropList[pro1]), f2))
|
||
BattleUtil.CalTreat(buff.caster, buff.target, val,1,skill)
|
||
end
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.BuffStart, OnBuffStart)
|
||
local buff = Buff.Create(caster, BuffName.Brand, f3, "shoukong", function ()
|
||
caster.Event:RemoveEvent(BattleEventName.BuffStart, OnBuffStart)
|
||
end)
|
||
buff.isBuff = true
|
||
buff.clear = false
|
||
caster:AddBuff(buff)
|
||
end)
|
||
end,
|
||
--代替相邻友军承受[a]%受到的伤害,持续[b]秒。自身死亡时该效果消失。
|
||
--a[float],b[int]
|
||
[82] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local f2 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local lastTrigger = 0
|
||
local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
|
||
lastTrigger = lastTrigger + 1
|
||
if lastTrigger > 1 then --加入限定避免循环触发
|
||
return
|
||
end
|
||
if not target:IsDead() then
|
||
damagingFunc(floor(damage * f1))
|
||
BattleUtil.ApplyDamage(skill, atkRole, target, BattleUtil.CalShield(atkRole, target, floor(damage * f1)))
|
||
end
|
||
lastTrigger = 0
|
||
end
|
||
local list = RoleManager.GetNeighbor(target, 1)
|
||
for i=1, #list do
|
||
if list[i] ~= target then
|
||
list[i].Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
|
||
end
|
||
end
|
||
local brand = Buff.Create(caster, BuffName.Brand, f2, "chengshou", function ()
|
||
for i=1, #list do
|
||
if list[i] ~= target then
|
||
list[i].Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
|
||
end
|
||
end
|
||
end)
|
||
target:AddBuff(brand)
|
||
end)
|
||
end,
|
||
--[a]概率驱散[b]个[c]状态。[b]为0时驱散所有
|
||
--a[float],b[int],c[状态类型]
|
||
[83] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local i1 = args[2]
|
||
local ct = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(f1, function ()
|
||
local count = 0
|
||
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
|
||
local flag = clearBuffPredicate(buff, ct)
|
||
if flag then
|
||
count = count + 1
|
||
end
|
||
return (i1 == 0 or count <= i1) and flag
|
||
end)
|
||
end)
|
||
end)
|
||
end,
|
||
--施加[a]的[b]%护盾,持续[c]秒。护盾被击破时,对击破者造成施法者最大生命值[d]%的伤害。
|
||
--a[属性],b[float],c[int],d[float]
|
||
[84] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
|
||
local shield = Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, val, 0)
|
||
local OnBuffEnd = function(buff)
|
||
if buff == shield and buff.roundPass < buff.roundDuration then --护盾被击破
|
||
if buff.atk and not buff.atk.isTeam then
|
||
BattleUtil.ApplyDamage(skill, target, buff.atk, floor(BattleUtil.FP_Mul(caster:GetRoleData(RoleDataName.MaxHp), f3)))
|
||
end
|
||
end
|
||
end
|
||
target:AddBuff(shield)
|
||
target.Event:AddEvent(BattleEventName.BuffEnd, OnBuffEnd)
|
||
local brand = Buff.Create(caster, BuffName.Brand, f2, "shieldBreakFlag", function ()
|
||
target.Event:RemoveEvent(BattleEventName.BuffEnd, OnBuffEnd)
|
||
end)
|
||
target:AddBuff(brand)
|
||
end)
|
||
end,
|
||
--施加[a]的[b]%护盾,持续[c]秒。拥有该护盾的角色,[f]改变[d]属性[e]%,[i]改变[g]属性[h]%。护盾消失时增益消失。
|
||
--a[属性],b[float],c[int],d[属性],e[float],f[改变类型],g[属性],h[float],i[改变类型]
|
||
[85] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
local pro2 = args[4]
|
||
local f3 = args[5]
|
||
local ct1 = args[6]
|
||
local pro3 = args[7]
|
||
local f4 = args[8]
|
||
local ct2 = args[9]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
|
||
local shield = Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, val, 0)
|
||
local buff1 = Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro2], f3, ct1)
|
||
local buff2 = Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro3], f4, ct2)
|
||
|
||
local OnBuffEnd = function(buff)
|
||
if buff == shield and buff.roundPass < buff.roundDuration then --护盾被击破
|
||
buff1.disperse = true
|
||
buff2.disperse = true
|
||
end
|
||
end
|
||
target.Event:AddEvent(BattleEventName.BuffEnd, OnBuffEnd)
|
||
local brand = Buff.Create(caster, BuffName.Brand, f2, "shieldBuffFlag", function ()
|
||
target.Event:RemoveEvent(BattleEventName.BuffEnd, OnBuffEnd)
|
||
end)
|
||
target:AddBuff(shield)
|
||
target:AddBuff(brand)
|
||
target:AddBuff(buff1)
|
||
target:AddBuff(buff2)
|
||
end)
|
||
end,
|
||
--[a]概率吸取[b]%的[c],持续[d]秒(属于增益),累积不高于自身该属性的[e]%
|
||
--a[float],b[float],c[属性],d[float],e[float]
|
||
[86] = function(caster, target, args, interval, skill)
|
||
local f4 = args[1]
|
||
local f1 = args[2]
|
||
local pro = args[3]
|
||
local f2 = args[4]
|
||
local f3 = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(f4, function ()
|
||
--计算上限值
|
||
local total = caster.data:GetOrginData(BattlePropList[pro]) * (1 + f3)
|
||
--计算预期吸取后的值
|
||
local targetValue = caster:GetRoleData(BattlePropList[pro]) + target:GetRoleData(BattlePropList[pro]) * f1
|
||
--计算有效吸收值
|
||
local delta = min(targetValue, total) - caster:GetRoleData(BattlePropList[pro])
|
||
|
||
if delta > 0 then
|
||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro], delta, 3))
|
||
caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro], delta, 1))
|
||
end
|
||
end)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,对没有增益的敌人[c]概率造成[d],持续[e]秒。
|
||
--a[float],b[伤害类型],c[float],d[控制状态],e[int]
|
||
[87] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local ct = args[4]
|
||
local f3 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
local hasBuff = true
|
||
BattleLogic.BuffMgr:QueryBuff(target, function (buff)
|
||
if buff.isBuff then
|
||
hasBuff = false
|
||
end
|
||
end)
|
||
if hasBuff then
|
||
BattleUtil.RandomControl(f2, ct, caster, target, f3,skill)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,对拥有减益的敌人[c]概率造成[d],持续[e]秒。
|
||
--a[float],b[伤害类型],c[float],d[控制状态],e[int]
|
||
[88] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local ct = args[4]
|
||
local f3 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
local hasBuff = false
|
||
BattleLogic.BuffMgr:QueryBuff(target, function (buff)
|
||
if buff.isDeBuff then
|
||
hasBuff = true
|
||
end
|
||
end)
|
||
if hasBuff then
|
||
BattleUtil.RandomControl(f2, ct, caster, target, f3,skill)
|
||
end
|
||
end)
|
||
end,
|
||
--[a]概率在[d]秒里总共回复[e]次生命,每次恢复[b]*[c]%生命,。
|
||
--a[float],b[属性],c[float],d[int],e[int]
|
||
[89] = function(caster, target, args, interval, skill)
|
||
local f4 = args[1]
|
||
local pro1 = args[2]
|
||
local f1 = args[3]
|
||
local f2 = args[4]
|
||
local f3 = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
|
||
buffRandomAction(f4, target, Buff.Create(caster, BuffName.HOT, f2, f2/f3, val))
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,如果击杀,则其他人受到[c]%的溢出伤害
|
||
--a[float],b[伤害类型],c[float]
|
||
[90] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
|
||
if target:IsDead() then
|
||
local arr = RoleManager.Query(function (r) return r.camp == target.camp and r.uid ~= target.uid end)
|
||
for i=1, #arr do
|
||
BattleUtil.ApplyDamage(skill, caster, arr[i], floor((damage-finalDmg)*f2))
|
||
end
|
||
end
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
end)
|
||
end,
|
||
--[b]概率造成[c],每次造成[d]的[e]的伤害,在[f]秒内造成[g]次伤害。
|
||
--b[float],c[持续伤害状态].d[float],e[伤害类型],f[int],g[int]
|
||
[91] = function(caster, target, args, interval, skill)
|
||
local f4 = args[1]
|
||
local d1 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
local f2 = args[5]
|
||
local f3 = args[6]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local buff=Buff.Create(caster, BuffName.DOT, f2, f2/f3, d1, dt, f1)
|
||
buff.skill=skill
|
||
buffRandomAction(f4, target,buff)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,若暴击,[g][c]%概率改变我方随机1人[d]属性[e]%,持续[f]秒。
|
||
--a[float],b[伤害类型],c[float],d[属性],e[float],f[int],g[改变类型]
|
||
[92] = function(caster, target, args, interval, skill)
|
||
local f4 = args[1]
|
||
local dt = args[2]
|
||
local f3 = args[3]
|
||
local pro1 = args[4]
|
||
local f1 = args[5]
|
||
local f2 = args[6]
|
||
local ct = args[7]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f4)
|
||
if crit then
|
||
BattleUtil.RandomAction(f3, function ()
|
||
local arr = BattleUtil.ChooseTarget(caster, 10001)
|
||
if arr[1] then
|
||
arr[1]:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct))
|
||
end
|
||
end)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,若暴击,[c]概率驱散[d]个(0表示所有)[e]状态。【aoe】
|
||
--a[float],b[伤害类型],c[float],d[int],e[状态类型]
|
||
[93] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local i1 = args[4]
|
||
local ct = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if crit then
|
||
BattleUtil.RandomAction(f2, function ()
|
||
local count = 0
|
||
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
|
||
local flag = clearBuffPredicate(buff, ct)
|
||
if flag then
|
||
count = count + 1
|
||
end
|
||
return (i1 == 0 or count <= i1) and flag
|
||
end)
|
||
end)
|
||
end
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,为自己施加一层印记,最大[c]层。(增益印记,不可驱散)(与95使用同一个印记)
|
||
--a[float],b[伤害类型],c[int]
|
||
[94] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local i1 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
local brand = Buff.Create(caster, BuffName.Brand, 0, "zengyi")
|
||
brand.maxLayer = i1
|
||
brand.clear = false
|
||
brand.isBuff = true
|
||
caster:AddBuff(brand)
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,自身每层印记增加此技能[c]%的伤害。(增益印记,不可驱散)(与94使用同一个印记)
|
||
--a[float],b[伤害类型],c[float]
|
||
[95] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local layer = 0
|
||
if BattleLogic.BuffMgr:HasBuff(caster, BuffName.Brand, function (buff)
|
||
local b = buff.flag == "zengyi"
|
||
if b then
|
||
layer = buff.layer
|
||
end
|
||
return b
|
||
end) then
|
||
local OnPassiveDamaging = function(damagingFunc, defRole, damage)
|
||
damagingFunc(-floor(BattleUtil.FP_Mul(f2, layer, damage)))
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
end)
|
||
end,
|
||
--[b]概率造成[c],每次造成[d]的真实伤害,在[e]秒内造成[f]次伤害。(91,异妖用)(减益,不可驱散)
|
||
--b[float],c[持续伤害状态].d[float],e[int],f[int]
|
||
[96] = function(caster, target, args, interval, skill)
|
||
local f4 = args[1]
|
||
local d1 = args[2]
|
||
local f1 = args[3]
|
||
local f2 = args[4]
|
||
local f3 = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local DOT = Buff.Create(caster, BuffName.DOT, f2, f2/f3, d1, f1, 1)
|
||
DOT.clear = false
|
||
DOT.isDeBuff = true
|
||
DOT.skill=skill
|
||
buffRandomAction(f4, target, DOT)
|
||
end)
|
||
end,
|
||
--[a]概率在[c]秒里总共回复[d]次生命,每次恢复[b]生命。(89,异妖用)(增益,不可驱散)
|
||
--a[float],b[float],c[int],d[int]
|
||
[97] = function(caster, target, args, interval, skill)
|
||
local f4 = args[1]
|
||
local i1 = args[2]
|
||
local f2 = args[3]
|
||
local f3 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local HOT = Buff.Create(caster, BuffName.HOT, f2, f2/f3, i1)
|
||
HOT.clear = false
|
||
HOT.isBuff = true
|
||
buffRandomAction(f4, target, HOT)
|
||
end)
|
||
end,
|
||
--造成[a]到[b]段[c]%的[d]伤害【AOE】,每段伤害有[e]的概率造成[f],持续[g]秒。若目标处于[h]状态,则必定暴击。
|
||
--a[int],b[int],c[float],d[伤害类型],e[float],f[控制状态],g[int],h[控制状态]
|
||
[98] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
local i2 = args[2]
|
||
local f1 = args[3]
|
||
local dt = args[4]
|
||
local f2 = args[5]
|
||
local c1 = args[6]
|
||
local f4 = args[7]
|
||
local c2 = args[8]
|
||
|
||
local count = Random.RangeInt(i1, i2)
|
||
local d = interval / count
|
||
for i=1, count do
|
||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||
BattleLogic.WaitForTrigger(d, function ()
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return c2 == 0 or buff.ctrlType == c2 end) then
|
||
target.isFlagCrit = true
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.isFlagCrit = false
|
||
else
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
BattleUtil.RandomControl(f2, c1, caster, target, f4,skill)
|
||
end)
|
||
end)
|
||
end
|
||
end,
|
||
--造成[a]%的[b]伤害,目标每减少[c]个伤害提升[d]%
|
||
--a[float],b[伤害类型],c[int],d[float]
|
||
[99] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local i1 = args[3]
|
||
local f2 = args[4]
|
||
|
||
-- 改变值 = 技能最大目标数 - 当前目标数
|
||
local maxNum = skill:GetMaxTargetNum()
|
||
local curNum = #skill:GetDirectTargets()
|
||
local lessNum = max(maxNum - curNum, 0)
|
||
local level = math.floor(lessNum/i1)
|
||
local extra = BattleUtil.ErrorCorrection(level * f2)
|
||
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local OnPassiveDamaging = function(damagingFunc, defRole, damage)
|
||
if damagingFunc then
|
||
damagingFunc(-floor(damage * extra))
|
||
end
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
end)
|
||
end,
|
||
|
||
|
||
--[a]改变[b]点怒气
|
||
--a[改变类型],b[int]
|
||
[100] = function(caster, target, args, interval, skill)
|
||
local ct = args[1]
|
||
local i1 = args[2]
|
||
-- caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalRage(caster, target, i1, ct)
|
||
end)
|
||
end,
|
||
|
||
-- 组合技能
|
||
-- 对仇恨目标追加一次1技能(追加的1技能不回怒气)
|
||
-- a[float],b[伤害类型]
|
||
[101] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
-- 对仇恨目标追加一次技能
|
||
for i = 1, i1 do
|
||
caster:AddSkill(BattleSkillType.Normal, false, true, {{target}})
|
||
end
|
||
end)
|
||
end,
|
||
|
||
-- 造成[a]%的[b]伤害,如果目标数量大于[c]个,增加自身[d]点怒气(主动 + 被动167联合实现)
|
||
-- a[float]b[伤害类型]c[int]d[int]
|
||
[102] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local i1 = args[3]
|
||
local i2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end)
|
||
|
||
-- 主动技能效果添加被动技能
|
||
-- 167 释放技能后如果目标数量大于[c]个,增加自身[d]点怒气
|
||
caster:AddPassive(167, {i1, i2}, false) -- 不可叠加
|
||
end,
|
||
|
||
--造成[a]%的[b]伤害,造成伤害的[c]%用于医疗生命值最低[d]名队友。
|
||
--a[float],b[伤害类型],c[float] ,d[int]
|
||
[103] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
local num = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
|
||
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
|
||
BattleUtil.SortByHpFactor(arr, 1)
|
||
-- 检测技能伤害治疗加成
|
||
-- 治疗血量最低队友实际伤害的f2%
|
||
--之前是finaldag 改成 damage
|
||
for i = 1, #arr do
|
||
if i<=num then
|
||
f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[i])
|
||
BattleUtil.ApplyTreat(caster, arr[i], floor(damage*f2))
|
||
end
|
||
end
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
end)
|
||
end,
|
||
|
||
-- 添加[a]%抵抗效果的减伤盾的持续[c]回合
|
||
-- a[float]c[int]
|
||
[104] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local i1 = args[2]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
|
||
|
||
local cl = {}
|
||
local function _CallBack(v, ct)
|
||
if v then
|
||
table.insert(cl, {v, ct})
|
||
end
|
||
end
|
||
caster.Event:DispatchEvent(BattleEventName.PassiveShield, _CallBack, ShieldTypeName.RateReduce)
|
||
target.Event:DispatchEvent(BattleEventName.PassiveBeShield, _CallBack, ShieldTypeName.RateReduce)
|
||
f1 = BattleUtil.CountChangeList(f1, cl)
|
||
|
||
target:AddBuff(Buff.Create(caster, BuffName.Shield, i1, ShieldTypeName.RateReduce, f1, 0))
|
||
end)
|
||
end,
|
||
|
||
-- 造成[a]%的[b]伤害如目标[c]则本次技能造成伤害增加[d]%
|
||
-- a[float]b[伤害类型]c[持续伤害状态]d[float]
|
||
[105] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local dot = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local OnPassiveDamaging = function(damagingFunc, defRole, damage)
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end,caster,dot) then
|
||
if damagingFunc then
|
||
damagingFunc(-floor(damage * f2))
|
||
end
|
||
end
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||
end)
|
||
|
||
end,
|
||
|
||
-- [a]%概率[b],持续[c]回合
|
||
-- a[float]b[持续伤害状态]c[int]
|
||
-- [106] = function(caster, target, args, interval, skill)
|
||
-- local f1 = args[1]
|
||
-- local dot = args[2]
|
||
-- local i1 = args[3]
|
||
|
||
-- BattleUtil.RandomAction(f1, function()
|
||
-- -- 秒杀
|
||
-- target:AddBuff(Buff.Create(caster, BuffName.DOT, i1, 1, dot, dt, f1))
|
||
-- end)
|
||
|
||
|
||
-- end,
|
||
|
||
|
||
-- [107] = {},
|
||
|
||
|
||
|
||
-- 造成[a]%的[b]伤害如果目标[c]且[d]低于[e]则有[F]%概率将其秒杀,灭有一层c状态,增加[g]%暴毙率,暴毙伤害提升[h]%,最多提高[i]层
|
||
-- a[float],b[伤害类型],c[持续伤害类型],d[属性],e[float],f[float],g[float],h[float],i[int]
|
||
[108] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local dot = args[3]
|
||
local pro1 = args[4]
|
||
local f2 = args[5]
|
||
local f3 = args[6]
|
||
local v1 = args[7]
|
||
local v2 = args[8]
|
||
local v3 = args[9]
|
||
if v1==nil then
|
||
v1=0
|
||
end
|
||
if v2==nil then
|
||
v2=0
|
||
end
|
||
if v3==nil then
|
||
v3=0
|
||
end
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local isSecKill = false
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end,caster,dot) then
|
||
-- 检测被动技能对秒杀参数得影响
|
||
f2, f3 = BattleUtil.CheckSeckill(f2, f3, caster, target)
|
||
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==target and dot == 0 or buff.damageType == dot end)
|
||
local len=BattleUtil.LengthOfTable(list)
|
||
if len>v3 then
|
||
len=v3
|
||
end
|
||
local ft = target:GetRoleData(RoleDataName.Hp)/target:GetRoleData(RoleDataName.MaxHp)
|
||
if ft < f2+v2*len then
|
||
isSecKill = BattleUtil.RandomAction(f3+len*v1, function()
|
||
-- 秒杀
|
||
local isBoss=BattleUtil.CheckIsBoss(target)
|
||
if isBoss then
|
||
return
|
||
end
|
||
BattleUtil.Seckill(skill, caster, target)
|
||
end)
|
||
end
|
||
end
|
||
-- 不秒杀造成伤害
|
||
if not isSecKill then
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
end
|
||
--
|
||
-- local OnBeHit = function()
|
||
-- if not target:IsDead() and BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
|
||
-- -- 检测被动技能对秒杀参数得影响
|
||
-- f2, f3 = BattleUtil.CheckSeckill(f2, f3, caster, target)
|
||
-- --
|
||
-- local ft = target:GetRoleData(RoleDataName.Hp)/target:GetRoleData(RoleDataName.MaxHp)
|
||
-- if ft < f2 then
|
||
-- BattleUtil.RandomAction(f3, function()
|
||
-- -- 秒杀
|
||
-- BattleUtil.Seckill(skill, caster, target)
|
||
-- end)
|
||
-- end
|
||
-- end
|
||
-- end
|
||
|
||
-- target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
-- BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
-- target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
end)
|
||
|
||
end,
|
||
|
||
|
||
-- 造成[a]%的[b]伤害每次击杀目标[c]改变[d]%的[e]
|
||
-- a[float]b[伤害类型]c[改变类型]d[float]e[属性]
|
||
[109] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local ct = args[3]
|
||
local f2 = args[4]
|
||
local pro1 = args[5]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
|
||
if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||
caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[pro1], f2, ct))
|
||
end
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
end)
|
||
end,
|
||
|
||
|
||
-- 给目标附加一个印记,印记效果是己方武将直接攻击敌方非该印记状态的目标时所造成的伤害的[a]会额外再平分给敌方所有处于该印记状态的目标,持续[b]回合
|
||
-- a[float]b[int]
|
||
[110] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local i1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
|
||
local cl = {}
|
||
local function _CallBack(v, ct)
|
||
if v then
|
||
table.insert(cl, {v, ct})
|
||
end
|
||
end
|
||
caster.Event:DispatchEvent(BattleEventName.Curse_ShareDamage, _CallBack)
|
||
target.Event:DispatchEvent(BattleEventName.Be_Curse_ShareDamage, _CallBack)
|
||
local f = BattleUtil.CountChangeList(f1, cl)
|
||
|
||
local buff = Buff.Create(caster, BuffName.Curse, i1, CurseTypeName.ShareDamage, f)
|
||
target:AddBuff(buff)
|
||
end)
|
||
end,
|
||
|
||
|
||
|
||
-- [a]%概率造成[b],每回合造成[c]%自身[d]的伤害,持续[e]回合
|
||
-- a[float]b[持续伤害状态].c[float],d[属性]e[int]
|
||
[111] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dot = args[2]
|
||
local f2 = args[3]
|
||
local pro = args[4]
|
||
local i1 = args[5]
|
||
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local damage = BattleUtil.ErrorCorrection(f2 * caster:GetRoleData(BattlePropList[pro]))
|
||
BattleUtil.RandomDot(f1, dot, caster, target, i1, 1, floor(damage),skill)
|
||
end)
|
||
end,
|
||
|
||
|
||
|
||
-- 自身[a]增加[b]%持续[c]回合,效果可叠加,[d]改变
|
||
-- a[属性]b[float]c[int]d[改变类型]
|
||
[112] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local f1 = args[2]
|
||
local i1 = args[3]
|
||
local ct = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, i1, BattlePropList[pro], f1, ct))
|
||
end)
|
||
end,
|
||
|
||
--造成[a]%的[b]伤害,对[c]有[d]%造成[e],持续[f]秒 技能21的弹道特效版
|
||
--a[float],b[伤害类型,]c[持续伤害状态],d[float],e[控制状态],f[int]
|
||
[113] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local dot = args[3]
|
||
local f2 = args[4]
|
||
local ct = args[5]
|
||
local f3 = args[6]
|
||
-- caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end,caster,dot) then
|
||
BattleUtil.RandomControl(f2, ct, caster, target, f3,skill)
|
||
end
|
||
end)
|
||
end,
|
||
|
||
-- 造成[a]%的[b]伤害如目标[c]则本次技能暴击率提高[d]%
|
||
-- a[float]b[伤害类型]c[持续伤害状态]d[float]
|
||
[114] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local dot = args[3]
|
||
local f2 = args[4]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local index, tran
|
||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end,caster,dot) then
|
||
index, tran = caster:AddPropertyTransfer(RoleDataName.Crit, f2, RoleDataName.Crit, 1)
|
||
end
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
if index and tran then
|
||
caster:RemovePropertyTransfer(index, tran)
|
||
end
|
||
end)
|
||
end,
|
||
|
||
-- 回复自身最大生命值的[a]%
|
||
-- a[float]
|
||
[115] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local v = floor(BattleUtil.ErrorCorrection(target:GetRoleData(RoleDataName.MaxHp)*f1))
|
||
BattleUtil.ApplyTreat(caster, target, v)
|
||
end)
|
||
end,
|
||
--组合技能:主动让自己释放一次有动作的自身普攻技能(配置目标选择只能配置成1个目标,否者会释放多次)by:王振兴
|
||
[116] = function(caster, target, args, interval, skill)
|
||
local i1 = args[1]
|
||
--如果身上有不灭效果就不会加普攻,兼容金翅大鹏10星天赋 by:王振兴
|
||
if not BattleLogic.BuffMgr:HasBuff(caster,BuffName.NoDead) then
|
||
BattleLogic.WaitForTrigger(0.5+1.35, function ()
|
||
caster:InsertSkill(BattleSkillType.Normal, false, true, nil)
|
||
end)
|
||
end
|
||
end,
|
||
|
||
-- [a]%概率[b]改变[c]点怒气
|
||
-- a[float],b[改变类型],c[int]
|
||
[117] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local ct = args[2]
|
||
local i1 = args[3]
|
||
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(f1, function()
|
||
BattleUtil.CalRage(caster, target, i1, ct)
|
||
end)
|
||
end)
|
||
end,
|
||
|
||
|
||
-- 造成[a]*[b]%的直接伤害(不会被分摊机制分摊)
|
||
-- a[属性],b[float]
|
||
[118] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local f1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if (pro==12 or pro==13) and BattleUtil.CheckIsBoss(target) then
|
||
return
|
||
end
|
||
local damage = floor(BattleUtil.ErrorCorrection(f1 * caster:GetRoleData(BattlePropList[pro])))
|
||
BattleUtil.FinalDamage(skill, caster, target, damage, nil, 0, nil, true)
|
||
end)
|
||
end,
|
||
--瞬间恢复目标[a]*[b]%生命
|
||
--a[属性],b[float]
|
||
[119] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(target:GetRoleData(BattlePropList[pro1]), f1))
|
||
BattleUtil.CalTreat(caster, target, val,1,skill)
|
||
end)
|
||
end,
|
||
|
||
--造成[a]%的[b]伤害,目标每减少[c]个伤害提升[d]%,并有[e]%概率附加[f]控制状态,持续[g]回合;魂印添加控制概率[h]%, 减员添加控制概率[i]%,伤害添加[j]%
|
||
--a[float],b[伤害类型],c[int],d[float]
|
||
[120] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local i1 = args[3]
|
||
local f2 = args[4]
|
||
local p1 = args[5]
|
||
local ctrl =args[6]
|
||
local r1 = args[7]
|
||
--魂印增加
|
||
local v1 = args[8]
|
||
local v2 = args[9]
|
||
local v3 = args[10]
|
||
-- 改变值 = 技能最大目标数 - 当前目标数
|
||
local maxNum = skill:GetMaxTargetNum()
|
||
local curNum = #skill:GetDirectTargets()
|
||
local lessNum = max(maxNum - curNum, 0)
|
||
local level = math.floor(lessNum/i1)
|
||
local pro1=p1+v1+level*v2
|
||
f1=f1+level*f2+level*v3
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
--伤害命中才会给目标上buff
|
||
if skill and skill:CheckTargetIsHit(target) then
|
||
BattleUtil.RandomControl(pro1,ctrl, caster, target,r1,skill)
|
||
end
|
||
end)
|
||
end,
|
||
|
||
--直接斩杀[a]%生命
|
||
[121] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local isBoss=BattleUtil.CheckIsBoss(target)
|
||
if isBoss then
|
||
return
|
||
end
|
||
BattleUtil.SeckillHP(skill,caster,target,pro)
|
||
end,
|
||
-- 造成目标[a]*[b]%的直接伤害(不会被分摊机制分摊)
|
||
-- a[属性],b[float]
|
||
[124] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local f1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if (pro==12 or pro==13) and BattleUtil.CheckIsBoss(target) then
|
||
return
|
||
end
|
||
local damage = floor(BattleUtil.ErrorCorrection(f1 * target:GetRoleData(BattlePropList[pro])))
|
||
BattleUtil.FinalDamage(skill, caster, target, damage, nil, 0, nil, true)
|
||
end)
|
||
end,
|
||
-- 目标[a]增加[b]%持续[c]回合,效果可叠加,[d]改变
|
||
-- a[属性]b[float]c[int]d[改变类型]
|
||
[125] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local f1 = args[2]
|
||
local i1 = args[3]
|
||
local ct = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, i1, BattlePropList[pro], f1, ct))
|
||
end)
|
||
end,
|
||
--造成[a]%的[b]伤害,目标数量大于等于[c],伤害[d]改变[e]%;目标数量小于[f],对其额外造成[g]属性[h]%的伤害(e,h填0 为魂印修改数值3)
|
||
--a[float],b[伤害类型],c[int],d[int],e[float] f[int] g[int] h[float]
|
||
[126] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local num = args[3]
|
||
local ct = args[4]
|
||
local f2 = args[5]
|
||
local num2 =args[6]
|
||
local p1 = args[7]
|
||
local f3 = args[8]
|
||
-- 改变值 = 技能最大目标数 - 当前目标数
|
||
local maxNum = skill:GetMaxTargetNum()
|
||
local curNum = #skill:GetDirectTargets()
|
||
if curNum>=num and f2>0 then
|
||
f1=BattleUtil.CountValue(f1,f2,ct)
|
||
end
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
--伤害命中才会给目标上buff
|
||
if skill and skill:CheckTargetIsHit(target) then
|
||
if curNum<num2 then
|
||
if f3 and f3==0 then
|
||
return
|
||
end
|
||
if (p1==12 or p1==13) and BattleUtil.CheckIsBoss(target) then
|
||
return
|
||
end
|
||
local damage = floor(BattleUtil.ErrorCorrection(f3 * target:GetRoleData(BattlePropList[p1])))
|
||
damage=BattleUtil.CalAllReduceShield(caster,target,damage)
|
||
BattleUtil.FinalDamage(nil,caster, target,damage)
|
||
end
|
||
end
|
||
end)
|
||
end,
|
||
--[a]% 的概率 放逐 目标[b]回合
|
||
--a[float],b[int]
|
||
[127] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local round = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(pro, function ()
|
||
target:AddBuff(Buff.Create(caster, BuffName.Exile, round))
|
||
end)
|
||
end)
|
||
end,
|
||
|
||
--造成主角战斗力[a]%+[b]的伤害, pvp最高只造成目标[c][d]%的伤害 (c不填默认12 d:不填默认0.5 )
|
||
--a[float],b[int],c[int],d[float]
|
||
[128] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local round = args[2]
|
||
local pro2 = args[3]
|
||
local v1 =args[4]
|
||
if pro2==nil then
|
||
pro2=12
|
||
end
|
||
if v1==nil then
|
||
v1=0.5
|
||
end
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local damage=floor(caster.teamDamage*pro)+round
|
||
if BattleLogic.GetIsPvP() then
|
||
local maxDamage = floor(target:GetRoleData(BattlePropList[pro2]) * v1)
|
||
if damage>maxDamage then
|
||
damage=maxDamage
|
||
end
|
||
end
|
||
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
end)
|
||
end,
|
||
--回复目标主角战斗力[a]%+[b]的生命值,溢出部分转换为等量御甲值 pvp最高只造成目标[c][d]%的治疗(c不填默认12 d:不填默认0.5 )
|
||
--a[float],b[int],c[int],d[float]
|
||
[129] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local round = args[2]
|
||
local pro2 = args[3]
|
||
local v1 =args[4]
|
||
if pro2==nil then
|
||
pro2=12
|
||
end
|
||
if v1==nil then
|
||
v1=0.5
|
||
end
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local damage=floor(caster.teamDamage*pro)+round
|
||
if BattleLogic.GetIsPvP() then
|
||
local maxDamage = floor(target:GetRoleData(BattlePropList[pro2]) * v1)
|
||
--LogError("生命 maxdamage=="..maxDamage)
|
||
if damage>maxDamage then
|
||
damage=maxDamage
|
||
end
|
||
end
|
||
local value=target:GetRoleData(RoleDataName.MaxHp)-target:GetRoleData(RoleDataName.Hp)
|
||
--如果应该加的血< 单位失去的血量值,就加应该加的血量
|
||
if damage<value then
|
||
value=damage
|
||
end
|
||
|
||
local yujia=0
|
||
if value>0 then
|
||
BattleUtil.FinalTreat(caster, target,value,1,skill)
|
||
else
|
||
value=0
|
||
end
|
||
if damage-value>0 then
|
||
if not target.isBanBlood then
|
||
if target.bloodShield then
|
||
target.bloodShield:AddValue(damage-value)
|
||
else
|
||
target:AddBuff(Buff.Create(caster,BuffName.Blood,0,damage-value))
|
||
end
|
||
end
|
||
end
|
||
end)
|
||
|
||
end,
|
||
--对目标造成流血状态,造成主角战斗力[a]%+[b]的间接伤害,持续[c]回合 pvp最高只造成目标[d][e]%的治疗(d不填默认12 e:不填默认0.5 )
|
||
--a[float],b[int],c[int],d[int],e[float]
|
||
[130] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local v1 = args[2]
|
||
local round = args[3]
|
||
local pro2 = args[4]
|
||
local v2 =args[5]
|
||
if pro2==nil then
|
||
pro2=12
|
||
end
|
||
if v2==nil then
|
||
v2=0.5
|
||
end
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local damage=floor(caster.teamDamage*f1)+v1
|
||
if BattleLogic.GetIsPvP() then
|
||
local maxDamage = floor(target:GetRoleData(BattlePropList[pro2]) * v2)
|
||
if damage>maxDamage then
|
||
damage=maxDamage
|
||
end
|
||
end
|
||
local buff=Buff.Create(caster, BuffName.DOT,round, 1,3,damage)
|
||
buff.skill=skill
|
||
buff.isRealDamage=true
|
||
target:AddBuff(buff)
|
||
end)
|
||
end,
|
||
--对目标造成神佑状态,造成主角战斗力[a]%+[b]的血量,持续[c]回合,溢出部分转化为御甲 pvp最高只造成目标[d][e]%的治疗(d不填默认12 e:不填默认0.5 )
|
||
--a[float],b[int],c[int],d[int],e[float]
|
||
[131] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local v1 = args[2]
|
||
local round = args[3]
|
||
local pro2 = args[4]
|
||
local v2 =args[5]
|
||
if pro2==nil then
|
||
pro2=12
|
||
end
|
||
if v2==nil then
|
||
v2=0.5
|
||
end
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local damage=floor(caster.teamDamage*f1)+v1
|
||
if BattleLogic.GetIsPvP() then
|
||
local maxDamage = floor(target:GetRoleData(BattlePropList[pro2]) * v2)
|
||
if damage>maxDamage then
|
||
damage=maxDamage
|
||
end
|
||
end
|
||
local buff=Buff.Create(caster, BuffName.HOT,round,1,damage)
|
||
buff.hotType=2
|
||
target:AddBuff(buff)
|
||
end)
|
||
end,
|
||
--造成主角[a]*[b]攻击伤害
|
||
--a[int 1:等级 2.战斗力 3.攻击],b[int]
|
||
[132] = function(caster, target, args, interval, skill)
|
||
local type = args[1]
|
||
local pro = args[2]
|
||
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=0
|
||
if type==1 then
|
||
value=caster.star
|
||
elseif type==2 then
|
||
value=caster.teamDamage
|
||
elseif type==3 then
|
||
value=caster:GetRoleData(RoleDataName.Attack)
|
||
end
|
||
local damage=floor(value*pro)
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
end)
|
||
end,
|
||
--对目标造成玩家[a]*[b]的伤害,伤害的[c]%转化为生命,治疗生命百分比最[d]的英雄
|
||
--a[int 1:等级 2.战斗力 3.攻击],b[int],c[float],d[int 1:低 0:高]
|
||
[133] = function(caster, target, args, interval, skill)
|
||
local type=args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
local sort = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=0
|
||
if type==1 then
|
||
value=caster.star
|
||
elseif type==2 then
|
||
value=caster.teamDamage
|
||
elseif type==3 then
|
||
value=caster:GetRoleData(RoleDataName.Attack)
|
||
end
|
||
local damage=floor(value*f1)
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
local hp=floor(damage*f2)
|
||
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
|
||
if arr==nil or #arr==0 then
|
||
return
|
||
end
|
||
BattleUtil.SortByHpFactor(arr,sort)
|
||
BattleUtil.CalTreatNoCrit(caster, arr[1],hp,1,skill)
|
||
|
||
end)
|
||
end,
|
||
--对目标造成主角[a]*[b]的伤害,并有[c]%概率给目标上[d]类型[e]效果buff持续[f]回合,buff具体参数1 [g]
|
||
--a[int 1:等级 2.战斗力 3.攻击],b[int],c[float],d[int],e[int],f[int],g[int]
|
||
[134] = function(caster, target, args, interval, skill)
|
||
local type=args[1]
|
||
local v1 = args[2]
|
||
local p1 = args[3]
|
||
local t1 = args[4]
|
||
local t2 = args[5]
|
||
local r1 = args[6]
|
||
local v2 = args[7]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=0
|
||
if type==1 then
|
||
value=caster.star
|
||
elseif type==2 then
|
||
value=caster.teamDamage
|
||
elseif type==3 then
|
||
value=caster:GetRoleData(RoleDataName.Attack)
|
||
end
|
||
local damage=floor(value*v1)
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
if t1==BuffName.Control then
|
||
BattleUtil.RandomControl(p1,t2,caster,target,r1,skill)
|
||
elseif t1==BuffName.DOT then
|
||
BattleUtil.RandomDot(p1,t2,caster,target,r1,1,value*v2,skill)
|
||
end
|
||
end)
|
||
end,
|
||
--对目标造成主角[a]*[b]的伤害,如果目标处于[c]类型[d]效果,则[e]%概率给目标添加[f]类型[g]效果,持续[h]回合
|
||
--a[int 1:等级 2.战斗力 3.攻击],b[int],c[int],d[int],e[float],f[int],g[int],h[int]
|
||
[135] = function(caster, target, args, interval, skill)
|
||
local type=args[1]
|
||
local v1 = args[2]
|
||
local t1 = args[3]
|
||
local t2 = args[4]
|
||
local pro = args[5]
|
||
local t3 = args[6]
|
||
local t4 = args[7]
|
||
local r1 =args[8]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=0
|
||
if type==1 then
|
||
value=caster.star
|
||
elseif type==2 then
|
||
value=caster.teamDamage
|
||
elseif type==3 then
|
||
value=caster:GetRoleData(RoleDataName.Attack)
|
||
end
|
||
local damage=floor(value*v1)
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
if BattleLogic.BuffMgr:HasBuff(target, t1, function (buff)
|
||
if t1==BuffName.DOT then
|
||
return buff.damageType==t2
|
||
end
|
||
end) then
|
||
if t3==BuffName.Control then
|
||
BattleUtil.RandomControl(pro,t4,caster,target,r1,skill)
|
||
end
|
||
end
|
||
end)
|
||
end,
|
||
--对目标造成主角[a]*[b]攻击伤害,目标每减少[c]个伤害增加[d]%
|
||
--a[int 1:等级 2.战斗力 3.攻击],b[int],c[int],d[float]
|
||
[136] = function(caster, target, args, interval, skill)
|
||
local type = args[1]
|
||
local pro = args[2]
|
||
local i1 = args[3]
|
||
local v1 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=0
|
||
if type==1 then
|
||
value=caster.star
|
||
elseif type==2 then
|
||
value=caster.teamDamage
|
||
elseif type==3 then
|
||
value=caster:GetRoleData(RoleDataName.Attack)
|
||
end
|
||
-- 改变值 = 技能最大目标数 - 当前目标数
|
||
local maxNum = skill:GetMaxTargetNum()
|
||
local curNum = #skill:GetDirectTargets()
|
||
local lessNum = max(maxNum - curNum, 0)
|
||
local level = math.floor(lessNum/i1)
|
||
local extra = BattleUtil.ErrorCorrection(level * v1)
|
||
local damage=floor(value*pro*(1+extra))
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
end)
|
||
end,
|
||
--对目标造成主角[a]*[b]攻击伤害,如果击杀目标,随机减少敌方[c]个神将[d]点怒气
|
||
--a[int 1:等级 2.战斗力 3.攻击],b[int],c[int],d[float]
|
||
[137] = function(caster, target, args, interval, skill)
|
||
local type = args[1]
|
||
local pro = args[2]
|
||
local i1 = args[3]
|
||
local v1 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=0
|
||
if type==1 then
|
||
value=caster.star
|
||
elseif type==2 then
|
||
value=caster.teamDamage
|
||
elseif type==3 then
|
||
value=caster:GetRoleData(RoleDataName.Attack)
|
||
end
|
||
local damage=floor(value*pro)
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
if target.isDead then
|
||
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime,function()
|
||
local arr = RoleManager.Query(function (r) return r.camp == target.camp end)
|
||
if arr and #arr>0 then
|
||
for i = 1, i1 do
|
||
local count = Random.RangeInt(1,#arr)
|
||
BattleUtil.CalRage(caster,arr[count],v1,CountTypeName.Sub)
|
||
end
|
||
end
|
||
end)
|
||
end
|
||
end)
|
||
end,
|
||
--技能目标如果大于[a],改变[b]目标[c]点怒气
|
||
--a[int],b[int],c[int]
|
||
[138] = function(caster, target, args, interval, skill)
|
||
local num = args[1]
|
||
local ct = args[2]
|
||
local v1 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local curNum = #skill:GetDirectTargets()
|
||
if curNum>num then
|
||
BattleUtil.CalRage(caster,target,v1,ct)
|
||
end
|
||
end)
|
||
end,
|
||
--对目标造成主角[a]*[b]的伤害,如果目标处于[c]类型[d]效果,则伤害改变[e][f]%
|
||
--a[int 1:等级 2.战斗力 3.攻击],b[int],c[int],d[int],e[int],f[float]
|
||
[139] = function(caster, target, args, interval, skill)
|
||
local type=args[1]
|
||
local v1 = args[2]
|
||
local t1 = args[3]
|
||
local t2 = args[4]
|
||
local ct = args[5]
|
||
local v2 = args[6]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=0
|
||
if type==1 then
|
||
value=caster.star
|
||
elseif type==2 then
|
||
value=caster.teamDamage
|
||
elseif type==3 then
|
||
value=caster:GetRoleData(RoleDataName.Attack)
|
||
end
|
||
local add=0
|
||
if BattleLogic.BuffMgr:HasBuff(target, t1, function (buff)
|
||
if t1==BuffName.DOT then
|
||
return buff.damageType==t2
|
||
end
|
||
end) then
|
||
add=v2
|
||
end
|
||
local damage=floor(value*v1)
|
||
damage=floor(BattleUtil.CountValue(damage,add,ct))
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
end)
|
||
end,
|
||
--造成主角[a]*[b]攻击伤害,概率[c]改变[d]目标[e]点怒气
|
||
--a[int 1:等级 2.战斗力 3.攻击],b[int],c[float],d[int],e[int]
|
||
[140] = function(caster, target, args, interval, skill)
|
||
local type = args[1]
|
||
local pro = args[2]
|
||
local p1 = args[3]
|
||
local ct = args[4]
|
||
local v1 = args[5]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=0
|
||
if type==1 then
|
||
value=caster.star
|
||
elseif type==2 then
|
||
value=caster.teamDamage
|
||
elseif type==3 then
|
||
value=caster:GetRoleData(RoleDataName.Attack)
|
||
end
|
||
local damage=floor(value*pro)
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
BattleUtil.RandomAction(p1, function ()
|
||
BattleUtil.CalRage(caster,target,v1,ct)
|
||
end)
|
||
end)
|
||
end,
|
||
--概率[a]添加[b]类型[c]效果,[d]%概率无视免疫,持续[e]回合,参数1[f],参数2[g],参数3[h]
|
||
--a[float],b[int],c[int],d[float],e[int],f[int/float],g[int/float],h[int/float]
|
||
[141] = function(caster, target, args, interval, skill)
|
||
local pro=args[1]
|
||
local t1=args[2]
|
||
local t2=args[3]
|
||
local pro2=args[4]
|
||
local r1=args[5]
|
||
local v1=args[6]
|
||
local v2=args[7]
|
||
local v3=args[8]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.RandomAction(pro,function()
|
||
local buff=nil
|
||
if t1==BuffName.Control then
|
||
buff=Buff.Create(caster, t1, r1,t2)
|
||
elseif t1==BuffName.Immune then
|
||
if t2==4 then --自定义免疫
|
||
local imms={}
|
||
if v1 then
|
||
table.insert(imms,v1)
|
||
end
|
||
if v2 then
|
||
table.insert(imms,v2)
|
||
end
|
||
if v3 then
|
||
table.insert(imms,v3)
|
||
end
|
||
local emmune=function(buff)
|
||
return buff.type == BuffName.Control and (BattleUtil.ChecklistIsContainValue(imms,buff.ctrlType)),caster
|
||
end
|
||
buff=Buff.Create(caster, t1, r1,t2,emmune)
|
||
else
|
||
buff=Buff.Create(caster, t1, r1,t2)
|
||
end
|
||
elseif t1==BuffName.DOT then
|
||
local treat=floor(caster:GetRoleData(BattlePropList[v1])*v2)
|
||
buff=Buff.Create(caster, t1, r1,1,t2,treat)
|
||
elseif t1==BuffName.FalseNoDead then
|
||
buff=Buff.Create(caster, t1, r1,t2,v1)
|
||
else
|
||
buff=Buff.Create(caster, t1, r1,t2)
|
||
end
|
||
target:AddBuff(buff,pro2)
|
||
end)
|
||
|
||
end)
|
||
|
||
end,
|
||
--概率[a]%为[b]阵营非[c]职业添加[d]类型[e]效果,[f]%概率无视免疫,持续[g]回合,参数1[h],参数2[i],参数3[j]
|
||
--a[float],b[int],c[int],d[int],e[int],f[float],g[int],h[int/float],i[int/float]
|
||
[142] = function(caster, target, args, interval, skill)
|
||
local pro=args[1]
|
||
local ele=args[2]
|
||
local job=args[3]
|
||
local t1=args[4]
|
||
local t2=args[5]
|
||
local pro2=args[6]
|
||
local r1=args[7]
|
||
local v1=args[8]
|
||
local v2=args[9]
|
||
local v3=args[10]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if target.element~=ele and ele~=0 then
|
||
return
|
||
end
|
||
if target.job==job and job~=0 then
|
||
return
|
||
end
|
||
if t1==BuffName.CommonSign then
|
||
BattleUtil.RandomAction(pro,function()
|
||
local buff=Buff.Create(caster, t1, r1)
|
||
target:AddBuff(buff,pro2)
|
||
end)
|
||
end
|
||
end)
|
||
|
||
end,
|
||
--回复目标[a]属性[b]%的生命(最终治疗 不暴击,不受被动影响)
|
||
--a[int],b[float]
|
||
[143] = function(caster, target, args, interval, skill)
|
||
local pro=args[1]
|
||
local v1=args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local treat=floor(target:GetRoleData(RoleDataName.MaxHp)*v1)
|
||
BattleUtil.FinalTreat(caster,target,treat,1,skill)
|
||
end)
|
||
end,
|
||
--对目标造成神佑状态,造成目标[a]属性[b]%的治疗,持续[c]回合,溢出的治疗量转化为御甲
|
||
--a[int],b[float],c[int]
|
||
[144] = function(caster, target, args, interval, skill)
|
||
local p1 = args[1]
|
||
local v1 = args[2]
|
||
local round = args[3]
|
||
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local damage=floor(target:GetRoleData(BattlePropList[p1])*v1)
|
||
local buff=Buff.Create(caster,BuffName.HOT,round,1,damage)
|
||
buff.hotType=2
|
||
target:AddBuff(buff)
|
||
end)
|
||
end,
|
||
--为我方添加反伤盾,护盾类型为[a],护盾值为[b]%,持续[c]回合,反弹伤害[d]次
|
||
--a[int],b[float],c[int],d[int]
|
||
[145] = function(caster, target, args, interval, skill)
|
||
local type = args[1]
|
||
local v1 = args[2]
|
||
local r1 = args[3]
|
||
local time = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
|
||
target:AddBuff(Buff.Create(caster, BuffName.Shield,r1,type,v1,time))
|
||
end)
|
||
end,
|
||
--对目标造成自身[a]*[b]%的伤害,目标每减少[c]个伤害增加[d]%,
|
||
--a[int],b[int],c[int],d[float]
|
||
[146] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local v1 = args[2]
|
||
local i1 = args[3]
|
||
local v2 = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
|
||
local isBoss=BattleUtil.CheckIsBoss(target)
|
||
if isBoss then
|
||
return
|
||
end
|
||
-- 改变值 = 技能最大目标数 - 当前目标数
|
||
local maxNum = skill:GetMaxTargetNum()
|
||
local curNum = #skill:GetDirectTargets()
|
||
local lessNum = max(maxNum - curNum, 0)
|
||
local level = math.floor(lessNum/i1)
|
||
local extra = BattleUtil.ErrorCorrection(level * v2)
|
||
local damage=floor(target:GetRoleData(BattlePropList[pro])*(v1+extra))
|
||
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
|
||
end)
|
||
end,
|
||
--复活目标,并恢复血量[a]%,回复[b]点怒气,并无敌[c]回合
|
||
--a[float],b[int],c[int]
|
||
[147]=function(caster, target, args, interval, skill)
|
||
local pro=args[1]
|
||
local num=args[2]
|
||
local round=args[3]
|
||
target.isRealDead=true
|
||
target:SetRelive(pro, caster)
|
||
if num then
|
||
BattleUtil.CalRage(caster,target,num,CountTypeName.Add)
|
||
end
|
||
|
||
if round then
|
||
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,防止触发帧和结束帧为同一帧时,被动未移除
|
||
target:AddBuff(Buff.Create(caster, BuffName.Shield,round, ShieldTypeName.AllReduce, 0, 0))
|
||
end)
|
||
|
||
end
|
||
|
||
end,
|
||
--造成[a]%的[b]伤害,造成伤害的[c]%用于医疗生命值最低的队友。(攻击目标为多人治疗不重复)
|
||
--a[float],b[伤害类型],c[float]
|
||
[148] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
|
||
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
|
||
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
|
||
BattleUtil.SortByHpFactor(arr, 1)
|
||
--之前是finaldag 改成 damage
|
||
for i = 1, #arr do
|
||
if not BattleUtil.ChecklistIsContainValue(skill.targets,arr[i]) then
|
||
f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[i])
|
||
BattleUtil.ApplyTreat(caster, arr[i], floor(damage*f2))
|
||
table.insert(skill.targets,arr[i])
|
||
break
|
||
end
|
||
|
||
end
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
end)
|
||
|
||
end,
|
||
--造成[a]%的[b]伤害并记录技能总伤害
|
||
--a[float],b[伤害类型]
|
||
[149] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
local f2 = args[3]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,curSkill)
|
||
if curSkill then
|
||
curSkill.skillDamage=curSkill.skillDamage+damage
|
||
end
|
||
end
|
||
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
|
||
end)
|
||
end,
|
||
--造成技能总伤害的[a]%平分给生命值最低的[b]队友
|
||
--a[float],b[int]
|
||
[150] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local num = args[2]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local OnSkillEnd
|
||
OnSkillEnd=function(skill)
|
||
if skill.skillDamage==0 then
|
||
return
|
||
end
|
||
local hp=BattleUtil.ErrorCorrection(skill.skillDamage*f1/num)
|
||
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
|
||
BattleUtil.SortByHpFactor(arr, 1)
|
||
for i = 1, #arr do
|
||
if i<=num then
|
||
BattleUtil.ApplyTreat(caster, arr[i], hp)
|
||
end
|
||
end
|
||
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd,OnSkillEnd)
|
||
end
|
||
caster.Event:AddEvent(BattleEventName.SkillCastEnd,OnSkillEnd)
|
||
|
||
end)
|
||
end,
|
||
-- 造成目标[a]*[b]%的间接伤害
|
||
-- a[属性],b[float]
|
||
[151] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local f1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if (pro==12 or pro==13) and BattleUtil.CheckIsBoss(target) then
|
||
return
|
||
end
|
||
local damage = floor(BattleUtil.ErrorCorrection(f1 * target:GetRoleData(BattlePropList[pro])))
|
||
BattleUtil.FinalDamageCountShield(nil, caster, target, damage)
|
||
end)
|
||
end,
|
||
--直接斩杀剩余所有血量(御甲无效)
|
||
[152] = function(caster, target, args, interval, skill)
|
||
local isBoss=BattleUtil.CheckIsBoss(target)
|
||
if isBoss then
|
||
return
|
||
end
|
||
BattleUtil.Seckill(skill,caster,target)
|
||
end,
|
||
--瞬间恢复[a]*[b]%生命,并移除中毒灼烧状态
|
||
--a[属性],b[float]
|
||
[153] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(target:GetRoleData(BattlePropList[pro1]), f1))
|
||
BattleUtil.CalTreatNoCrit(caster, target, val,1,skill)
|
||
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
|
||
return clearBuffPredicate(buff,5)
|
||
end)
|
||
end)
|
||
end,
|
||
--瞬间恢复[a]*[b]%生命,并移除中毒灼烧状态
|
||
--a[属性],b[float]
|
||
[154] = function(caster, target, args, interval, skill)
|
||
local pro1 = args[1]
|
||
local f1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(target:GetRoleData(BattlePropList[pro1]), f1))
|
||
BattleUtil.CalTreatNoCrit(caster, target, val,1,skill)
|
||
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
|
||
return clearBuffPredicate(buff,5)
|
||
end)
|
||
end)
|
||
end,
|
||
--神兵[a]属性[b]%+对位英雄损失血量[c]%的[d]伤害
|
||
--a[属性],b[float],c[int],d[int]
|
||
[155] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local f1 = args[2]
|
||
local f2 = args[3]
|
||
local type = args[4]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro]), f1))
|
||
if skill.ownHero then
|
||
local addValue=(skill.ownHero:GetRoleData(RoleDataName.MaxHp)-skill.ownHero:GetRoleData(RoleDataName.Hp))*f2
|
||
val=val+floor(addValue)
|
||
end
|
||
BattleUtil.FinalDamage(skill, caster, target,val, nil, 0, nil, true)
|
||
end)
|
||
end,
|
||
-- 造成[a]*[b]%的间接伤害
|
||
-- a[属性],b[float]
|
||
[156] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local f1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if (pro==12 or pro==13) and BattleUtil.CheckIsBoss(target) then
|
||
return
|
||
end
|
||
local damage = floor(BattleUtil.ErrorCorrection(f1 * caster:GetRoleData(BattlePropList[pro])))
|
||
BattleUtil.FinalDamage(nil, caster, target, damage, nil, 0, nil, true)
|
||
end)
|
||
end,
|
||
-- 造成[a]*[b]%的伤害,吸取所有有仇视效果的[c]%生命上限*效果层数的伤害,如果神兵对应英雄回满血,多回的血造成伤害
|
||
-- a[属性],b[float],c[float]
|
||
[157] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
local f1 = args[2]
|
||
local v1 = args[3]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if skill.ownHero==nil then
|
||
return
|
||
end
|
||
local damage = floor(BattleUtil.ErrorCorrection(f1 * caster:GetRoleData(BattlePropList[pro])))
|
||
local arr=RoleManager.Query(function(v) return v.camp~=caster.camp end)
|
||
local allAddHp=0
|
||
local addDamage=0
|
||
addDamage=damage
|
||
if arr then
|
||
for i = 1, #arr do
|
||
--BattleLogic.BuffMgr:HasBuff(arr[i], BuffName.BreakArmor, function (buff) return buff.signType == 5 end)
|
||
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==arr[i] and buff.type==BuffName.BreakArmor and buff.signType==5 end)
|
||
local len=BattleUtil.LengthOfTable(list)
|
||
if len>0 then
|
||
local addhp=floor(arr[i]:GetRoleData(RoleDataName.MaxHp)*v1)*len
|
||
allAddHp=allAddHp+ addhp
|
||
--LogError("吸取的血量==="..addhp.." 层树=="..len)
|
||
BattleUtil.FinalDamage(nil,caster,arr[i],addhp)
|
||
BattleLogic.BuffMgr:ClearBuff(arr[i], function(buff)
|
||
return buff.type == BuffName.BreakArmor and buff.signType==5
|
||
end)
|
||
end
|
||
end
|
||
local hp=skill.ownHero:GetRoleData(RoleDataName.MaxHp)-skill.ownHero:GetRoleData(RoleDataName.Hp)
|
||
--LogError("damage=="..addDamage.." alladdhp=="..allAddHp.." hp=="..hp)
|
||
if hp>0 then
|
||
BattleUtil.FinalTreat(caster,skill.ownHero,hp)
|
||
end
|
||
if allAddHp>hp then
|
||
addDamage=addDamage+allAddHp-hp
|
||
end
|
||
end
|
||
BattleUtil.FinalDamage(nil, caster, target,addDamage, nil, 0, nil, true)
|
||
end)
|
||
end,
|
||
--造成自身损失生命[a]%的间接伤害
|
||
--a[float]
|
||
[158] = function(caster, target, args, interval, skill)
|
||
local pro = args[1]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local value=(caster:GetRoleData(RoleDataName.MaxHp)-caster:GetRoleData(RoleDataName.Hp))*pro
|
||
if value<=0 then
|
||
return
|
||
end
|
||
BattleUtil.FinalDamage(nil, caster, target,floor(value), nil, 0, nil, true)
|
||
end)
|
||
end,
|
||
--添加一个控制效果
|
||
[159] = function(caster, target, args, interval, skill)
|
||
local round = args[1]--持续回合数
|
||
local ctrType= args[2]--控制类型
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
target:AddBuff(Buff.Create(caster, BuffName.Control, round, ctrType))
|
||
end)
|
||
end,
|
||
--近战造成[a]次,[b]%的[C]伤害
|
||
--a[int],b[float],C[伤害类型]
|
||
[160] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
local skillNumberTime=skill.skillnumberTime or nil
|
||
if skillNumberTime and skillNumberTime[1] and (type(skillNumberTime[1][1]) ~= "userdata" and skillNumberTime[1][1]~=0) then
|
||
for i = 1, #skillNumberTime do
|
||
local index=i
|
||
BattleLogic.WaitForTrigger(skillNumberTime[index][2]/1000, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
-- LogError("触发"..index.."次"..skillNumberTime[index][2].."|"..interval)
|
||
--LogError("attackdamage"..os.date())
|
||
--LogError("currentframe"..BattleLogic.CurFrame())
|
||
|
||
end)
|
||
|
||
end
|
||
|
||
else
|
||
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
--LogError("attackdamage"..os.date())
|
||
end)
|
||
end
|
||
|
||
end,
|
||
--远程造成[a]次,[b]%的[C]伤害
|
||
--a[int],b[float],C[伤害类型]
|
||
[161] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
|
||
end)
|
||
end,
|
||
|
||
|
||
-- --己方场上人数 < 地方人数,对[a]目标选择[b]属性[c]%的法术伤害并附加逆风效果,不低于对[d]目标选择[e]属性[f]%的御甲并附加乘风效果。
|
||
-- [160] = function(caster, target, args, interval, skill)
|
||
-- local c1 = args[1]--持续回合数
|
||
-- local p1 = args[2]--控制类型
|
||
-- local v1 = args[3]
|
||
-- local c2 = args[4]
|
||
-- local p1 = args[5]
|
||
-- local v2 = args[6]
|
||
-- BattleLogic.WaitForTrigger(interval, function ()
|
||
-- local myArr = RoleManager.Query(function (r) return r.camp == caster.camp end)
|
||
-- local enArr = RoleManager.Query(function (r) return r.camp ~= caster.camp end)
|
||
-- if #myArr< #enArr then
|
||
-- local arr1 = BattleUtil.ChooseTarget(caster, c1)
|
||
-- for i=1, #arr1 do
|
||
-- BattleUtil.CalDamage(skill, caster,arr1[i], v1,1)
|
||
-- end
|
||
|
||
-- else
|
||
|
||
-- end
|
||
-- end)
|
||
-- end,
|
||
|
||
--添加一个[a]印记,持续[b]回合
|
||
--a[int]:7逆风风 8:顺风风
|
||
[162] = function(caster, target, args, interval, skill)
|
||
|
||
local type = args[1]
|
||
local round= args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
if type==7 and caster.sunTime>=caster.sunMaxTime then
|
||
return
|
||
end
|
||
if type==8 and caster.niTime>=caster.niMaxTime then
|
||
return
|
||
end
|
||
target:AddBuff(Buff.Create(caster, BuffName.BreakArmor, round,type))
|
||
end)
|
||
end,
|
||
|
||
--近战造成[a]次,[b]%的[C]伤害
|
||
--a[int],b[float],C[伤害类型]
|
||
[163] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
local skillNumberTime=skill.skillnumberTime or nil
|
||
if skillNumberTime and (tonumber(skillNumberTime)~=nil and skillNumberTime[1] and skillNumberTime[1][1]~=0) then
|
||
for i = 1, #skillNumberTime do
|
||
local index=i
|
||
BattleLogic.WaitForTrigger(skillNumberTime[index][2]/1000, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
-- LogError("触发"..index.."次"..skillNumberTime[index][2].."|"..interval)
|
||
--LogError("attackdamage"..os.date())
|
||
--LogError("currentframe"..BattleLogic.CurFrame())
|
||
|
||
end)
|
||
|
||
end
|
||
|
||
else
|
||
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
--LogError("attackdamage"..os.date())
|
||
end)
|
||
end
|
||
|
||
end,
|
||
--远程造成[a]次,[b]%的[C]伤害
|
||
--a[int],b[float],C[伤害类型]
|
||
[164] = function(caster, target, args, interval, skill)
|
||
local f1 = args[1]
|
||
local dt = args[2]
|
||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
BattleUtil.CalDamage(skill, caster, target, dt, f1)
|
||
|
||
end)
|
||
end,
|
||
--为目标添加[a]属性[b]%的御甲
|
||
--a[int],b[float]
|
||
|
||
[165] = function(caster, target, args, interval, skill)
|
||
|
||
local pro = args[1]
|
||
local v1 = args[2]
|
||
BattleLogic.WaitForTrigger(interval, function ()
|
||
local val = floor(BattleUtil.FP_Mul(v1, caster:GetRoleData(BattlePropList[pro])))
|
||
--如果身上有御甲就添加御甲的值
|
||
BattleUtil.AddBlood(target,val)
|
||
end)
|
||
|
||
end,
|
||
--如果目标生命百分比小于等于[a]%,直接斩杀剩余所有血量(御甲无效)
|
||
--a[float]
|
||
[166] = function(caster, target, args, interval, skill)
|
||
local prop = args[1]
|
||
local isBoss=BattleUtil.CheckIsBoss(target)
|
||
if isBoss then
|
||
return
|
||
end
|
||
local curProp=BattleUtil.GetHPPencent(target)
|
||
if curProp>prop then
|
||
return
|
||
end
|
||
BattleUtil.Seckill(skill,caster,target)
|
||
end,
|
||
}
|
||
|
||
return effectList |