Effect.lua 152 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608
  1. local floor = math.floor
  2. local min = math.min
  3. local max = math.max
  4. --local RoleDataName = RoleDataName
  5. --local BattleLogic = BattleLogic
  6. --local BattleUtil = BattleUtil
  7. --属性编号
  8. -- local BattlePropList = {
  9. -- RoleDataName.Attack,
  10. -- RoleDataName.PhysicalDefence,
  11. -- RoleDataName.MagicDefence,
  12. -- RoleDataName.Speed,
  13. -- RoleDataName.DamageBocusFactor,
  14. -- RoleDataName.DamageReduceFactor,
  15. -- RoleDataName.Hit,
  16. -- RoleDataName.Dodge,
  17. -- RoleDataName.Crit,
  18. -- RoleDataName.CritDamageFactor,
  19. -- RoleDataName.TreatFacter,
  20. -- RoleDataName.MaxHp,
  21. -- RoleDataName.Hp,
  22. -- RoleDataName.CureFacter,
  23. -- RoleDataName.Tenacity,
  24. -- RoleDataName.InitRage,
  25. -- }
  26. local function buffRandomAction(random, target, buff)
  27. -- 检测被动技能对技能的加成
  28. local rate = random
  29. local _ControlRatePassivitying = function(finalRate)
  30. rate = finalRate
  31. end
  32. buff.caster.Event:DispatchEvent(BattleEventName.SkillRandomBuff, target, buff, rate, _ControlRatePassivitying)
  33. -- 计算概率
  34. local b = Random.Range01() <= rate
  35. if b then
  36. target:AddBuff(buff)
  37. return true
  38. else
  39. target.Event:DispatchEvent(BattleEventName.BuffDodge, buff)
  40. BattleLogic.BuffMgr:PutBuff(buff)
  41. end
  42. end
  43. local function calBuffHit(caster, target, baseRandom)
  44. if caster.isTeam then --异妖不走效果命中公式
  45. return baseRandom
  46. end
  47. local hit = (1 + caster:GetRoleData(RoleDataName.Hit) / (1 + target:GetRoleData(RoleDataName.Dodge)))
  48. hit = baseRandom + caster:GetRoleData(RoleDataName.Hit)
  49. return baseRandom
  50. end
  51. local function clearBuffPredicate(buff, type)
  52. local flag = false
  53. if type == 1 then --持续恢复
  54. flag = buff.type == BuffName.HOT
  55. elseif type == 2 then --护盾
  56. flag = buff.type == BuffName.Shield
  57. elseif type == 3 then --增益状态
  58. flag = buff.isBuff == true
  59. elseif type == 4 then --减益状态
  60. flag = buff.isDeBuff == true
  61. elseif type == 5 then --持续伤害
  62. flag = buff.type == BuffName.DOT
  63. elseif type == 6 then --负面状态(控制状态、减益状态和持续伤害状态)
  64. flag = buff.type == BuffName.Control or buff.isDeBuff or buff.type == BuffName.DOT
  65. end
  66. return flag
  67. end
  68. --效果表
  69. local effectList = {
  70. --造成[a]%的[b]伤害
  71. --a[float],b[伤害类型]
  72. [1] = function(caster, target, args, interval, skill)
  73. local f1 = args[1]
  74. local dt = args[2]
  75. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  76. BattleLogic.WaitForTrigger(interval, function ()
  77. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  78. end)
  79. end,
  80. --造成[a]%的[b]伤害【AOE】
  81. --a[float],b[伤害类型]
  82. [2] = function(caster, target, args, interval, skill)
  83. local f1 = args[1]
  84. local dt = args[2]
  85. -- caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  86. BattleLogic.WaitForTrigger(interval, function ()
  87. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  88. end)
  89. end,
  90. --[a]%概率[b],持续[c]秒
  91. --a[float],b[控制状态],c[float]
  92. [3] = function(caster, target, args, interval, skill)
  93. local f1 = args[1]
  94. local cb1 = args[2]
  95. local f2 = args[3]
  96. BattleLogic.WaitForTrigger(interval, function ()
  97. BattleUtil.RandomControl(f1, cb1, caster, target, f2)
  98. end)
  99. end,
  100. --[d]改变[a]属性[b]%,持续[c]秒
  101. --a[属性],b[float],c[int],d[改变类型]
  102. [4] = function(caster, target, args, interval, skill)
  103. local pro1 = args[1]
  104. local f1 = args[2]
  105. local f2 = args[3]
  106. local ct = args[4]
  107. BattleLogic.WaitForTrigger(interval, function ()
  108. local buff = Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct)
  109. if f2 == 0 then
  110. buff.cover = true
  111. end
  112. target:AddBuff(buff)
  113. end)
  114. end,
  115. --持续恢复[a]*[b]%生命,持续[c]秒
  116. --a[属性],b[float],c[int]
  117. [5] = function(caster, target, args, interval, skill)
  118. local pro1 = args[1]
  119. local f1 = args[2]
  120. local f2 = args[3]
  121. BattleLogic.WaitForTrigger(interval, function ()
  122. local val = floor(BattleUtil.FP_Mul(f1, caster:GetRoleData(BattlePropList[pro1])))
  123. target:AddBuff(Buff.Create(caster, BuffName.HOT, f2, 1, val))
  124. end)
  125. end,
  126. --造成[a]到[b]次[c]%的[d]伤害
  127. --a[int],b[int],c[float],d[伤害类型]
  128. [6] = function(caster, target, args, interval, skill)
  129. local i1 = args[1]
  130. local i2 = args[2]
  131. local f1 = args[3]
  132. local dt = args[4]
  133. local count = Random.RangeInt(i1, i2)
  134. local d = interval / count
  135. for i=1, count do
  136. BattleLogic.WaitForTrigger(d * (i-1), function ()
  137. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
  138. BattleLogic.WaitForTrigger(d, function ()
  139. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  140. end)
  141. end)
  142. end
  143. end,
  144. --造成[a]到[b]次[c]%的[d]伤害【AOE】
  145. --a[int],b[int],c[float],d[伤害类型]
  146. [7] = function(caster, target, args, interval, skill)
  147. local i1 = args[1]
  148. local i2 = args[2]
  149. local f1 = args[3]
  150. local dt = args[4]
  151. local count = Random.RangeInt(i1, i2)
  152. local d = interval / count
  153. for i=1, count do
  154. BattleLogic.WaitForTrigger(d * (i-1), function ()
  155. BattleLogic.WaitForTrigger(d, function ()
  156. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  157. end)
  158. end)
  159. end
  160. end,
  161. --[b]%改变[c]下次重击技能CD[a]秒
  162. --a[float],b[float],c[改变类型]
  163. [8] = function(caster, target, args, interval, skill)
  164. local f1 = args[1]
  165. local f2 = args[2]
  166. local ct = args[3]
  167. BattleLogic.WaitForTrigger(interval, function ()
  168. BattleUtil.RandomAction(f2, function ()
  169. target:AddSkillCD(f1, ct)
  170. end)
  171. end)
  172. end,
  173. --添加[a]的[b]%护盾,持续[c]秒,盾消失的时候反射吸收伤害的[d]%
  174. --a[属性],b[float],c[int],d[float]
  175. [9] = function(caster, target, args, interval, skill)
  176. local pro1 = args[1]
  177. local f1 = args[2]
  178. local f2 = args[3]
  179. local f3 = args[4]
  180. BattleLogic.WaitForTrigger(interval, function ()
  181. local val = floor(BattleUtil.FP_Mul(f1, caster:GetRoleData(BattlePropList[pro1])))
  182. target:AddBuff(Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, val, f3))
  183. end)
  184. end,
  185. --造成[a]%的[b]伤害,自身恢复造成伤害[c]%的生命
  186. --a[float],b[伤害类型],c[float]
  187. [10] = function(caster, target, args, interval, skill)
  188. local f1 = args[1]
  189. local dt = args[2]
  190. local f2 = args[3]
  191. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  192. BattleLogic.WaitForTrigger(interval, function ()
  193. local dmg = BattleUtil.CalDamage(skill, caster, target, dt, f1)
  194. BattleUtil.CalTreat(caster, caster, floor(dmg * f2))
  195. end)
  196. end,
  197. --造成[a]%的[b]伤害,对[c]造成额外[d]%伤害
  198. --a[float],b[伤害类型,]c[职业],d[float]
  199. [11] = function(caster, target, args, interval, skill)
  200. local f1 = args[1]
  201. local dt = args[2]
  202. local i1 = args[3]
  203. local f2 = args[4]
  204. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  205. BattleLogic.WaitForTrigger(interval, function ()
  206. if target.roleData.professionId == i1 then
  207. f1 = f1*(1+f2)
  208. end
  209. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  210. end)
  211. end,
  212. --每秒造成[a]的[b]的伤害,持续[c]秒
  213. --a[float],b[伤害类型],c[int]
  214. [12] = function(caster, target, args, interval, skill)
  215. local f1 = args[1]
  216. local dt = args[2]
  217. local f2 = args[3]
  218. BattleLogic.WaitForTrigger(interval, function ()
  219. target:AddBuff(Buff.Create(caster, BuffName.DOT, f2, 1, 0, dt, f1))
  220. end)
  221. end,
  222. --造成[a],每秒造成[b]的[c]的伤害,持续[d]秒
  223. --a[持续伤害状态].b[float],c[伤害类型],d[int]
  224. [13] = function(caster, target, args, interval, skill)
  225. local d1 = args[1]
  226. local f1 = args[2]
  227. local dt = args[3]
  228. local f2 = args[4]
  229. BattleLogic.WaitForTrigger(interval, function ()
  230. target:AddBuff(Buff.Create(caster, BuffName.DOT, f2, 1, d1, dt, f1))
  231. end)
  232. end,
  233. --造成[a]%的[b]伤害,[c]%概率[d]专属伤害加深印记(如果有印记,[a]*(1+印记数量*[e])),印记最多[f]层(减益印记,不可驱散)
  234. --a[float],b[伤害类型],c[float],d[角色id],e[float],f[int]
  235. [14] = function(caster, target, args, interval, skill)
  236. local f1 = args[1]
  237. local dt = args[2]
  238. local f2 = args[3]
  239. local rid = args[4]
  240. local f3 = args[5]
  241. local i1 = args[6]
  242. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  243. BattleLogic.WaitForTrigger(interval, function ()
  244. local layer
  245. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
  246. local b = buff.flag == rid
  247. if b then
  248. layer = buff.layer
  249. end
  250. return b
  251. end) then
  252. BattleUtil.CalDamage(skill, caster, target, dt,f1 * (1 + min(layer, i1) * f3))
  253. else
  254. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  255. end
  256. local buff = Buff.Create(caster, BuffName.Brand, 0, rid)
  257. buff.isDeBuff = true
  258. buff.clear = false
  259. buffRandomAction(f2, target, buff)
  260. end)
  261. end,
  262. --造成[a]%的[b]伤害,如果击杀,则其他人再受到此次伤害的[c]%的伤害
  263. --a[float],b[伤害类型],c[float]
  264. [15] = function(caster, target, args, interval, skill)
  265. local f1 = args[1]
  266. local dt = args[2]
  267. local f2 = args[3]
  268. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  269. BattleLogic.WaitForTrigger(interval, function ()
  270. local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
  271. if target:IsDead() then
  272. local arr = RoleManager.Query(function (r) return r.camp ~= caster.camp and r.uid ~= target.uid end)
  273. for i=1, #arr do
  274. BattleUtil.ApplyDamage(skill, caster, arr[i], floor(dmg * f2))
  275. end
  276. end
  277. end)
  278. end,
  279. --吸取[a]%的[b],持续[c]秒(属于增益),累积不高于自身该属性的[d]%
  280. --a[float],b[属性],c[float],d[float]
  281. [16] = function(caster, target, args, interval, skill)
  282. local f1 = args[1]
  283. local pro = args[2]
  284. local f2 = args[3]
  285. local f3 = args[4]
  286. BattleLogic.WaitForTrigger(interval, function ()
  287. --计算上限值
  288. local total = caster.data:GetOrginData(BattlePropList[pro]) * (1 + f3)
  289. --计算预期吸取后的值
  290. local targetValue = caster:GetRoleData(BattlePropList[pro]) + target:GetRoleData(BattlePropList[pro]) * f1
  291. --计算有效吸收值
  292. local delta = min(targetValue, total) - caster:GetRoleData(BattlePropList[pro])
  293. if delta > 0 then
  294. target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro], delta, 3))
  295. caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro], delta, 1))
  296. end
  297. end)
  298. end,
  299. --造成[a]%的[b]伤害,如果是[c],有[d]%必定暴击
  300. --a[float],b[伤害类型],c[职业],d[float]
  301. [17] = function(caster, target, args, interval, skill)
  302. local f1 = args[1]
  303. local dt = args[2]
  304. local i1 = args[3]
  305. local f2 = args[4]
  306. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  307. BattleLogic.WaitForTrigger(interval, function ()
  308. if target.roleData.professionId == i1 then
  309. BattleUtil.RandomAction(f2, function ()
  310. target.isFlagCrit = true
  311. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  312. target.isFlagCrit = false
  313. end)
  314. else
  315. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  316. end
  317. end)
  318. end,
  319. --造成[a]%的[b]伤害,若暴击,则减少下次发动技能CD[c]秒。
  320. --a[float],b[伤害类型],c[float]
  321. [18] = function(caster, target, args, interval, skill)
  322. local f1 = args[1]
  323. local dt = args[2]
  324. local f2 = args[3]
  325. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  326. BattleLogic.WaitForTrigger(interval, function ()
  327. local d, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
  328. if crit then
  329. caster:AddSkillCD(f2, 3)
  330. end
  331. end)
  332. end,
  333. --造成[a]%的[b]伤害,有[c]%的概率追加伤害,最多可追加[d]次。(0无限追加)
  334. --a[float],b[伤害类型],c[float],d[int]
  335. [19] = function(caster, target, args, interval, skill)
  336. local f1 = args[1]
  337. local dt = args[2]
  338. local f2 = args[3]
  339. local i1 = args[4]
  340. if i1 == 0 then
  341. i1 = floor(interval*BattleLogic.GameFrameRate)
  342. end
  343. local count = 1
  344. while Random.Range01() <= f2 and count <= i1 do
  345. count = count + 1
  346. end
  347. local d = interval / count
  348. for i=1, count do
  349. BattleLogic.WaitForTrigger(d * (i-1), function ()
  350. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
  351. BattleLogic.WaitForTrigger(d, function ()
  352. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  353. end)
  354. end)
  355. end
  356. end,
  357. --造成[a]%的[b]伤害,对[c]造成额外[d]%伤害
  358. --a[float],b[伤害类型,]c[控制状态],d[float]
  359. [20] = function(caster, target, args, interval, skill)
  360. local f1 = args[1]
  361. local dt = args[2]
  362. local i1 = args[3]
  363. local f2 = args[4]
  364. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  365. BattleLogic.WaitForTrigger(interval, function ()
  366. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return i1 == 0 or buff.ctrlType == i1 end) then
  367. f1 = f1*(1+f2)
  368. end
  369. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  370. end)
  371. end,
  372. --造成[a]%的[b]伤害,对[c]有[d]%造成[e],持续[f]秒【AOE】
  373. --a[float],b[伤害类型,]c[持续伤害状态],d[float],e[控制状态],f[int]
  374. [21] = function(caster, target, args, interval, skill)
  375. local f1 = args[1]
  376. local dt = args[2]
  377. local dot = args[3]
  378. local f2 = args[4]
  379. local ct = args[5]
  380. local f3 = args[6]
  381. BattleLogic.WaitForTrigger(interval, function ()
  382. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  383. if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
  384. BattleUtil.RandomControl(f1, ct, caster, target, f3)
  385. end
  386. end)
  387. end,
  388. --造成[a]%的[b]伤害,对[c]造成额外[d]%伤害【AOE】
  389. --a[float],b[伤害类型,]c[持续伤害状态],d[float]
  390. [22] = function(caster, target, args, interval, skill)
  391. local f1 = args[1]
  392. local dt = args[2]
  393. local dot = args[3]
  394. local f2 = args[4]
  395. BattleLogic.WaitForTrigger(interval, function ()
  396. if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
  397. f1 = f1*(1+f2)
  398. end
  399. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  400. end)
  401. end,
  402. --造成[a]%的[b]伤害,对[c]造成额外[d]%伤害
  403. --a[float],b[伤害类型,]c[持续回复状态],d[float]
  404. [23] = function(caster, target, args, interval, skill)
  405. local f1 = args[1]
  406. local dt = args[2]
  407. local ht = args[3]
  408. local f2 = args[4]
  409. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  410. BattleLogic.WaitForTrigger(interval, function ()
  411. if BattleLogic.BuffMgr:HasBuff(target, BuffName.HOT, function (buff) return true end) then
  412. f1 = f1*(1+f2)
  413. end
  414. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  415. end)
  416. end,
  417. --瞬间恢复[a]*[b]%生命
  418. --a[属性],b[float]
  419. [24] = function(caster, target, args, interval, skill)
  420. local pro1 = args[1]
  421. local f1 = args[2]
  422. BattleLogic.WaitForTrigger(interval, function ()
  423. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
  424. BattleUtil.CalTreat(caster, target, val)
  425. end)
  426. end,
  427. --对[a]的伤害[b]%,持续[c]秒
  428. --a[持续伤害状态],b[float],c[int]
  429. [25] = function(caster, target, args, interval, skill)
  430. local dot = args[1]
  431. local f1 = args[2]
  432. local f2 = args[3]
  433. BattleLogic.WaitForTrigger(interval, function ()
  434. local trigger = function(defRole, damageFunc, damage)
  435. if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff)
  436. return dot == 0 or buff.damageType == dot
  437. end) then
  438. damage = damage + floor(damage * f1)
  439. end
  440. damageFunc(damage)
  441. end
  442. target.Event:AddEvent(BattleEventName.RoleBeDamagedAfter, trigger)
  443. if f2 > 0 then
  444. BattleLogic.WaitForTrigger(f2, function ()
  445. target.Event:RemoveEvent(BattleEventName.RoleBeDamagedAfter, trigger)
  446. end)
  447. end
  448. end)
  449. end,
  450. --造成[a]的伤害【AOE】(真实伤害)
  451. --a[int]
  452. [26] = function(caster, target, args, interval, skill)
  453. local d = args[1]
  454. BattleLogic.WaitForTrigger(interval, function ()
  455. if not target:IsRealDead() then
  456. BattleUtil.ApplyDamage(skill, caster, target, d)
  457. end
  458. end)
  459. end,
  460. --每秒造成[d]的伤害,持续[f]秒【AOE】(真实伤害)
  461. --d[float],f[int]
  462. [27] = function(caster, target, args, interval, skill)
  463. local d1 = args[1]
  464. local d2 = args[2]
  465. BattleLogic.WaitForTrigger(interval, function ()
  466. target:AddBuff(Buff.Create(caster, BuffName.DOT, d2, 1, 0, d1, 1))
  467. end)
  468. end,
  469. --造成[a]%的[b]伤害,对[c]造成额外[d]%伤害
  470. --a[float],b[伤害类型,]c[持续伤害状态],d[float]
  471. [28] = function(caster, target, args, interval, skill)
  472. local f1 = args[1]
  473. local dt = args[2]
  474. local dot = args[3]
  475. local f2 = args[4]
  476. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  477. BattleLogic.WaitForTrigger(interval, function ()
  478. if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
  479. f1 = f1*(1+f2)
  480. end
  481. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  482. end)
  483. end,
  484. --造成[a]到[b]次[c]%的[d]伤害,对[e]造成额外[f]%伤害
  485. --a[int],b[int],c[float],d[伤害类型],e[职业],f[float]
  486. [29] = function(caster, target, args, interval, skill)
  487. local i1 = args[1]
  488. local i2 = args[2]
  489. local f1 = args[3]
  490. local dt = args[4]
  491. local pt = args[5]
  492. local f2 = args[6]
  493. local count = Random.RangeInt(i1, i2)
  494. local d = interval / count
  495. for i=1, count do
  496. BattleLogic.WaitForTrigger(d * (i-1), function ()
  497. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
  498. BattleLogic.WaitForTrigger(d, function ()
  499. if target.roleData.professionId == pt then
  500. f1 = f1*(1+f2)
  501. end
  502. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  503. end)
  504. end)
  505. end
  506. end,
  507. --造成[a]%的[b]伤害,若为[c],则无视敌人[d]%的防御
  508. --a[float],b[伤害类型,]c[控制状态],d[float]
  509. [30] = function(caster, target, args, interval, skill)
  510. local f1 = args[1]
  511. local dt = args[2]
  512. local ct = args[3]
  513. local f2 = args[4]
  514. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  515. BattleLogic.WaitForTrigger(interval, function ()
  516. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return ct == 0 or buff.ctrlType == ct end) then
  517. BattleUtil.CalDamage(skill, caster, target, dt, f1, f2)
  518. else
  519. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  520. end
  521. end)
  522. end,
  523. --[a]%概率[b],持续[c]秒
  524. --a[float],b[免疫buff],c[int]
  525. [31] = function(caster, target, args, interval, skill)
  526. local f1 = args[1]
  527. local ib1 = args[2]
  528. local f2 = args[3]
  529. BattleLogic.WaitForTrigger(interval, function ()
  530. buffRandomAction(f1, target, Buff.Create(caster, BuffName.Immune, f2, ib1))
  531. end)
  532. end,
  533. --[b]%改变[d]重击技能CD[a]秒 ,持续[c]秒 (0代表清除所有)
  534. --a[float],b[float],c[改变类型]
  535. [32] = function(caster, target, args, interval, skill)
  536. local f1 = args[1]
  537. local f2 = args[2]
  538. local ct = args[3]
  539. local d = args[4]
  540. BattleLogic.WaitForTrigger(interval, function ()
  541. BattleUtil.RandomAction(f2, function ()
  542. target:AddSkillCD(f1, ct)
  543. local trigger = function(skill) --新增监听事件,在印记技能结束回调时移除(印记buff可覆盖旧buff)
  544. target:AddSkillCD(f1, ct)
  545. end
  546. target.Event:AddEvent(BattleEventName.SkillCast, trigger)
  547. target:AddBuff(Buff.Create(caster, BuffName.Brand, d, "cd", function ()
  548. target.Event:RemoveEvent(BattleEventName.SkillCast, trigger)
  549. end))
  550. end)
  551. end)
  552. end,
  553. --造成[a]%的[b]伤害,[c]%概率添加[d]的印记,该角色在攻击拥有印记的目标时,额外获得(印记层数*[e])的暴击伤害,印记最多叠加[f]层。(减益印记,不可驱散)
  554. --a[folat],b[伤害类型],c[float],d[角色id],e[float],f[float]
  555. [33] = function(caster, target, args, interval, skill)
  556. local f1 = args[1]
  557. local dt = args[2]
  558. local f2 = args[3]
  559. local rid = args[4]
  560. local f3 = args[5]
  561. local i1 = args[6]
  562. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  563. BattleLogic.WaitForTrigger(interval, function ()
  564. local layer
  565. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
  566. local b = buff.flag == rid
  567. if b then
  568. layer = buff.layer
  569. end
  570. return b
  571. end) then
  572. local OnPassiveCriting = function(crit)
  573. crit(layer * f3)
  574. end
  575. caster.Event:AddEvent(BattleEventName.PassiveCriting, OnPassiveCriting)
  576. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  577. caster.Event:RemoveEvent(BattleEventName.PassiveCriting, OnPassiveCriting)
  578. else
  579. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  580. end
  581. local brand = Buff.Create(caster, BuffName.Brand, 0, rid)
  582. brand.maxLayer = i1
  583. brand.clear = false
  584. brand.isDeBuff = true
  585. buffRandomAction(f2, target, brand)
  586. end)
  587. end,
  588. --对[a]职业,[e]改变目标的[b]属性[c]%,持续[d]秒
  589. --a[职业],b[属性],c[float],d[int],e[改变类型]
  590. [34] = function(caster, target, args, interval, skill)
  591. local pt = args[1]
  592. local pro1 = args[2]
  593. local f1 = args[3]
  594. local f2 = args[4]
  595. local ct = args[5]
  596. BattleLogic.WaitForTrigger(interval, function ()
  597. if target.roleData.professionId == pt then
  598. target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct))
  599. end
  600. end)
  601. end,
  602. --对[a]的伤害[b]%,持续[c]秒
  603. --a[控制状态],b[float],c[int]
  604. [35] = function(caster, target, args, interval, skill)
  605. local ct = args[1]
  606. local f1 = args[2]
  607. local f2 = args[3]
  608. BattleLogic.WaitForTrigger(interval, function ()
  609. local trigger = function(defRole, damageFunc, damage)
  610. if BattleLogic.BuffMgr:HasBuff(defRole, BuffName.Control, function (buff) return ct == 0 or buff.ctrlType == ct end) then
  611. damage = damage + floor(damage * f1)
  612. end
  613. damageFunc(damage)
  614. end
  615. target.Event:AddEvent(BattleEventName.RoleDamageAfter, trigger)
  616. if f2 > 0 then
  617. BattleLogic.WaitForTrigger(f2, function ()
  618. target.Event:RemoveEvent(BattleEventName.RoleDamageAfter, trigger)
  619. end)
  620. end
  621. end)
  622. end,
  623. --[d]改变[a]属性[b]%,最大叠加[c]层
  624. --a[属性],b[float],c[int],d[改变类型]
  625. [36] = function(caster, target, args, interval, skill)
  626. local pro1 = args[1]
  627. local f1 = args[2]
  628. local i1 = args[3]
  629. local ct = args[4]
  630. BattleLogic.WaitForTrigger(interval, function ()
  631. local changeBuff = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[pro1], f1, ct)
  632. changeBuff.cover = true
  633. changeBuff.maxLayer = i1
  634. target:AddBuff(changeBuff)
  635. end)
  636. end,
  637. --清除[a]状态
  638. --a[控制状态]
  639. [37] = function(caster, target, args, interval, skill)
  640. local ct = args[1]
  641. BattleLogic.WaitForTrigger(interval, function ()
  642. BattleLogic.BuffMgr:ClearBuff(target, function (buff)
  643. return buff.type == BuffName.Control and (ct == 0 or buff.ctrlType == ct)
  644. end)
  645. end)
  646. end,
  647. --造成[a]的伤害(真实伤害)
  648. --a[int]
  649. [38] = function(caster, target, args, interval, skill)
  650. local d = args[1]
  651. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  652. BattleLogic.WaitForTrigger(interval, function ()
  653. if not target:IsRealDead() then
  654. BattleUtil.ApplyDamage(skill, caster, target, d)
  655. end
  656. end)
  657. end,
  658. --每秒造成[d]的伤害,持续[f]秒(真实伤害)
  659. --d[float],f[int]
  660. [39] = function(caster, target, args, interval, skill)
  661. local d1 = args[1]
  662. local d2 = args[2]
  663. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  664. BattleLogic.WaitForTrigger(interval, function ()
  665. local dot = Buff.Create(caster, BuffName.DOT, d2, 1, 0, d1, 1)
  666. dot.isRealDamage = true
  667. target:AddBuff(dot)
  668. end)
  669. end,
  670. --添加[a]的伤害吸收护盾,持续[b]秒,盾消失的时候反射吸收伤害的[c]%
  671. --a[int],b[int],c[float]
  672. [40] = function(caster, target, args, interval, skill)
  673. local f1 = args[1]
  674. local f2 = args[2]
  675. local f3 = args[3]
  676. BattleLogic.WaitForTrigger(interval, function ()
  677. target:AddBuff(Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, f1, f3))
  678. end)
  679. end,
  680. --造成[a]%的[b]伤害,同时有[c]%的概率对该敌人造成[d]%的伤害,若该技能造成击杀,则有[e]%的概率清除自身CD
  681. --a[folat],b[伤害类型],c[float],d[float],e[float]
  682. [41] = function(caster, target, args, interval, skill)
  683. local f1 = args[1]
  684. local dt = args[2]
  685. local f2 = args[3]
  686. local f3 = args[4]
  687. local f4 = args[5]
  688. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  689. BattleLogic.WaitForTrigger(interval, function ()
  690. BattleUtil.RandomAction(f2, function ()
  691. f1 = f1 + f3
  692. end)
  693. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  694. if target:IsDead() then
  695. BattleUtil.RandomAction(f4, function ()
  696. caster:AddSkillCD(0)
  697. end)
  698. end
  699. end)
  700. end,
  701. --进入虚弱状态,有[a]%的概率受到额外[b]%的伤害,状态持续[c]秒
  702. --a[folat],b[float],c[int]
  703. [42] = function(caster, target, args, interval, skill)
  704. local f1 = args[1]
  705. local f2 = args[2]
  706. local f3 = args[3]
  707. BattleLogic.WaitForTrigger(interval, function ()
  708. local brand = Buff.Create(caster, BuffName.Brand, f3, "weak")
  709. brand.exDmg = f2
  710. brand.coverFunc = function (oldBuff)
  711. brand.exDmg = brand.exDmg + (oldBuff.exDmg or 0)
  712. end
  713. local trigger = function(atkRole, damagingFunc, damageType)
  714. BattleUtil.RandomAction(f1, function()
  715. damagingFunc(brand.exDmg)
  716. end)
  717. end
  718. target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
  719. brand.endFunc = function()
  720. brand.exDmg = nil
  721. target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
  722. end
  723. target:AddBuff(brand)
  724. end)
  725. end,
  726. --瞬间恢复[a]的生命
  727. --a[int]
  728. [43] = function(caster, target, args, interval, skill)
  729. local i1 = args[1]
  730. BattleLogic.WaitForTrigger(interval, function ()
  731. BattleUtil.CalTreat(caster, target, i1)
  732. end)
  733. end,
  734. --造成[a]%的[b]伤害,计算伤害时额外计算[c]%的[d][e]和[f]%的[g][h]
  735. --a[float],b[伤害类型],c[float],d[属性],e[改变类型],f[float],g[属性],h[改变类型]
  736. [44] = function(caster, target, args, interval, skill)
  737. local f1 = args[1]
  738. local dt = args[2]
  739. local f2 = args[3]
  740. local pro1 = args[4]
  741. local ct1 = args[5]
  742. local f3 = args[6]
  743. local pro2 = args[7]
  744. local ct2 = args[8]
  745. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  746. BattleLogic.WaitForTrigger(interval, function ()
  747. local proTran1 = {proName = BattlePropList[pro1], tranProName = BattlePropList[pro1], tranFactor = f2, changeType = ct1}
  748. local proTran2 = {proName = BattlePropList[pro2], tranProName = BattlePropList[pro2], tranFactor = f3, changeType = ct2}
  749. caster.proTranList:Add(proTran1)
  750. caster.proTranList:Add(proTran2)
  751. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  752. caster.proTranList:Remove(caster.proTranList.size)
  753. caster.proTranList:Remove(caster.proTranList.size)
  754. end)
  755. end,
  756. --[e][a]%概率改变[b]属性[c]%,持续[d]秒
  757. --a[float],b[属性],c[float],d[int],e[改变类型]
  758. [45] = function(caster, target, args, interval, skill)
  759. local f3 = args[1]
  760. local pro1 = args[2]
  761. local f1 = args[3]
  762. local f2 = args[4]
  763. local ct = args[5]
  764. BattleLogic.WaitForTrigger(interval, function ()
  765. buffRandomAction(f3, target, Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct))
  766. end)
  767. end,
  768. --造成[a]%的[b]伤害,如果击杀,则永久增加[c]%的[d],最大[e]层(0为无限)
  769. --a[float],b[伤害类型],c[float],d[属性],e[int]
  770. [46] = function(caster, target, args, interval, skill)
  771. local f1 = args[1]
  772. local dt = args[2]
  773. local f2 = args[3]
  774. local pro1 = args[4]
  775. local i1 = args[5]
  776. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  777. BattleLogic.WaitForTrigger(interval, function ()
  778. local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
  779. if target:IsDead() then
  780. local buff = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[pro1], f2, 2)
  781. buff.cover = true
  782. buff.maxLayer = i1
  783. caster:AddBuff(buff)
  784. end
  785. end)
  786. end,
  787. --造成[a]%的[b]伤害,若为[c],则无视[d]%的防御,并造成额外[e]%伤害
  788. --a[float],b[伤害类型,]c[职业],d[float],e[float]
  789. [47] = function(caster, target, args, interval, skill)
  790. local f1 = args[1]
  791. local dt = args[2]
  792. local pt = args[3]
  793. local f2 = args[4]
  794. local f3 = args[5]
  795. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  796. BattleLogic.WaitForTrigger(interval, function ()
  797. if target.roleData.professionId == pt then
  798. BattleUtil.CalDamage(skill, caster, target, dt, f1*(1+f3), f2)
  799. else
  800. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  801. end
  802. end)
  803. end,
  804. --造成[a]*[b]%的伤害(真实伤害)(目标最大生命值伤害总上限为施法者2.5倍攻击)
  805. --a[属性],b[float]
  806. [48] = function(caster, target, args, interval, skill)
  807. local pro = args[1]
  808. local d = args[2]
  809. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  810. BattleLogic.WaitForTrigger(interval, function ()
  811. local v1 = BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro]), d)
  812. local v2 = BattleUtil.FP_Mul(caster:GetRoleData(RoleDataName.Attack), 2.5)
  813. BattleUtil.ApplyDamage(skill, caster, target, floor(min(v1, v2)))
  814. end)
  815. end,
  816. --造成[a]%的[b]伤害,提升自身下个技能[c]%的伤害
  817. --a[float],b[伤害类型],c[float]
  818. [49] = function(caster, target, args, interval, skill)
  819. local f1 = args[1]
  820. local dt = args[2]
  821. local f2 = args[3]
  822. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  823. BattleLogic.WaitForTrigger(interval, function ()
  824. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  825. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  826. damagingFunc(-floor(f2 * damage))
  827. end
  828. local OnSkillCast, OnSkillCastEnd
  829. OnSkillCast = function(skill)
  830. caster.Event:RemoveEvent(BattleEventName.SkillCast, OnSkillCast)
  831. caster.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
  832. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  833. end
  834. OnSkillCastEnd = function(skill)
  835. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,防止触发帧和结束帧为同一帧时,被动未移除
  836. caster.Event:RemoveEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
  837. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  838. end)
  839. end
  840. caster.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
  841. end)
  842. end,
  843. --造成[a]%的[b]伤害【AOE】,如果目标受到此次伤害前,生命低于最大生命[c]%,则直接击杀(击杀值不超过攻击者10倍攻击)。
  844. --a[float],b[伤害类型],c[float]
  845. [50] = function(caster, target, args, interval, skill)
  846. local f1 = args[1]
  847. local dt = args[2]
  848. local f2 = args[3]
  849. BattleLogic.WaitForTrigger(interval, function ()
  850. if BattleUtil.GetHPPencent(target) < f2 then
  851. BattleUtil.ApplyDamage(skill, caster, target, min(target:GetRoleData(RoleDataName.Hp), caster:GetRoleData(RoleDataName.Attack)*10))
  852. else
  853. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  854. end
  855. end)
  856. end,
  857. --增加[c]层缚灵印记,每层使受到的伤害增加[d],减少[e]%的受治疗效果,最大[f]层(0为无限)(减益印记,不可驱散)
  858. --c[int],d[float],e[float],f[int]
  859. [51] = function(caster, target, args, interval, skill)
  860. local i1 = args[1]
  861. local f2 = args[2]
  862. local f3 = args[3]
  863. local i2 = args[4]
  864. local flag = "fuling"..caster.uid
  865. BattleLogic.WaitForTrigger(interval, function ()
  866. for i=1, i1 do
  867. local brand = Buff.Create(caster, BuffName.Brand, 0, flag)
  868. brand.exDmg = f2
  869. brand.exHeal = f3
  870. brand.maxLayer = i2
  871. brand.clear = false
  872. brand.isDeBuff = true
  873. brand.coverFunc = function (oldBuff)
  874. if i2 == 0 or oldBuff.layer < i2 then
  875. brand.exDmg = brand.exDmg + (oldBuff.exDmg or 0)
  876. brand.exHeal = brand.exHeal + (oldBuff.exHeal or 0)
  877. else
  878. brand.exDmg = (oldBuff.exDmg or 0)
  879. brand.exHeal = (oldBuff.exHeal or 0)
  880. end
  881. end
  882. local trigger = function(atkRole, damagingFunc, damageType)
  883. damagingFunc(brand.exDmg)
  884. end
  885. local OnPassiveBeTreated = function(treatingFunc)
  886. treatingFunc(-brand.exHeal)
  887. end
  888. target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
  889. target.Event:AddEvent(BattleEventName.PassiveBeTreated, OnPassiveBeTreated)
  890. brand.endFunc = function ()
  891. brand.exDmg = nil
  892. brand.exHeal = nil
  893. target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
  894. target.Event:RemoveEvent(BattleEventName.PassiveBeTreated, OnPassiveBeTreated)
  895. end
  896. target:AddBuff(brand)
  897. end
  898. end)
  899. end,
  900. --造成[a]%的[b]伤害,引爆目标身上所有缚灵印记,每层造成攻击*[c]的真实伤害。
  901. --a[float],b[伤害类型],c[float]
  902. [52] = function(caster, target, args, interval, skill)
  903. local f1 = args[1]
  904. local dt = args[2]
  905. local f2 = args[3]
  906. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  907. local flag = "fuling"..caster.uid
  908. BattleLogic.WaitForTrigger(interval, function ()
  909. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  910. local layer, brandBuff
  911. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
  912. local b = buff.flag == flag
  913. if b then
  914. layer = buff.layer
  915. brandBuff = buff
  916. end
  917. return b
  918. end) then
  919. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(RoleDataName.Attack), f2, layer))
  920. BattleUtil.ApplyDamage(skill, caster, target, val)
  921. brandBuff.disperse = true
  922. if brandBuff.linkBuff1 then
  923. brandBuff.linkBuff1.disperse = true
  924. end
  925. if brandBuff.linkBuff2 then
  926. brandBuff.linkBuff2.disperse = true
  927. end
  928. end
  929. end)
  930. end,
  931. --若目标生命低于最大生命的[a]%,则有[b]%概率[c],持续[d]秒
  932. --a[float],b[float],c[控制状态],d[int]
  933. [53] = function(caster, target, args, interval, skill)
  934. local f1 = args[1]
  935. local f2 = args[2]
  936. local ct = args[3]
  937. local f3 = args[4]
  938. BattleLogic.WaitForTrigger(interval, function ()
  939. if BattleUtil.GetHPPencent(target) < f1 then
  940. BattleUtil.RandomControl(f2, ct, caster, target, f3)
  941. end
  942. end)
  943. end,
  944. --[e]改变[a]属性*[b]%的[c],持续[d]秒
  945. --a[属性],b[float],c[属性],d[int],e[改变类型]
  946. [54] = function(caster, target, args, interval, skill)
  947. local pro1 = args[1]
  948. local f1 = args[2]
  949. local pro2 = args[3]
  950. local f2 = args[4]
  951. local ct = args[5]
  952. BattleLogic.WaitForTrigger(interval, function ()
  953. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1], f1)))
  954. target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro2], val, ct))
  955. end)
  956. end,
  957. --清除[a]状态
  958. --a[清除状态]
  959. [55] = function(caster, target, args, interval, skill)
  960. local ct = args[1]
  961. BattleLogic.WaitForTrigger(interval, function ()
  962. BattleLogic.BuffMgr:ClearBuff(target, function (buff)
  963. return clearBuffPredicate(buff, ct)
  964. end)
  965. end)
  966. end,
  967. --造成目标当前生命[a]%的真实伤害,为我方角色回复此技能所有由此效果带来的伤害,平均分配给我方生命最低的[b]个角色。
  968. --a[float],b[int]
  969. [56] = function(caster, target, args, interval, skill)
  970. local f1 = args[1]
  971. local i1 = args[2]
  972. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  973. BattleLogic.WaitForTrigger(interval, function ()
  974. local val = floor(BattleUtil.FP_Mul(target:GetRoleData(RoleDataName.Hp), f1))
  975. local damage = BattleUtil.ApplyDamage(skill, caster, target, val)
  976. local arr = BattleUtil.ChooseTarget(caster, 10110)
  977. local count = min(#arr, i1)
  978. local heal = floor(damage / count)
  979. for i=1, count do
  980. BattleUtil.CalTreat(caster, arr[i], heal)
  981. end
  982. end)
  983. end,
  984. --造成[a]%的[b]伤害,若目标血量低于最大生命值的[c]%,则必定暴击。
  985. --a[float],b[伤害类型],c[float]
  986. [57] = function(caster, target, args, interval, skill)
  987. local f1 = args[1]
  988. local dt = args[2]
  989. local f2 = args[3]
  990. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  991. BattleLogic.WaitForTrigger(interval, function ()
  992. if BattleUtil.GetHPPencent(target) < f2 then
  993. target.isFlagCrit = true
  994. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  995. target.isFlagCrit = false
  996. else
  997. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  998. end
  999. end)
  1000. end,
  1001. --造成[a]%的[b]伤害,计算伤害时无视目标[c]%的[d]。
  1002. --a[float],b[伤害类型],c[float],d[属性]
  1003. [58] = function(caster, target, args, interval, skill)
  1004. local f1 = args[1]
  1005. local dt = args[2]
  1006. local f2 = args[3]
  1007. local pro1 = args[4]
  1008. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1009. BattleLogic.WaitForTrigger(interval, function ()
  1010. local proTran1 = {proName = BattlePropList[pro1], tranProName = BattlePropList[pro1], tranFactor = f2, changeType = 4}
  1011. target.proTranList:Add(proTran1)
  1012. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1013. target.proTranList:Remove(target.proTranList.size)
  1014. end)
  1015. end,
  1016. --造成[a]次[b]%的[c]伤害,每段攻击随机选择敌方目标。
  1017. --a[int],b[float],c[伤害类型]
  1018. [59] = function(caster, target, args, interval, skill)
  1019. local i1 = args[1]
  1020. local f1 = args[2]
  1021. local dt = args[3]
  1022. local d = interval / i1
  1023. for i=1, i1 do
  1024. BattleLogic.WaitForTrigger(d * (i-1), function ()
  1025. local arr = BattleUtil.ChooseTarget(caster, 20001)
  1026. if arr[1] then
  1027. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, arr[1], d)
  1028. BattleLogic.WaitForTrigger(d, function ()
  1029. BattleUtil.CalDamage(skill, caster, arr[1], dt, f1)
  1030. end)
  1031. end
  1032. end)
  1033. end
  1034. end,
  1035. --施加印记,拥有印记的角色受到暴击攻击后会[b]改变[a]秒技能cd,印记持续[c]秒。(专属印记,属于增益)
  1036. --a[int],b[float]c[int]
  1037. [60] = function(caster, target, args, interval, skill)
  1038. local f1 = args[1]
  1039. local ct = args[2]
  1040. local f2 = args[3]
  1041. BattleLogic.WaitForTrigger(interval, function ()
  1042. local trigger = function(atkRole, damage, bCrit, finalDmg, damageType) --新增监听事件,在印记技能结束回调时移除(印记buff可覆盖旧buff)
  1043. target:AddSkillCD(f1, ct)
  1044. end
  1045. target.Event:AddEvent(BattleEventName.RoleBeCrit, trigger)
  1046. local buff = Buff.Create(caster, BuffName.Brand, f2, "crit", function ()
  1047. target.Event:RemoveEvent(BattleEventName.RoleBeCrit, trigger)
  1048. end)
  1049. buff.isBuff = true
  1050. target:AddBuff(buff)
  1051. end)
  1052. end,
  1053. --消耗自身[a]%的当前生命值,为我方生命百分比最低的角色造成[b]%最大生命值的治疗。若目标为施法者,则不消耗生命。
  1054. --a[float],b[float]
  1055. [61] = function(caster, target, args, interval, skill)
  1056. local f1 = args[1]
  1057. local f2 = args[2]
  1058. BattleLogic.WaitForTrigger(interval, function ()
  1059. local arr = BattleUtil.ChooseTarget(caster, 10210)
  1060. if arr[1] then
  1061. if arr[1] ~= caster then
  1062. caster.data:SubValue(RoleDataName.Hp, floor(caster:GetRoleData(RoleDataName.Hp) * f1))
  1063. end
  1064. BattleUtil.CalTreat(caster, arr[1], floor(caster:GetRoleData(RoleDataName.MaxHp) * f2))
  1065. end
  1066. end)
  1067. end,
  1068. --造成[a]到[b]段[c]%的[d]伤害,若任意一段攻击前目标已死亡,则目标变为敌方生命最低的角色,继续造成后续伤害。
  1069. --a[int],b[int],c[float],d[伤害类型]
  1070. [62] = function(caster, target, args, interval, skill)
  1071. local i1 = args[1]
  1072. local i2 = args[2]
  1073. local f1 = args[3]
  1074. local dt = args[4]
  1075. local count = Random.RangeInt(i1, i2)
  1076. local d = interval / count
  1077. local delayDmgTrigger
  1078. delayDmgTrigger = function(less, d)
  1079. if less > 0 then
  1080. local role = target:IsRealDead() and BattleUtil.ChooseTarget(caster, 20110)[1] or target
  1081. if role then
  1082. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, role, d)
  1083. BattleLogic.WaitForTrigger(d, function ()
  1084. BattleUtil.CalDamage(skill, caster, role, dt, f1)
  1085. delayDmgTrigger(less-1, d)
  1086. end)
  1087. end
  1088. end
  1089. end
  1090. delayDmgTrigger(count, d)
  1091. end,
  1092. --造成[a]%的[b]伤害,若造成击杀,[c]的概率立即发动一次上滑技。
  1093. --a[float],b[伤害类型],c[float]
  1094. [63] = function(caster, target, args, interval, skill)
  1095. local f1 = args[1]
  1096. local dt = args[2]
  1097. local f2 = args[3]
  1098. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1099. BattleLogic.WaitForTrigger(interval, function ()
  1100. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1101. if target:IsDead() then
  1102. -- BattleUtil.RandomAction(f2, function ()
  1103. -- if caster.superSkill then
  1104. -- caster.superSkill:Cast()
  1105. -- end
  1106. -- end)
  1107. end
  1108. end)
  1109. end,
  1110. --造成[a]%的[b]伤害,自身每种/每层增益状态会提高此技能[c]%的伤害。【aoe】
  1111. --a[float],b[伤害类型],c[float]
  1112. [64] = function(caster, target, args, interval, skill)
  1113. local f1 = args[1]
  1114. local dt = args[2]
  1115. local f2 = args[3]
  1116. BattleLogic.WaitForTrigger(interval, function ()
  1117. local factor = 0
  1118. BattleLogic.BuffMgr:QueryBuff(caster, function (buff)
  1119. if buff.isBuff then
  1120. if buff.layer then
  1121. factor = factor + buff.layer
  1122. else
  1123. factor = factor + 1
  1124. end
  1125. end
  1126. end)
  1127. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  1128. damagingFunc(-floor(BattleUtil.FP_Mul(f2, factor, damage)))
  1129. end
  1130. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1131. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1132. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1133. end)
  1134. end,
  1135. --造成[a]%的[b]伤害,[c]的概率造成眩晕,持续[d]秒。若未造成眩晕,则为目标施加增伤印记。最大[e]层(减益印记,不可驱散)
  1136. --a[float],b[伤害类型],c[float],d[int],e[int]
  1137. [65] = function(caster, target, args, interval, skill)
  1138. local f1 = args[1]
  1139. local dt = args[2]
  1140. local f2 = args[3]
  1141. local f3 = args[4]
  1142. local i1 = args[5]
  1143. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1144. BattleLogic.WaitForTrigger(interval, function ()
  1145. -- 伤害
  1146. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1147. -- 控制未命中则施加增伤印记
  1148. if not BattleUtil.RandomControl(f2, 1, caster, target, f3) then
  1149. local brand = Buff.Create(caster, BuffName.Brand, 0, "zengshang")
  1150. brand.maxLayer = i1
  1151. brand.clear = false
  1152. brand.isDeBuff = true
  1153. target:AddBuff(brand)
  1154. end
  1155. -- if Random.Range01() <= f2 then
  1156. -- target:AddBuff(Buff.Create(caster, BuffName.Control, f3, 1))
  1157. -- else
  1158. -- local brand = Buff.Create(caster, BuffName.Brand, 0, "zengshang")
  1159. -- brand.maxLayer = i1
  1160. -- brand.clear = false
  1161. -- brand.isDeBuff = true
  1162. -- target:AddBuff(brand)
  1163. -- end
  1164. end)
  1165. end,
  1166. --造成[a]%的[b]伤害,[c]的概率附加一层增伤印记,最大[d]层。目标身上每层印记增加此技能[e]%的伤害。(减益印记,不可驱散)
  1167. --a[float],b[伤害类型],c[float],d[int],e[float]
  1168. [66] = function(caster, target, args, interval, skill)
  1169. local f1 = args[1]
  1170. local dt = args[2]
  1171. local f2 = args[3]
  1172. local i1 = args[4]
  1173. local f3 = args[5]
  1174. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1175. BattleLogic.WaitForTrigger(interval, function ()
  1176. local brand = Buff.Create(caster, BuffName.Brand, 0, "zengshang")
  1177. brand.maxLayer = i1
  1178. brand.clear = false
  1179. brand.isDeBuff = true
  1180. buffRandomAction(f2, target, brand)
  1181. local layer = 0
  1182. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
  1183. local b = buff.flag == "zengshang"
  1184. if b then
  1185. layer = buff.layer
  1186. end
  1187. return b
  1188. end) then
  1189. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  1190. damagingFunc(-floor(BattleUtil.FP_Mul(f3, layer, damage)))
  1191. end
  1192. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1193. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1194. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1195. else
  1196. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1197. end
  1198. end)
  1199. end,
  1200. --造成[a]到[b]段[c]%的[d]伤害,每段伤害有[e]的概率改变[g]目标[f]秒技能cd。
  1201. --a[int],b[int],c[float],d[伤害类型],e[float],f[float],g[改变类型]
  1202. [67] = function(caster, target, args, interval, skill)
  1203. local i1 = args[1]
  1204. local i2 = args[2]
  1205. local f1 = args[3]
  1206. local dt = args[4]
  1207. local f2 = args[5]
  1208. local f3 = args[6]
  1209. local ct = args[7]
  1210. local count = Random.RangeInt(i1, i2)
  1211. local d = interval / count
  1212. for i=1, count do
  1213. BattleLogic.WaitForTrigger(d * (i-1), function ()
  1214. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
  1215. BattleLogic.WaitForTrigger(d, function ()
  1216. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1217. BattleUtil.RandomAction(f2, function ()
  1218. target:AddSkillCD(f3, ct)
  1219. end)
  1220. end)
  1221. end)
  1222. end
  1223. end,
  1224. --造成[a]%的[b]伤害,附带持续伤害,每秒造成自身最大生命值[c]%的真实伤害,持续[d]秒。【aoe】
  1225. --a[float],b[伤害类型],c[float],d[int]
  1226. [68] = function(caster, target, args, interval, skill)
  1227. local f1 = args[1]
  1228. local dt = args[2]
  1229. local f2 = args[3]
  1230. local f3 = args[4]
  1231. BattleLogic.WaitForTrigger(interval, function ()
  1232. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1233. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(RoleDataName.MaxHp), f2))
  1234. local dot = Buff.Create(caster, BuffName.DOT, f3, 1, 0, val, 1)
  1235. dot.isRealDamage = true
  1236. target:AddBuff(dot)
  1237. end)
  1238. end,
  1239. --损失自身[c]%的[d]的生命。
  1240. --c[float],d[属性]
  1241. [69] = function(caster, target, args, interval, skill)
  1242. local f1 = args[1]
  1243. local pro1 = args[2]
  1244. BattleLogic.WaitForTrigger(interval, function ()
  1245. local hp = min(floor(BattleUtil.FP_Mul(target:GetRoleData(BattlePropList[pro1]), f1)), target:GetRoleData(RoleDataName.Hp)-1)
  1246. target.data:SubValue(RoleDataName.Hp, hp)
  1247. end)
  1248. end,
  1249. --造成[a]%的[b]伤害,每损失[c]%的生命,增加本技能[d]%的伤害。【aoe】
  1250. --a[float],b[伤害类型],c[float],d[float]
  1251. [70] = function(caster, target, args, interval, skill)
  1252. local f1 = args[1]
  1253. local dt = args[2]
  1254. local f2 = args[3]
  1255. BattleLogic.WaitForTrigger(interval, function ()
  1256. local factor = 1 - BattleUtil.GetHPPencent(caster)
  1257. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  1258. damagingFunc(-floor(BattleUtil.FP_Mul(f2, factor, damage)))
  1259. end
  1260. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1261. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1262. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1263. end)
  1264. end,
  1265. --造成[a]到[b]段[c]%的[d]伤害,每段伤害有[e]的概率造成[f],持续[g]秒。若目标处于[h]状态,则必定暴击。
  1266. --a[int],b[int],c[float],d[伤害类型],e[float],f[控制状态],g[int],h[控制状态]
  1267. [71] = function(caster, target, args, interval, skill)
  1268. local i1 = args[1]
  1269. local i2 = args[2]
  1270. local f1 = args[3]
  1271. local dt = args[4]
  1272. local f2 = args[5]
  1273. local c1 = args[6]
  1274. local f4 = args[7]
  1275. local c2 = args[8]
  1276. local count = Random.RangeInt(i1, i2)
  1277. local d = interval / count
  1278. for i=1, count do
  1279. BattleLogic.WaitForTrigger(d * (i-1), function ()
  1280. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target, d)
  1281. BattleLogic.WaitForTrigger(d, function ()
  1282. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return c2 == 0 or buff.ctrlType == c2 end) then
  1283. target.isFlagCrit = true
  1284. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1285. target.isFlagCrit = false
  1286. else
  1287. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1288. end
  1289. BattleUtil.RandomControl(f2, c1, caster, target, f4)
  1290. end)
  1291. end)
  1292. end
  1293. end,
  1294. --[b]概率造成[c],每秒造成[d]的[e]的伤害,持续[f]秒(属于减益)
  1295. --b[float],c[持续伤害状态].d[float],e[伤害类型],f[int]
  1296. [72] = function(caster, target, args, interval, skill)
  1297. local f3 = args[1]
  1298. local d1 = args[2]
  1299. local f1 = args[3]
  1300. local dt = args[4]
  1301. local f2 = args[5]
  1302. BattleLogic.WaitForTrigger(interval, function ()
  1303. buffRandomAction(f3, target, Buff.Create(caster, BuffName.DOT, f2, 1, d1, dt, f1))
  1304. end)
  1305. end,
  1306. --造成[a]%的[b]伤害,立即结算目标身上所有dot的剩余伤害。【aoe】
  1307. --a[float],b[伤害类型]
  1308. [73] = function(caster, target, args, interval, skill)
  1309. local f1 = args[1]
  1310. local dt = args[2]
  1311. BattleLogic.WaitForTrigger(interval, function ()
  1312. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1313. BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff)
  1314. if buff.duration > 0 and buff.roundInterval > 0 then
  1315. local remainFrame = buff.roundDuration - buff.roundPass
  1316. local remainCount = floor(remainFrame / buff.roundInterval)+1
  1317. buff.disperse = true
  1318. if buff.caster and not buff.caster.isTeam then
  1319. local trigger = function(defRole, damageFunc, damage) damageFunc(damage * remainCount) end
  1320. buff.caster.Event:AddEvent(BattleEventName.RoleDamageAfter, trigger)
  1321. BattleUtil.CalDamage(skill, buff.caster, buff.target, buff.damagePro, buff.damageFactor,0, buff.damageType)
  1322. buff.caster.Event:RemoveEvent(BattleEventName.RoleDamageAfter, trigger)
  1323. end
  1324. end
  1325. return true
  1326. end)
  1327. end)
  1328. end,
  1329. --[a]概率瞬间恢复[b]*[c]%生命
  1330. --a[float],b[属性],c[float]
  1331. [74] = function(caster, target, args, interval, skill)
  1332. local f2 = args[1]
  1333. local pro1 = args[2]
  1334. local f1 = args[3]
  1335. BattleLogic.WaitForTrigger(interval, function ()
  1336. BattleUtil.RandomAction(f2, function ()
  1337. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
  1338. BattleUtil.CalTreat(caster, target, val)
  1339. end)
  1340. end)
  1341. end,
  1342. --造成[a]%的[b]伤害,计算伤害时额外计算[c]%的[d][e],若该技能造成击杀,则有[f]%的概率清除自身CD
  1343. --a[float],b[伤害类型],c[float],d[属性],e[改变类型],f[float]
  1344. [75] = function(caster, target, args, interval, skill)
  1345. local f1 = args[1]
  1346. local dt = args[2]
  1347. local f2 = args[3]
  1348. local pro1 = args[4]
  1349. local ct = args[5]
  1350. local f3 = args[6]
  1351. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1352. BattleLogic.WaitForTrigger(interval, function ()
  1353. local proTran = {proName = BattlePropList[pro1], tranProName = BattlePropList[pro1], tranFactor = f2, changeType = ct}
  1354. caster.proTranList:Add(proTran)
  1355. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1356. caster.proTranList:Remove(caster.proTranList.size)
  1357. if target:IsDead() then
  1358. BattleUtil.RandomAction(f3, function ()
  1359. caster:AddSkillCD(0)
  1360. end)
  1361. end
  1362. end)
  1363. end,
  1364. --造成[a]%的[b]伤害,对拥有护盾的敌人额外造成[c]%伤害。
  1365. --a[float],b[伤害类型],c[float]
  1366. [76] = function(caster, target, args, interval, skill)
  1367. local f1 = args[1]
  1368. local dt = args[2]
  1369. local f2 = args[3]
  1370. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1371. BattleLogic.WaitForTrigger(interval, function ()
  1372. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Shield, function (buff) return true end) then
  1373. f1 = f1*(1+f2)
  1374. end
  1375. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1376. end)
  1377. end,
  1378. --[a]%概率对敌方全体造成[b],持续[c]秒,对技能目标概率上升[d]。
  1379. --a[float],b[控制状态],c[int],d[float]
  1380. [77] = function(caster, target, args, interval, skill)
  1381. local f1 = args[1]
  1382. local cb1 = args[2]
  1383. local f2 = args[3]
  1384. local f3 = args[4]
  1385. BattleLogic.WaitForTrigger(interval, function ()
  1386. local arr = BattleUtil.ChooseTarget(caster, 20000)
  1387. for i=1, #arr do
  1388. if arr[i] == target then
  1389. BattleUtil.RandomControl(f1+f3, cb1, caster, arr[i], f2)
  1390. else
  1391. BattleUtil.RandomControl(f1, cb1, caster, arr[i], f2)
  1392. end
  1393. end
  1394. end)
  1395. end,
  1396. --造成[a]%的[b]伤害,挂控制印记,最大[c]层。若暴击,[d]概率为敌方随机其他1人挂控制印记。(减益印记,可以驱散)
  1397. --a[float],b[伤害类型],c[int],d[float]
  1398. [78] = function(caster, target, args, interval, skill)
  1399. local f1 = args[1]
  1400. local dt = args[2]
  1401. local i1 = args[3]
  1402. local f2 = args[4]
  1403. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1404. BattleLogic.WaitForTrigger(interval, function ()
  1405. local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1406. local brand = Buff.Create(caster, BuffName.Brand, 0, "kongzhi")
  1407. brand.maxLayer = i1
  1408. brand.isDeBuff = true
  1409. target:AddBuff(brand)
  1410. if crit then
  1411. local arr = BattleUtil.ChooseTarget(caster, 20001)
  1412. local other
  1413. if arr[1] then
  1414. if arr[1] == target and arr[2] then
  1415. other = arr[2]
  1416. else
  1417. other = arr[1]
  1418. end
  1419. end
  1420. if other then
  1421. local brand2 = Buff.Create(caster, BuffName.Brand, 0, "kongzhi")
  1422. brand2.maxLayer = i1
  1423. brand2.isDeBuff = true
  1424. buffRandomAction(f2, other, brand2)
  1425. end
  1426. end
  1427. end)
  1428. end,
  1429. --[a]%概率[b],持续[c]秒,每层控制印记提高[d]%概率。
  1430. --a[float],b[控制状态],c[int],d[float]
  1431. [79] = function(caster, target, args, interval, skill)
  1432. local f1 = args[1]
  1433. local ct = args[2]
  1434. local f2 = args[3]
  1435. local f3 = args[4]
  1436. BattleLogic.WaitForTrigger(interval, function ()
  1437. local layer = 0
  1438. BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
  1439. local b = buff.flag == "kongzhi"
  1440. if b then
  1441. layer = buff.layer
  1442. end
  1443. return b
  1444. end)
  1445. BattleUtil.RandomControl(f1+f3*layer, ct, caster, target, f2)
  1446. end)
  1447. end,
  1448. --添加[a]的[b]%护盾,持续[c]秒。为自身挂护盾印记,每层额外增加护盾值[d]%,印记最多[e]层。印记不显示。(增益印记,不可驱散)
  1449. --a[属性],b[float],c[int],d[float],e[int]
  1450. [80] = function(caster, target, args, interval, skill)
  1451. local pro1 = args[1]
  1452. local f1 = args[2]
  1453. local f2 = args[3]
  1454. local f3 = args[4]
  1455. local i1 = args[5]
  1456. BattleLogic.WaitForTrigger(interval, function ()
  1457. local layer = 0
  1458. BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
  1459. local b = buff.flag == "shieldLayerFlag"
  1460. if b then
  1461. layer = buff.layer
  1462. end
  1463. return b
  1464. end)
  1465. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1, 1+layer*f3))
  1466. local shield = Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, val, 0)
  1467. target:AddBuff(shield)
  1468. local brand = Buff.Create(caster, BuffName.Brand, 0, "shieldLayerFlag")
  1469. brand.maxLayer = i1
  1470. brand.isBuff = true
  1471. brand.clear = false
  1472. target:AddBuff(brand)
  1473. end)
  1474. end,
  1475. --造成[a]%的[b]伤害,附加受控印记,受到控制时回复[c]*[d]%生命,印记持续[e]秒。(增益印记,不可驱散)
  1476. --a[float],b[伤害类型],c[属性],d[float],e[int]
  1477. [81] = function(caster, target, args, interval, skill)
  1478. local f1 = args[1]
  1479. local dt = args[2]
  1480. local pro1 = args[3]
  1481. local f2 = args[4]
  1482. local f3 = args[5]
  1483. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1484. BattleLogic.WaitForTrigger(interval, function ()
  1485. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1486. local OnBuffStart = function(buff)
  1487. if buff.type == BuffName.Control then
  1488. local val = floor(BattleUtil.FP_Mul(buff.target:GetRoleData(BattlePropList[pro1]), f2))
  1489. BattleUtil.CalTreat(buff.caster, buff.target, val)
  1490. end
  1491. end
  1492. caster.Event:AddEvent(BattleEventName.BuffStart, OnBuffStart)
  1493. local buff = Buff.Create(caster, BuffName.Brand, f3, "shoukong", function ()
  1494. caster.Event:RemoveEvent(BattleEventName.BuffStart, OnBuffStart)
  1495. end)
  1496. buff.isBuff = true
  1497. buff.clear = false
  1498. caster:AddBuff(buff)
  1499. end)
  1500. end,
  1501. --代替相邻友军承受[a]%受到的伤害,持续[b]秒。自身死亡时该效果消失。
  1502. --a[float],b[int]
  1503. [82] = function(caster, target, args, interval, skill)
  1504. local f1 = args[1]
  1505. local f2 = args[2]
  1506. BattleLogic.WaitForTrigger(interval, function ()
  1507. local lastTrigger = 0
  1508. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  1509. lastTrigger = lastTrigger + 1
  1510. if lastTrigger > 1 then --加入限定避免循环触发
  1511. return
  1512. end
  1513. if not target:IsDead() then
  1514. damagingFunc(floor(damage * f1))
  1515. BattleUtil.ApplyDamage(skill, atkRole, target, BattleUtil.CalShield(atkRole, target, floor(damage * f1)))
  1516. end
  1517. lastTrigger = 0
  1518. end
  1519. local list = RoleManager.GetNeighbor(target, 1)
  1520. for i=1, #list do
  1521. if list[i] ~= target then
  1522. list[i].Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  1523. end
  1524. end
  1525. local brand = Buff.Create(caster, BuffName.Brand, f2, "chengshou", function ()
  1526. for i=1, #list do
  1527. if list[i] ~= target then
  1528. list[i].Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  1529. end
  1530. end
  1531. end)
  1532. target:AddBuff(brand)
  1533. end)
  1534. end,
  1535. --[a]概率驱散[b]个[c]状态。[b]为0时驱散所有
  1536. --a[float],b[int],c[状态类型]
  1537. [83] = function(caster, target, args, interval, skill)
  1538. local f1 = args[1]
  1539. local i1 = args[2]
  1540. local ct = args[3]
  1541. BattleLogic.WaitForTrigger(interval, function ()
  1542. BattleUtil.RandomAction(f1, function ()
  1543. local count = 0
  1544. BattleLogic.BuffMgr:ClearBuff(target, function (buff)
  1545. local flag = clearBuffPredicate(buff, ct)
  1546. if flag then
  1547. count = count + 1
  1548. end
  1549. return (i1 == 0 or count <= i1) and flag
  1550. end)
  1551. end)
  1552. end)
  1553. end,
  1554. --施加[a]的[b]%护盾,持续[c]秒。护盾被击破时,对击破者造成施法者最大生命值[d]%的伤害。
  1555. --a[属性],b[float],c[int],d[float]
  1556. [84] = function(caster, target, args, interval, skill)
  1557. local pro1 = args[1]
  1558. local f1 = args[2]
  1559. local f2 = args[3]
  1560. local f3 = args[4]
  1561. BattleLogic.WaitForTrigger(interval, function ()
  1562. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
  1563. local shield = Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, val, 0)
  1564. local OnBuffEnd = function(buff)
  1565. if buff == shield and buff.roundPass < buff.roundDuration then --护盾被击破
  1566. if buff.atk and not buff.atk.isTeam then
  1567. BattleUtil.ApplyDamage(skill, target, buff.atk, floor(BattleUtil.FP_Mul(caster:GetRoleData(RoleDataName.MaxHp), f3)))
  1568. end
  1569. end
  1570. end
  1571. target:AddBuff(shield)
  1572. target.Event:AddEvent(BattleEventName.BuffEnd, OnBuffEnd)
  1573. local brand = Buff.Create(caster, BuffName.Brand, f2, "shieldBreakFlag", function ()
  1574. target.Event:RemoveEvent(BattleEventName.BuffEnd, OnBuffEnd)
  1575. end)
  1576. target:AddBuff(brand)
  1577. end)
  1578. end,
  1579. --施加[a]的[b]%护盾,持续[c]秒。拥有该护盾的角色,[f]改变[d]属性[e]%,[i]改变[g]属性[h]%。护盾消失时增益消失。
  1580. --a[属性],b[float],c[int],d[属性],e[float],f[改变类型],g[属性],h[float],i[改变类型]
  1581. [85] = function(caster, target, args, interval, skill)
  1582. local pro1 = args[1]
  1583. local f1 = args[2]
  1584. local f2 = args[3]
  1585. local pro2 = args[4]
  1586. local f3 = args[5]
  1587. local ct1 = args[6]
  1588. local pro3 = args[7]
  1589. local f4 = args[8]
  1590. local ct2 = args[9]
  1591. BattleLogic.WaitForTrigger(interval, function ()
  1592. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
  1593. local shield = Buff.Create(caster, BuffName.Shield, f2, ShieldTypeName.NormalReduce, val, 0)
  1594. local buff1 = Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro2], f3, ct1)
  1595. local buff2 = Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro3], f4, ct2)
  1596. local OnBuffEnd = function(buff)
  1597. if buff == shield and buff.roundPass < buff.roundDuration then --护盾被击破
  1598. buff1.disperse = true
  1599. buff2.disperse = true
  1600. end
  1601. end
  1602. target.Event:AddEvent(BattleEventName.BuffEnd, OnBuffEnd)
  1603. local brand = Buff.Create(caster, BuffName.Brand, f2, "shieldBuffFlag", function ()
  1604. target.Event:RemoveEvent(BattleEventName.BuffEnd, OnBuffEnd)
  1605. end)
  1606. target:AddBuff(shield)
  1607. target:AddBuff(brand)
  1608. target:AddBuff(buff1)
  1609. target:AddBuff(buff2)
  1610. end)
  1611. end,
  1612. --[a]概率吸取[b]%的[c],持续[d]秒(属于增益),累积不高于自身该属性的[e]%
  1613. --a[float],b[float],c[属性],d[float],e[float]
  1614. [86] = function(caster, target, args, interval, skill)
  1615. local f4 = args[1]
  1616. local f1 = args[2]
  1617. local pro = args[3]
  1618. local f2 = args[4]
  1619. local f3 = args[5]
  1620. BattleLogic.WaitForTrigger(interval, function ()
  1621. BattleUtil.RandomAction(f4, function ()
  1622. --计算上限值
  1623. local total = caster.data:GetOrginData(BattlePropList[pro]) * (1 + f3)
  1624. --计算预期吸取后的值
  1625. local targetValue = caster:GetRoleData(BattlePropList[pro]) + target:GetRoleData(BattlePropList[pro]) * f1
  1626. --计算有效吸收值
  1627. local delta = min(targetValue, total) - caster:GetRoleData(BattlePropList[pro])
  1628. if delta > 0 then
  1629. target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro], delta, 3))
  1630. caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro], delta, 1))
  1631. end
  1632. end)
  1633. end)
  1634. end,
  1635. --造成[a]%的[b]伤害,对没有增益的敌人[c]概率造成[d],持续[e]秒。
  1636. --a[float],b[伤害类型],c[float],d[控制状态],e[int]
  1637. [87] = function(caster, target, args, interval, skill)
  1638. local f1 = args[1]
  1639. local dt = args[2]
  1640. local f2 = args[3]
  1641. local ct = args[4]
  1642. local f3 = args[5]
  1643. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1644. BattleLogic.WaitForTrigger(interval, function ()
  1645. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1646. local hasBuff = true
  1647. BattleLogic.BuffMgr:QueryBuff(target, function (buff)
  1648. if buff.isBuff then
  1649. hasBuff = false
  1650. end
  1651. end)
  1652. if hasBuff then
  1653. BattleUtil.RandomControl(f2, ct, caster, target, f3)
  1654. end
  1655. end)
  1656. end,
  1657. --造成[a]%的[b]伤害,对拥有减益的敌人[c]概率造成[d],持续[e]秒。
  1658. --a[float],b[伤害类型],c[float],d[控制状态],e[int]
  1659. [88] = function(caster, target, args, interval, skill)
  1660. local f1 = args[1]
  1661. local dt = args[2]
  1662. local f2 = args[3]
  1663. local ct = args[4]
  1664. local f3 = args[5]
  1665. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1666. BattleLogic.WaitForTrigger(interval, function ()
  1667. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1668. local hasBuff = false
  1669. BattleLogic.BuffMgr:QueryBuff(target, function (buff)
  1670. if buff.isDeBuff then
  1671. hasBuff = true
  1672. end
  1673. end)
  1674. if hasBuff then
  1675. BattleUtil.RandomControl(f2, ct, caster, target, f3)
  1676. end
  1677. end)
  1678. end,
  1679. --[a]概率在[d]秒里总共回复[e]次生命,每次恢复[b]*[c]%生命,。
  1680. --a[float],b[属性],c[float],d[int],e[int]
  1681. [89] = function(caster, target, args, interval, skill)
  1682. local f4 = args[1]
  1683. local pro1 = args[2]
  1684. local f1 = args[3]
  1685. local f2 = args[4]
  1686. local f3 = args[5]
  1687. BattleLogic.WaitForTrigger(interval, function ()
  1688. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[pro1]), f1))
  1689. buffRandomAction(f4, target, Buff.Create(caster, BuffName.HOT, f2, f2/f3, val))
  1690. end)
  1691. end,
  1692. --造成[a]%的[b]伤害,如果击杀,则其他人受到[c]%的溢出伤害
  1693. --a[float],b[伤害类型],c[float]
  1694. [90] = function(caster, target, args, interval, skill)
  1695. local f1 = args[1]
  1696. local dt = args[2]
  1697. local f2 = args[3]
  1698. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1699. BattleLogic.WaitForTrigger(interval, function ()
  1700. local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
  1701. if target:IsDead() then
  1702. local arr = RoleManager.Query(function (r) return r.camp == target.camp and r.uid ~= target.uid end)
  1703. for i=1, #arr do
  1704. BattleUtil.ApplyDamage(skill, caster, arr[i], floor((damage-finalDmg)*f2))
  1705. end
  1706. end
  1707. end
  1708. target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
  1709. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1710. target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
  1711. end)
  1712. end,
  1713. --[b]概率造成[c],每次造成[d]的[e]的伤害,在[f]秒内造成[g]次伤害。
  1714. --b[float],c[持续伤害状态].d[float],e[伤害类型],f[int],g[int]
  1715. [91] = function(caster, target, args, interval, skill)
  1716. local f4 = args[1]
  1717. local d1 = args[2]
  1718. local f1 = args[3]
  1719. local dt = args[4]
  1720. local f2 = args[5]
  1721. local f3 = args[6]
  1722. BattleLogic.WaitForTrigger(interval, function ()
  1723. buffRandomAction(f4, target, Buff.Create(caster, BuffName.DOT, f2, f2/f3, d1, dt, f1))
  1724. end)
  1725. end,
  1726. --造成[a]%的[b]伤害,若暴击,[g][c]%概率改变我方随机1人[d]属性[e]%,持续[f]秒。
  1727. --a[float],b[伤害类型],c[float],d[属性],e[float],f[int],g[改变类型]
  1728. [92] = function(caster, target, args, interval, skill)
  1729. local f4 = args[1]
  1730. local dt = args[2]
  1731. local f3 = args[3]
  1732. local pro1 = args[4]
  1733. local f1 = args[5]
  1734. local f2 = args[6]
  1735. local ct = args[7]
  1736. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1737. BattleLogic.WaitForTrigger(interval, function ()
  1738. local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f4)
  1739. if crit then
  1740. BattleUtil.RandomAction(f3, function ()
  1741. local arr = BattleUtil.ChooseTarget(caster, 10001)
  1742. if arr[1] then
  1743. arr[1]:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct))
  1744. end
  1745. end)
  1746. end
  1747. end)
  1748. end,
  1749. --造成[a]%的[b]伤害,若暴击,[c]概率驱散[d]个(0表示所有)[e]状态。【aoe】
  1750. --a[float],b[伤害类型],c[float],d[int],e[状态类型]
  1751. [93] = function(caster, target, args, interval, skill)
  1752. local f1 = args[1]
  1753. local dt = args[2]
  1754. local f2 = args[3]
  1755. local i1 = args[4]
  1756. local ct = args[5]
  1757. BattleLogic.WaitForTrigger(interval, function ()
  1758. local dmg, crit = BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1759. if crit then
  1760. BattleUtil.RandomAction(f2, function ()
  1761. local count = 0
  1762. BattleLogic.BuffMgr:ClearBuff(target, function (buff)
  1763. local flag = clearBuffPredicate(buff, ct)
  1764. if flag then
  1765. count = count + 1
  1766. end
  1767. return (i1 == 0 or count <= i1) and flag
  1768. end)
  1769. end)
  1770. end
  1771. end)
  1772. end,
  1773. --造成[a]%的[b]伤害,为自己施加一层印记,最大[c]层。(增益印记,不可驱散)(与95使用同一个印记)
  1774. --a[float],b[伤害类型],c[int]
  1775. [94] = function(caster, target, args, interval, skill)
  1776. local f1 = args[1]
  1777. local dt = args[2]
  1778. local i1 = args[3]
  1779. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1780. BattleLogic.WaitForTrigger(interval, function ()
  1781. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1782. local brand = Buff.Create(caster, BuffName.Brand, 0, "zengyi")
  1783. brand.maxLayer = i1
  1784. brand.clear = false
  1785. brand.isBuff = true
  1786. caster:AddBuff(brand)
  1787. end)
  1788. end,
  1789. --造成[a]%的[b]伤害,自身每层印记增加此技能[c]%的伤害。(增益印记,不可驱散)(与94使用同一个印记)
  1790. --a[float],b[伤害类型],c[float]
  1791. [95] = function(caster, target, args, interval, skill)
  1792. local f1 = args[1]
  1793. local dt = args[2]
  1794. local f2 = args[3]
  1795. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1796. BattleLogic.WaitForTrigger(interval, function ()
  1797. local layer = 0
  1798. if BattleLogic.BuffMgr:HasBuff(caster, BuffName.Brand, function (buff)
  1799. local b = buff.flag == "zengyi"
  1800. if b then
  1801. layer = buff.layer
  1802. end
  1803. return b
  1804. end) then
  1805. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  1806. damagingFunc(-floor(BattleUtil.FP_Mul(f2, layer, damage)))
  1807. end
  1808. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1809. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1810. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1811. else
  1812. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1813. end
  1814. end)
  1815. end,
  1816. --[b]概率造成[c],每次造成[d]的真实伤害,在[e]秒内造成[f]次伤害。(91,异妖用)(减益,不可驱散)
  1817. --b[float],c[持续伤害状态].d[float],e[int],f[int]
  1818. [96] = function(caster, target, args, interval, skill)
  1819. local f4 = args[1]
  1820. local d1 = args[2]
  1821. local f1 = args[3]
  1822. local f2 = args[4]
  1823. local f3 = args[5]
  1824. BattleLogic.WaitForTrigger(interval, function ()
  1825. local DOT = Buff.Create(caster, BuffName.DOT, f2, f2/f3, d1, f1, 1)
  1826. DOT.clear = false
  1827. DOT.isDeBuff = true
  1828. buffRandomAction(f4, target, DOT)
  1829. end)
  1830. end,
  1831. --[a]概率在[c]秒里总共回复[d]次生命,每次恢复[b]生命。(89,异妖用)(增益,不可驱散)
  1832. --a[float],b[float],c[int],d[int]
  1833. [97] = function(caster, target, args, interval, skill)
  1834. local f4 = args[1]
  1835. local i1 = args[2]
  1836. local f2 = args[3]
  1837. local f3 = args[4]
  1838. BattleLogic.WaitForTrigger(interval, function ()
  1839. local HOT = Buff.Create(caster, BuffName.HOT, f2, f2/f3, i1)
  1840. HOT.clear = false
  1841. HOT.isBuff = true
  1842. buffRandomAction(f4, target, HOT)
  1843. end)
  1844. end,
  1845. --造成[a]到[b]段[c]%的[d]伤害【AOE】,每段伤害有[e]的概率造成[f],持续[g]秒。若目标处于[h]状态,则必定暴击。
  1846. --a[int],b[int],c[float],d[伤害类型],e[float],f[控制状态],g[int],h[控制状态]
  1847. [98] = function(caster, target, args, interval, skill)
  1848. local i1 = args[1]
  1849. local i2 = args[2]
  1850. local f1 = args[3]
  1851. local dt = args[4]
  1852. local f2 = args[5]
  1853. local c1 = args[6]
  1854. local f4 = args[7]
  1855. local c2 = args[8]
  1856. local count = Random.RangeInt(i1, i2)
  1857. local d = interval / count
  1858. for i=1, count do
  1859. BattleLogic.WaitForTrigger(d * (i-1), function ()
  1860. BattleLogic.WaitForTrigger(d, function ()
  1861. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return c2 == 0 or buff.ctrlType == c2 end) then
  1862. target.isFlagCrit = true
  1863. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1864. target.isFlagCrit = false
  1865. else
  1866. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1867. end
  1868. BattleUtil.RandomControl(f2, c1, caster, target, f4)
  1869. end)
  1870. end)
  1871. end
  1872. end,
  1873. --造成[a]%的[b]伤害,目标每减少[c]个伤害提升[d]%
  1874. --a[float],b[伤害类型],c[int],d[float]
  1875. [99] = function(caster, target, args, interval, skill)
  1876. local f1 = args[1]
  1877. local dt = args[2]
  1878. local i1 = args[3]
  1879. local f2 = args[4]
  1880. -- 改变值 = 技能最大目标数 - 当前目标数
  1881. local maxNum = skill:GetMaxTargetNum()
  1882. local curNum = #skill:GetDirectTargets()
  1883. local lessNum = max(maxNum - curNum, 0)
  1884. local level = math.floor(lessNum/i1)
  1885. local extra = BattleUtil.ErrorCorrection(level * f2)
  1886. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1887. BattleLogic.WaitForTrigger(interval, function ()
  1888. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  1889. if damagingFunc then
  1890. damagingFunc(-floor(damage * extra))
  1891. end
  1892. end
  1893. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1894. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1895. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1896. end)
  1897. end,
  1898. --[a]改变[b]点怒气
  1899. --a[改变类型],b[int]
  1900. [100] = function(caster, target, args, interval, skill)
  1901. local ct = args[1]
  1902. local i1 = args[2]
  1903. -- caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1904. BattleLogic.WaitForTrigger(interval, function ()
  1905. target:AddRage(i1, ct)
  1906. end)
  1907. end,
  1908. -- 组合技能
  1909. -- 对仇恨目标追加一次1技能(追加的1技能不回怒气)
  1910. -- a[float],b[伤害类型]
  1911. [101] = function(caster, target, args, interval, skill)
  1912. local i1 = args[1]
  1913. BattleLogic.WaitForTrigger(interval, function ()
  1914. -- 对仇恨目标追加一次技能
  1915. for i = 1, i1 do
  1916. caster:AddSkill(BattleSkillType.Normal, false, true, {{target}})
  1917. end
  1918. end)
  1919. end,
  1920. -- 造成[a]%的[b]伤害,如果目标数量大于[c]个,增加自身[d]点怒气(主动 + 被动167联合实现)
  1921. -- a[float]b[伤害类型]c[int]d[int]
  1922. [102] = function(caster, target, args, interval, skill)
  1923. local f1 = args[1]
  1924. local dt = args[2]
  1925. local i1 = args[3]
  1926. local i2 = args[4]
  1927. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1928. BattleLogic.WaitForTrigger(interval, function ()
  1929. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1930. end)
  1931. -- 主动技能效果添加被动技能
  1932. -- 167 释放技能后如果目标数量大于[c]个,增加自身[d]点怒气
  1933. caster:AddPassive(167, {i1, i2}, false) -- 不可叠加
  1934. end,
  1935. --造成[a]%的[b]伤害,造成伤害的[c]%用于医疗生命值最低队友。
  1936. --a[float],b[伤害类型],c[float]
  1937. [103] = function(caster, target, args, interval, skill)
  1938. local f1 = args[1]
  1939. local dt = args[2]
  1940. local f2 = args[3]
  1941. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1942. BattleLogic.WaitForTrigger(interval, function ()
  1943. local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
  1944. local arr = RoleManager.Query(function (r) return r.camp == caster.camp end)
  1945. BattleUtil.SortByHpFactor(arr, 1)
  1946. -- 检测技能伤害治疗加成
  1947. f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[1])
  1948. -- 治疗血量最低队友实际伤害的f2%
  1949. BattleUtil.ApplyTreat(caster, arr[1], floor(finalDmg*f2))
  1950. end
  1951. target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
  1952. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1953. target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
  1954. end)
  1955. end,
  1956. -- 添加[a]%抵抗效果的减伤盾的持续[c]回合
  1957. -- a[float]c[int]
  1958. [104] = function(caster, target, args, interval, skill)
  1959. local f1 = args[1]
  1960. local i1 = args[2]
  1961. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1962. BattleLogic.WaitForTrigger(interval, function ()
  1963. local cl = {}
  1964. local function _CallBack(v, ct)
  1965. if v then
  1966. table.insert(cl, {v, ct})
  1967. end
  1968. end
  1969. caster.Event:DispatchEvent(BattleEventName.PassiveShield, _CallBack, ShieldTypeName.RateReduce)
  1970. target.Event:DispatchEvent(BattleEventName.PassiveBeShield, _CallBack, ShieldTypeName.RateReduce)
  1971. f1 = BattleUtil.CountChangeList(f1, cl)
  1972. target:AddBuff(Buff.Create(caster, BuffName.Shield, i1, ShieldTypeName.RateReduce, f1, 0))
  1973. end)
  1974. end,
  1975. -- 造成[a]%的[b]伤害如目标[c]则本次技能造成伤害增加[d]%
  1976. -- a[float]b[伤害类型]c[持续伤害状态]d[float]
  1977. [105] = function(caster, target, args, interval, skill)
  1978. local f1 = args[1]
  1979. local dt = args[2]
  1980. local dot = args[3]
  1981. local f2 = args[4]
  1982. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  1983. BattleLogic.WaitForTrigger(interval, function ()
  1984. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  1985. if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
  1986. if damagingFunc then
  1987. damagingFunc(-floor(damage * f2))
  1988. end
  1989. end
  1990. end
  1991. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1992. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  1993. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  1994. end)
  1995. end,
  1996. -- [a]%概率[b],持续[c]回合
  1997. -- a[float]b[持续伤害状态]c[int]
  1998. -- [106] = function(caster, target, args, interval, skill)
  1999. -- local f1 = args[1]
  2000. -- local dot = args[2]
  2001. -- local i1 = args[3]
  2002. -- BattleUtil.RandomAction(f1, function()
  2003. -- -- 秒杀
  2004. -- target:AddBuff(Buff.Create(caster, BuffName.DOT, i1, 1, dot, dt, f1))
  2005. -- end)
  2006. -- end,
  2007. -- [107] = {},
  2008. -- 造成[a]%的[b]伤害如果目标[c]且[d]低于[e]则有[F]%概率将其秒杀
  2009. -- a[float]b[伤害类型]c[持续伤害类型]d[属性]e[float]f[float]
  2010. [108] = function(caster, target, args, interval, skill)
  2011. local f1 = args[1]
  2012. local dt = args[2]
  2013. local dot = args[3]
  2014. local pro1 = args[4]
  2015. local f2 = args[5]
  2016. local f3 = args[6]
  2017. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  2018. BattleLogic.WaitForTrigger(interval, function ()
  2019. local isSecKill = false
  2020. if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
  2021. -- 检测被动技能对秒杀参数得影响
  2022. f2, f3 = BattleUtil.CheckSeckill(f2, f3, caster, target)
  2023. --
  2024. local ft = target:GetRoleData(RoleDataName.Hp)/target:GetRoleData(RoleDataName.MaxHp)
  2025. if ft < f2 then
  2026. isSecKill = BattleUtil.RandomAction(f3, function()
  2027. -- 秒杀
  2028. BattleUtil.Seckill(skill, caster, target)
  2029. end)
  2030. end
  2031. end
  2032. -- 不秒杀造成伤害
  2033. if not isSecKill then
  2034. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  2035. end
  2036. --
  2037. -- local OnBeHit = function()
  2038. -- if not target:IsDead() and BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
  2039. -- -- 检测被动技能对秒杀参数得影响
  2040. -- f2, f3 = BattleUtil.CheckSeckill(f2, f3, caster, target)
  2041. -- --
  2042. -- local ft = target:GetRoleData(RoleDataName.Hp)/target:GetRoleData(RoleDataName.MaxHp)
  2043. -- if ft < f2 then
  2044. -- BattleUtil.RandomAction(f3, function()
  2045. -- -- 秒杀
  2046. -- BattleUtil.Seckill(skill, caster, target)
  2047. -- end)
  2048. -- end
  2049. -- end
  2050. -- end
  2051. -- target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
  2052. -- BattleUtil.CalDamage(skill, caster, target, dt, f1)
  2053. -- target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
  2054. end)
  2055. end,
  2056. -- 造成[a]%的[b]伤害每次击杀目标[c]改变[d]%的[e]
  2057. -- a[float]b[伤害类型]c[改变类型]d[float]e[属性]
  2058. [109] = function(caster, target, args, interval, skill)
  2059. local f1 = args[1]
  2060. local dt = args[2]
  2061. local ct = args[3]
  2062. local f2 = args[4]
  2063. local pro1 = args[5]
  2064. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  2065. BattleLogic.WaitForTrigger(interval, function ()
  2066. local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
  2067. if target:IsDead() then
  2068. caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[pro1], f2, ct))
  2069. end
  2070. end
  2071. target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
  2072. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  2073. target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
  2074. end)
  2075. end,
  2076. -- 给目标附加一个印记,印记效果是己方武将直接攻击敌方非该印记状态的目标时所造成的伤害的[a]会额外再平分给敌方所有处于该印记状态的目标,持续[b]回合
  2077. -- a[float]b[int]
  2078. [110] = function(caster, target, args, interval, skill)
  2079. local f1 = args[1]
  2080. local i1 = args[2]
  2081. BattleLogic.WaitForTrigger(interval, function ()
  2082. local cl = {}
  2083. local function _CallBack(v, ct)
  2084. if v then
  2085. table.insert(cl, {v, ct})
  2086. end
  2087. end
  2088. caster.Event:DispatchEvent(BattleEventName.Curse_ShareDamage, _CallBack)
  2089. target.Event:DispatchEvent(BattleEventName.Be_Curse_ShareDamage, _CallBack)
  2090. local f = BattleUtil.CountChangeList(f1, cl)
  2091. local buff = Buff.Create(caster, BuffName.Curse, i1, CurseTypeName.ShareDamage, f)
  2092. target:AddBuff(buff)
  2093. end)
  2094. end,
  2095. -- [a]%概率造成[b],每回合造成[c]%自身[d]的伤害,持续[e]回合
  2096. -- a[float]b[持续伤害状态].c[float],d[属性]e[int]
  2097. [111] = function(caster, target, args, interval, skill)
  2098. local f1 = args[1]
  2099. local dot = args[2]
  2100. local f2 = args[3]
  2101. local pro = args[4]
  2102. local i1 = args[5]
  2103. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  2104. BattleLogic.WaitForTrigger(interval, function ()
  2105. local damage = BattleUtil.ErrorCorrection(f2 * caster:GetRoleData(BattlePropList[pro]))
  2106. BattleUtil.RandomDot(f1, dot, caster, target, i1, 1, floor(damage))
  2107. end)
  2108. end,
  2109. -- 自身[a]增加[b]%持续[c]回合,效果可叠加,[d]改变
  2110. -- a[属性]b[float]c[int]d[改变类型]
  2111. [112] = function(caster, target, args, interval, skill)
  2112. local pro = args[1]
  2113. local f1 = args[2]
  2114. local i1 = args[3]
  2115. local ct = args[4]
  2116. BattleLogic.WaitForTrigger(interval, function ()
  2117. caster:AddBuff(Buff.Create(caster, BuffName.PropertyChange, i1, BattlePropList[pro], f1, ct))
  2118. end)
  2119. end,
  2120. --造成[a]%的[b]伤害,对[c]有[d]%造成[e],持续[f]秒 技能21的弹道特效版
  2121. --a[float],b[伤害类型,]c[持续伤害状态],d[float],e[控制状态],f[int]
  2122. [113] = function(caster, target, args, interval, skill)
  2123. local f1 = args[1]
  2124. local dt = args[2]
  2125. local dot = args[3]
  2126. local f2 = args[4]
  2127. local ct = args[5]
  2128. local f3 = args[6]
  2129. -- caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  2130. BattleLogic.WaitForTrigger(interval, function ()
  2131. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  2132. if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
  2133. BattleUtil.RandomControl(f2, ct, caster, target, f3)
  2134. end
  2135. end)
  2136. end,
  2137. -- 造成[a]%的[b]伤害如目标[c]则本次技能暴击率提高[d]%
  2138. -- a[float]b[伤害类型]c[持续伤害状态]d[float]
  2139. [114] = function(caster, target, args, interval, skill)
  2140. local f1 = args[1]
  2141. local dt = args[2]
  2142. local dot = args[3]
  2143. local f2 = args[4]
  2144. caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
  2145. BattleLogic.WaitForTrigger(interval, function ()
  2146. local index, tran
  2147. if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end) then
  2148. index, tran = caster:AddPropertyTransfer(RoleDataName.Crit, f2, RoleDataName.Crit, 1)
  2149. end
  2150. BattleUtil.CalDamage(skill, caster, target, dt, f1)
  2151. if index and tran then
  2152. caster:RemovePropertyTransfer(index, tran)
  2153. end
  2154. end)
  2155. end,
  2156. -- 回复自身最大生命值的[a]%
  2157. -- a[float]
  2158. [115] = function(caster, target, args, interval, skill)
  2159. local f1 = args[1]
  2160. BattleLogic.WaitForTrigger(interval, function ()
  2161. local v = floor(BattleUtil.ErrorCorrection(target:GetRoleData(RoleDataName.MaxHp)*f1))
  2162. BattleUtil.ApplyTreat(caster, target, v)
  2163. end)
  2164. end,
  2165. --> 把目标增益换成负面buff
  2166. --> [a]%概率把目标一个增益变成[b]持续伤害状态
  2167. --> a[float] b[持续伤害状态]
  2168. [201] = function(caster, target, args, interval, skill)
  2169. local a = args[1]
  2170. local b = args[2]
  2171. BattleLogic.WaitForTrigger(interval, function ()
  2172. BattleUtil.RandomAction(a, function()
  2173. local list = BattleLogic.BuffMgr:GetBuff(target, function(buff)
  2174. return buff.isBuff
  2175. end)
  2176. if list and #list > 0 then
  2177. local delBuff = Random.RangeInt(1, #list)
  2178. BattleLogic.BuffMgr:ClearBuff(target, function(buff)
  2179. return buff == delBuff
  2180. end)
  2181. end
  2182. end)
  2183. end)
  2184. end,
  2185. --> 临时提升某属性
  2186. --> 造成[a]%的[b]伤害,[c]%概率本次攻击[d]属性[e]改变[f]%
  2187. --> a[float] b[伤害类型] c[float] d[属性] e[改变类型] f[float]
  2188. [202] = function(caster, target, args, interval, skill)
  2189. local a = args[1]
  2190. local b = args[2]
  2191. local c = args[3]
  2192. local d = args[4]
  2193. local e = args[5]
  2194. local f = args[6]
  2195. BattleLogic.WaitForTrigger(interval, function ()
  2196. BattleUtil.RandomAction(c, function()
  2197. local buff = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[d], f, e)
  2198. caster:AddBuff(buff)
  2199. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2200. buff.disperse = true
  2201. end)
  2202. end)
  2203. BattleUtil.CalDamage(skill, caster, target, b, a)
  2204. end)
  2205. end,
  2206. --> 南蛮入侵
  2207. --> 造成[a]%的[b]伤害,[c]%概率对血量百分比最低的目标伤害提升[d]%,[e]%概率对血量百分比最高的目标附加[f]控制状态[g]回合
  2208. --> a[float] b[伤害类型] c[float] d[float] e[float] f[控制状态] g[int]
  2209. [203] = function(caster, target, args, interval, skill)
  2210. local a = args[1]
  2211. local b = args[2]
  2212. local c = args[3]
  2213. local d = args[4]
  2214. local e = args[5]
  2215. local f = args[6]
  2216. local g = args[7]
  2217. BattleLogic.WaitForTrigger(interval, function ()
  2218. local isTrigger = BattleUtil.RandomAction(c, function()
  2219. local arr = BattleUtil.ChooseTarget(caster, 100210)
  2220. if arr[1] and arr[1] == target then
  2221. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  2222. damagingFunc(-floor(BattleUtil.FP_Mul(d, damage)))
  2223. end
  2224. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  2225. BattleUtil.CalDamage(skill, caster, target, b, a)
  2226. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  2227. end
  2228. end)
  2229. if not isTrigger then
  2230. BattleUtil.CalDamage(skill, caster, target, b, a)
  2231. end
  2232. local arr = BattleUtil.ChooseTarget(caster, 100220)
  2233. if arr[1] and arr[1] == target then
  2234. BattleUtil.RandomControl(e, f, caster, target, g)
  2235. end
  2236. end)
  2237. end,
  2238. --> 加状态,按职业提高概率
  2239. --> [a]%概率对目标附加[b]状态[c]回合;对[d]职业和[e]职业概率提高[f]%
  2240. --> a[float] b[控制状态] c[int] d[职业] e[职业] f[float]
  2241. [205] = function(caster, target, args, interval, skill)
  2242. local a = args[1]
  2243. local b = args[2]
  2244. local c = args[3]
  2245. local d = args[4]
  2246. local e = args[5]
  2247. local f = args[6]
  2248. BattleLogic.WaitForTrigger(interval, function ()
  2249. local rand = a
  2250. if target.roleData.professionId == d or target.roleData.professionId == e then
  2251. rand = a*(1+f)
  2252. end
  2253. BattleUtil.RandomControl(rand, b, caster, target, c)
  2254. end)
  2255. end,
  2256. --> 加状态,减速提高概率
  2257. --> [a]%概率对目标附加[b]状态[c]回合;若目标有“减速”状态,则概率提高[d]%
  2258. --> a[float] b[控制状态] c[int] d[float]
  2259. [206] = function(caster, target, args, interval, skill)
  2260. local a = args[1]
  2261. local b = args[2]
  2262. local c = args[3]
  2263. local d = args[4]
  2264. BattleLogic.WaitForTrigger(interval, function ()
  2265. local rand = a
  2266. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.PropertyChange, function(buff)
  2267. return buff.propertyChangeType == PropertyChangeType.ReduceSpeed
  2268. end)
  2269. if isHave then
  2270. rand = a*(1+d)
  2271. end
  2272. BattleUtil.RandomControl(rand, b, caster, target, c)
  2273. end)
  2274. end,
  2275. --> 加状态,诅咒提高概率
  2276. --> [a]%概率对目标附加[b]状态[c]回合;若目标有“诅咒”状态,则概率提高[d]%
  2277. --> a[float] b[控制状态] c[int] d[float]
  2278. [207] = function(caster, target, args, interval, skill)
  2279. local a = args[1]
  2280. local b = args[2]
  2281. local c = args[3]
  2282. local d = args[4]
  2283. BattleLogic.WaitForTrigger(interval, function ()
  2284. local rand = a
  2285. if BattleLogic.BuffMgr:HasBuff(target, BuffName.Curse) then
  2286. rand = a*(1+d)
  2287. end
  2288. BattleUtil.RandomControl(rand, b, caster, target, c)
  2289. end)
  2290. end,
  2291. --> 驱散
  2292. --> [a]%概率驱散[b]目标/自己[c]个[d]增益/减益状态
  2293. --> a[float] b[1目标/2自己/3目标和自己] c[int] d[1增益/2减益]
  2294. [208] = function(caster, target, args, interval, skill)
  2295. local a = args[1]
  2296. local b = args[2]
  2297. local c = args[3]
  2298. local d = args[4]
  2299. BattleLogic.WaitForTrigger(interval, function ()
  2300. BattleUtil.RandomAction(a, function()
  2301. local targetList = BattleLogic.BuffMgr:GetBuff(target, function(buff)
  2302. return d == 1 and buff.isBuff or buff.isDeBuff
  2303. end)
  2304. local casterList = BattleLogic.BuffMgr:GetBuff(caster, function(buff)
  2305. return d == 1 and buff.isBuff or buff.isDeBuff
  2306. end)
  2307. local clearT = function(t, list)
  2308. if list and #list > 0 then
  2309. local num = math.min(c, #list)
  2310. for i = 1, num do
  2311. BattleLogic.BuffMgr:ClearBuff(t, function(buff)
  2312. return buff == list[i]
  2313. end)
  2314. end
  2315. end
  2316. end
  2317. if b == 1 then
  2318. clearT(target, targetList)
  2319. elseif b == 2 then
  2320. clearT(caster, casterList)
  2321. elseif b == 3 then
  2322. clearT(target, targetList)
  2323. clearT(caster, casterList)
  2324. end
  2325. end)
  2326. end)
  2327. end,
  2328. --> 驱散并伤害
  2329. --> [a]%概率驱散目标[b]个增益状态,每驱散1个增益状态,额外造成等同目标属性[c][d]%的伤害
  2330. --> a[float] b[int] c[属性] d[float]
  2331. [209] = function(caster, target, args, interval, skill)
  2332. local a = args[1]
  2333. local b = args[2]
  2334. local c = args[3]
  2335. local d = args[4]
  2336. BattleLogic.WaitForTrigger(interval, function ()
  2337. BattleUtil.RandomAction(a, function()
  2338. local targetList = BattleLogic.BuffMgr:GetBuff(target, function(buff)
  2339. return buff.isBuff
  2340. end)
  2341. local clearT = function(t, list)
  2342. if list and #list > 0 then
  2343. local num = math.min(b, #list)
  2344. for i = 1, num do
  2345. BattleLogic.BuffMgr:ClearBuff(t, function(buff)
  2346. return buff == list[i]
  2347. end)
  2348. BattleUtil.CalDamage(skill, caster, target, target:GetRoleData(BattlePropList[c]), d)
  2349. end
  2350. end
  2351. end
  2352. clearT(target, targetList)
  2353. end)
  2354. end)
  2355. end,
  2356. --> 传染
  2357. --> [a]%概率让目标的[b]状态传播到敌方一个未受该状态的单位
  2358. --> a[float] b[持续伤害状态]
  2359. [210] = function(caster, target, args, interval, skill)
  2360. local a = args[1]
  2361. local b = args[2]
  2362. BattleLogic.WaitForTrigger(interval, function ()
  2363. BattleUtil.RandomAction(a, function()
  2364. local bufflist = BattleLogic.BuffMgr:GetBuff(target, function(buff)
  2365. return buff.type == BuffName.DOT and buff.damageType == b
  2366. end)
  2367. if bufflist and #bufflist > 0 then
  2368. local arr = RoleManager.Query(function (r) return r.camp ~= caster.camp end)
  2369. for k, v in ipairs(arr) do
  2370. if not BattleLogic.BuffMgr:HasBuff(v, BuffName.DOT, function(buff) return buff.damageType == b end) then
  2371. v:AddBuff(Buff.Create(caster, BuffName.DOT, bufflist[1].interval, 1, b, bufflist[1].damagePro, bufflist[1].damageFactor))
  2372. break
  2373. end
  2374. end
  2375. end
  2376. end)
  2377. end)
  2378. end,
  2379. --> 改变属性
  2380. --> [a]%概率使[b]目标/自己的属性[c][d]改变[e]%[f]回合
  2381. --> a[float] b[1目标/2自己/3目标和自己] c[属性] d[改变类型] e[float] f[int]
  2382. [211] = function(caster, target, args, interval, skill)
  2383. local a = args[1]
  2384. local b = args[2]
  2385. local c = args[3]
  2386. local d = args[4]
  2387. local e = args[5]
  2388. local f = args[6]
  2389. BattleLogic.WaitForTrigger(interval, function ()
  2390. BattleUtil.RandomAction(a, function()
  2391. local changeProperty = function(_role)
  2392. local buff = Buff.Create(caster, BuffName.PropertyChange, f, BattlePropList[c], e, d)
  2393. _role:AddBuff(buff)
  2394. end
  2395. if b == 1 then
  2396. changeProperty(target)
  2397. elseif b == 2 then
  2398. changeProperty(caster)
  2399. elseif b == 3 then
  2400. changeProperty(target)
  2401. changeProperty(caster)
  2402. end
  2403. end)
  2404. end)
  2405. end,
  2406. --> 改变双属性
  2407. --> [a]%概率使[b]目标的属性[c][d]改变[e]%,属性[f][g]改变[h]%,储蓄[i]回合
  2408. --> a[float] b[目标类型] c[属性] d[改变类型] e[float] f[属性] g[改变类型] h[float] i[int]
  2409. [212] = function(caster, target, args, interval, skill)
  2410. local a = args[1]
  2411. local b = args[2]
  2412. local c = args[3]
  2413. local d = args[4]
  2414. local e = args[5]
  2415. local f = args[6]
  2416. local g = args[7]
  2417. local h = args[8]
  2418. local i = args[9]
  2419. BattleLogic.WaitForTrigger(interval, function ()
  2420. BattleUtil.RandomAction(a, function()
  2421. local changeProperty = function(_role, _a, _b, _c, _d)
  2422. local buff = Buff.Create(caster, BuffName.PropertyChange, _a, BattlePropList[_b], _c, _d)
  2423. _role:AddBuff(buff)
  2424. end
  2425. if b == 1 then
  2426. changeProperty(target, i, c, e, d)
  2427. changeProperty(target, i, f, h, g)
  2428. elseif b == 2 then
  2429. changeProperty(caster, i, c, e, d)
  2430. changeProperty(caster, i, f, h, g)
  2431. elseif b == 3 then
  2432. changeProperty(target, i, c, e, d)
  2433. changeProperty(target, i, f, h, g)
  2434. changeProperty(caster, i, c, e, d)
  2435. changeProperty(caster, i, f, h, g)
  2436. end
  2437. end)
  2438. end)
  2439. end,
  2440. --> 护盾,可变数值
  2441. --> [a]%概率为目标附加护盾[b]回合,护盾值等同于自己属性[c][d]%
  2442. --> a[float] b[int] c[属性] d[float]
  2443. [213] = function(caster, target, args, interval, skill)
  2444. local a = args[1]
  2445. local b = args[2]
  2446. local c = args[3]
  2447. local d = args[4]
  2448. BattleLogic.WaitForTrigger(interval, function ()
  2449. BattleUtil.RandomAction(a, function()
  2450. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[c]), d))
  2451. local shield = Buff.Create(caster, BuffName.Shield, b, ShieldTypeName.NormalReduce, val, 0)
  2452. target:AddBuff(shield)
  2453. end)
  2454. end)
  2455. end,
  2456. --> 光环
  2457. --> 卡牌[a]在场情况下己方所有[b]国家武将添加[c]状态
  2458. --> a[卡牌id] b[国家] c[状态id]
  2459. [215] = function(caster, target, args, interval, skill)
  2460. local a = args[1]
  2461. local b = args[2]
  2462. local c = args[3]
  2463. BattleLogic.WaitForTrigger(interval, function ()
  2464. local arr = RoleManager.Query(function (r) return r.camp == caster.camp end)
  2465. for _k, _v in ipairs(arr) do
  2466. if _v.roleId == a then
  2467. local arrtarget = RoleManager.Query(function (r) return r.camp == caster.camp and r.roleData.element == b end)
  2468. for i, r in ipairs(arrtarget) do
  2469. --todo
  2470. end
  2471. break
  2472. end
  2473. end
  2474. end)
  2475. end,
  2476. --> 被此技能击杀的武将无法以任何方式复活
  2477. [216] = function(caster, target, args, interval, skill)
  2478. local a = args[1]
  2479. local b = args[2]
  2480. local c = args[3]
  2481. BattleLogic.WaitForTrigger(interval, function ()
  2482. if target:IsDead() then
  2483. target:SetReliveFilter(false)
  2484. end
  2485. end)
  2486. end,
  2487. --> 免疫控制
  2488. --> 当自己血量低于[a]%或首次被控制时候时,自动解除并免疫控制,伤害提高[b]%,持续[c]回合(每场只能触发一次)
  2489. --> a[float] b[float] c[int]
  2490. [218] = function(caster, target, args, interval, skill)
  2491. local a = args[1]
  2492. local b = args[2]
  2493. local c = args[3]
  2494. BattleLogic.WaitForTrigger(interval, function ()
  2495. local list = BattleLogic.BuffMgr:GetBuff(caster, function(buff)
  2496. return buff.type == BuffName.Control
  2497. end)
  2498. if caster.effect218times <= 0 and (BattleUtil.GetHPPencent(caster) < a or (list and #list > 0 and caster.ctrltimes == 1)) then
  2499. caster.effect218times = caster.effect218times + 1
  2500. if list and #list > 0 then
  2501. BattleLogic.BuffMgr:ClearBuff(caster, function (buff)
  2502. return buff.type == BuffName.Control
  2503. end)
  2504. end
  2505. caster:AddBuff(Buff.Create(caster, BuffName.Immune, 0, 1))
  2506. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  2507. damagingFunc(-floor(b * damage))
  2508. end
  2509. caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  2510. local brand = Buff.Create(caster, BuffName.Brand, c, "damageup", function ()
  2511. caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  2512. end)
  2513. caster:AddBuff(brand)
  2514. end
  2515. end)
  2516. end,
  2517. --> 二选一
  2518. --> 二选一:造成[a]%的[b]伤害,[c]%概率附加[d]持续伤害状态[e]回合;或者造成[f]%的[g]伤害,恢复等同攻击[h]%的生命
  2519. --> a[float] b[伤害类型] c[float] d[持续伤害状态] e[int] f[float] g[伤害类型] h[float]
  2520. [219] = function(caster, target, args, interval, skill)
  2521. local a = args[1]
  2522. local b = args[2]
  2523. local c = args[3]
  2524. local d = args[4]
  2525. local e = args[5]
  2526. local f = args[6]
  2527. local g = args[7]
  2528. local h = args[8]
  2529. BattleLogic.WaitForTrigger(interval, function ()
  2530. BattleUtil.CalDamage(skill, caster, target, b, a)
  2531. BattleUtil.RandomAction(c, function()
  2532. if Random.Range01() <= 0.5 then
  2533. --> 后俩参数todo 现为魔法2, 系数1
  2534. target:AddBuff(Buff.Create(caster, BuffName.DOT, e, 1, d, 2, 1))
  2535. else
  2536. BattleUtil.CalDamage(skill, caster, target, g, f)
  2537. BattleUtil.CalTreat(caster, caster, floor(caster:GetRoleData(RoleDataName.Attack) * h))
  2538. end
  2539. end)
  2540. end)
  2541. end,
  2542. --> 守护目标分担伤害
  2543. --> 分摊目标所受伤害的[a]%,持续[b]回合
  2544. --> a[float] b[int]
  2545. [220] = function(caster, target, args, interval, skill)
  2546. local a = args[1]
  2547. local b = args[2]
  2548. BattleLogic.WaitForTrigger(interval, function ()
  2549. local lastTrigger = 0
  2550. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  2551. lastTrigger = lastTrigger + 1
  2552. if lastTrigger > 1 then --加入限定避免循环触发
  2553. return
  2554. end
  2555. if not target:IsDead() then
  2556. damagingFunc(floor(damage * a))
  2557. BattleUtil.ApplyDamage(skill, atkRole, caster, floor(damage * a))
  2558. end
  2559. lastTrigger = 0
  2560. end
  2561. target.Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2562. local brand = Buff.Create(caster, BuffName.Brand, b, "chengshou", function ()
  2563. target.Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2564. end)
  2565. target:AddBuff(brand)
  2566. end)
  2567. end,
  2568. --> 复活并回血
  2569. --> [a]%概率复活目标,并恢复相当于[b]目标类型[c]属性[d]%的生命
  2570. --> a[float] b[目标类型] c[属性] d[float]
  2571. [221] = function(caster, target, args, interval, skill)
  2572. local a = args[1]
  2573. local b = args[2]
  2574. local c = args[3]
  2575. local d = args[4]
  2576. BattleLogic.WaitForTrigger(interval, function ()
  2577. BattleUtil.RandomAction(a, function()
  2578. if target:IsRealDead() then
  2579. local maxHp = target:GetRoleData(RoleDataName.MaxHp)
  2580. local pro = floor(target:GetRoleData(BattlePropList[c]) * d)
  2581. target:SetRelive(math.min(pro / maxHp, 1))
  2582. end
  2583. end)
  2584. end)
  2585. end,
  2586. --> 按上场卡牌改属性
  2587. --> 每个在场的[a]国家武将使自己的属性[b][c]改变[d]%
  2588. --> a[国家] b[属性] c[改变类型] d[float]
  2589. [223] = function(caster, target, args, interval, skill)
  2590. local a = args[1]
  2591. local b = args[2]
  2592. local c = args[3]
  2593. local d = args[4]
  2594. BattleLogic.WaitForTrigger(interval, function ()
  2595. end)
  2596. end,
  2597. --> 按目标状态提升伤害
  2598. --> 目标每携带[a]个负面状态,技能伤害提高[b]%
  2599. --> a[int] b[float]
  2600. [224] = function(caster, target, args, interval, skill)
  2601. local a = args[1]
  2602. local b = args[2]
  2603. BattleLogic.WaitForTrigger(interval, function ()
  2604. local bufflist = BattleLogic.BuffMgr:GetBuff(target, function(buff)
  2605. return buff.type == BuffName.DOT or buff.type == BuffName.Control or buff.isDeBuff
  2606. end)
  2607. if bufflist and #bufflist > 0 then
  2608. local num = floor(#bufflist / a)
  2609. local OnPassiveDamaging = function(damagingFunc, defRole, damage)
  2610. local _a = damage
  2611. for _i = 1, num do
  2612. _a = _a + _a * b
  2613. end
  2614. local finaladd = max(_a - damage, 0)
  2615. damagingFunc(-floor(finaladd))
  2616. end
  2617. target.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  2618. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2619. target.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
  2620. end)
  2621. end
  2622. end)
  2623. end,
  2624. --> 击杀回血
  2625. --> 若击杀目标,则恢复等同自身生命上限[a]%的生命
  2626. --> a[float]
  2627. [226] = function(caster, target, args, interval, skill)
  2628. local a = args[1]
  2629. BattleLogic.WaitForTrigger(interval, function ()
  2630. --> 延时触发死亡判定
  2631. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2632. if target:IsDead() then
  2633. BattleUtil.CalTreat(caster, caster, floor(caster:GetRoleData(RoleDataName.MaxHp) * a))
  2634. end
  2635. end)
  2636. end)
  2637. end,
  2638. --> 复活失败换成加血
  2639. --> 若己方无死亡武将,则为生命最低的己方武将恢复等同属性[a][b]%的生命
  2640. --> a[属性] b[float]
  2641. [227] = function(caster, target, args, interval, skill)
  2642. local a = args[1]
  2643. local b = args[2]
  2644. BattleLogic.WaitForTrigger(interval, function ()
  2645. local deadlist = RoleManager.QueryDead(function (r) return r.camp == caster.camp end)
  2646. if deadlist and #deadlist <= 0 then
  2647. local list RoleManager.Query(function (r) return r.camp == caster.camp end)
  2648. local minhp = nil
  2649. local _r = nil
  2650. for _k, _v in ipairs(list) do
  2651. if not minhp then
  2652. minhp = _v:GetRoleData(RoleDataName.Hp)
  2653. end
  2654. if _v:GetRoleData(RoleDataName.Hp) < minhp then
  2655. minhp = _v:GetRoleData(RoleDataName.Hp)
  2656. _r = _v
  2657. end
  2658. if _r then
  2659. BattleUtil.CalTreat(caster, _r, floor(_r:GetRoleData(BattlePropList[a]) * b))
  2660. end
  2661. end
  2662. end
  2663. end)
  2664. end,
  2665. --> 比属性吸血
  2666. --> 若目标属性[a]低于自己,则按[b]%伤害量吸血
  2667. --> a[属性] b[float]
  2668. [228] = function(caster, target, args, interval, skill)
  2669. local a = args[1]
  2670. local b = args[2]
  2671. BattleLogic.WaitForTrigger(interval, function ()
  2672. if target:GetRoleData(BattlePropList[a]) < caster:GetRoleData(BattlePropList[a]) then
  2673. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  2674. if not target:IsDead() then
  2675. BattleUtil.CalTreat(caster, caster, floor(damage * b))
  2676. end
  2677. end
  2678. target.Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2679. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2680. target.Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2681. end)
  2682. end
  2683. end)
  2684. end,
  2685. --> 比属性加伤害
  2686. --> 若目标属性[a]低于自己,则伤害提高[b]%
  2687. --> a[属性] b[float]
  2688. [229] = function(caster, target, args, interval, skill)
  2689. local a = args[1]
  2690. local b = args[2]
  2691. BattleLogic.WaitForTrigger(interval, function ()
  2692. if target:GetRoleData(BattlePropList[a]) < caster:GetRoleData(BattlePropList[a]) then
  2693. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  2694. if not target:IsDead() then
  2695. damagingFunc(-floor(damage * b))
  2696. end
  2697. end
  2698. target.Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2699. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2700. target.Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2701. end)
  2702. end
  2703. end)
  2704. end,
  2705. --> 目标残血提高伤害
  2706. --> 若目标生命低于[a]%,则本次伤害提高[b]%
  2707. --> a[float] b[float]
  2708. [232] = function(caster, target, args, interval, skill)
  2709. local a = args[1]
  2710. local b = args[2]
  2711. BattleLogic.WaitForTrigger(interval, function ()
  2712. if target:GetRoleData(RoleDataName.Hp) / target:GetRoleData(RoleDataName.MaxHp) < a then
  2713. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  2714. if not target:IsDead() then
  2715. damagingFunc(-floor(damage * b))
  2716. end
  2717. end
  2718. target.Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2719. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2720. target.Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2721. end)
  2722. end
  2723. end)
  2724. end,
  2725. --> 高血量目标忽视防御
  2726. --> 若目标生命高于[a]%,则本次攻击忽视目标[b]%防御
  2727. --> a[float] b[float]
  2728. [233] = function(caster, target, args, interval, skill)
  2729. local a = args[1]
  2730. local b = args[2]
  2731. BattleLogic.WaitForTrigger(interval, function ()
  2732. if target:GetRoleData(RoleDataName.Hp) / target:GetRoleData(RoleDataName.MaxHp) < a then
  2733. local onIgnoreDefFactor = function(ignoreDefFactorFunc, atkRole, defRole)
  2734. if not target:IsDead() then
  2735. ignoreDefFactorFunc(b)
  2736. end
  2737. end
  2738. target.Event:AddEvent(BattleEventName.BeIgnoreDefFactor, onIgnoreDefFactor)
  2739. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2740. target.Event:RemoveEvent(BattleEventName.BeIgnoreDefFactor, onIgnoreDefFactor)
  2741. end)
  2742. end
  2743. end)
  2744. end,
  2745. --> 按职业加控制状态
  2746. --> 若目标是[a]职业,[b]%概率附加[c]控制状态[d]回合
  2747. --> a[职业] b[float] c[控制状态] d[int]
  2748. [234] = function(caster, target, args, interval, skill)
  2749. local a = args[1]
  2750. local b = args[2]
  2751. local c = args[3]
  2752. local d = args[4]
  2753. BattleLogic.WaitForTrigger(interval, function ()
  2754. if target.roleData.professionId == a then
  2755. BattleUtil.RandomControl(b, c, caster, target, d)
  2756. end
  2757. end)
  2758. end,
  2759. --> 按职业临时改属性
  2760. --> 若目标是[a]职业,则本次攻击属性[b][c]改变[d]%
  2761. --> a[职业] b[属性] c[改变类型] d[float]
  2762. [235] = function(caster, target, args, interval, skill)
  2763. local a = args[1]
  2764. local b = args[2]
  2765. local c = args[3]
  2766. local d = args[4]
  2767. BattleLogic.WaitForTrigger(interval, function ()
  2768. if target.roleData.professionId == a then
  2769. local buffPro = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[b], d, c)
  2770. caster:AddBuff(buffPro)
  2771. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function ()
  2772. BattleLogic.BuffMgr:ClearBuff(caster, function (buff)
  2773. return buff == buffPro
  2774. end)
  2775. end)
  2776. end
  2777. end)
  2778. end,
  2779. --> 按职业改属性
  2780. --> 若目标是[a]职业,则属性[b][c]改变[d]%[e]回合
  2781. --> a[职业] b[属性] c[改变类型] d[float] e[int]
  2782. [236] = function(caster, target, args, interval, skill)
  2783. local a = args[1]
  2784. local b = args[2]
  2785. local c = args[3]
  2786. local d = args[4]
  2787. local e = args[5]
  2788. BattleLogic.WaitForTrigger(interval, function ()
  2789. if target.roleData.professionId == a then
  2790. local buffPro = Buff.Create(caster, BuffName.PropertyChange, e, BattlePropList[b], d, c)
  2791. caster:AddBuff(buffPro)
  2792. end
  2793. end)
  2794. end,
  2795. --> 按职业和属性提高伤害
  2796. --> 若目标是[a]职业,则额外造成目标属性[b][c]%的伤害(不超过攻击的[d]倍)
  2797. --> a[职业] b[属性] c[float] d[int]
  2798. [237] = function(caster, target, args, interval, skill)
  2799. local a = args[1]
  2800. local b = args[2]
  2801. local c = args[3]
  2802. local d = args[4]
  2803. BattleLogic.WaitForTrigger(interval, function ()
  2804. if target.roleData.professionId == a then
  2805. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  2806. if not target:IsDead() then
  2807. local dmg = min(floor(target:GetRoleData(BattlePropList[b]) * c), floor(target:GetRoleData(RoleDataName.Attack) * d))
  2808. damagingFunc(-dmg)
  2809. end
  2810. end
  2811. target.Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2812. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2813. target.Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2814. end)
  2815. end
  2816. end)
  2817. end,
  2818. --> 按职业直接提高伤害
  2819. --> 若目标是[a]职业,则伤害提高[b]%
  2820. --> a[职业] b[float]
  2821. [238] = function(caster, target, args, interval, skill)
  2822. local a = args[1]
  2823. local b = args[2]
  2824. local c = args[3]
  2825. local d = args[4]
  2826. BattleLogic.WaitForTrigger(interval, function ()
  2827. if target.roleData.professionId == a then
  2828. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  2829. if not target:IsDead() then
  2830. local upDmg = floor(BattleUtil.FP_Mul(damage, b))
  2831. damagingFunc(-upDmg)
  2832. end
  2833. end
  2834. target.Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2835. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2836. target.Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2837. end)
  2838. end
  2839. end)
  2840. end,
  2841. --> 按控制状态临时改属性
  2842. --> 若目标有[a]控制状态,则属性[b][c]改变[d]%
  2843. --> a[控制状态] b[属性] c[改变类型] d[float]
  2844. [239] = function(caster, target, args, interval, skill)
  2845. local a = args[1]
  2846. local b = args[2]
  2847. local c = args[3]
  2848. local d = args[4]
  2849. BattleLogic.WaitForTrigger(interval, function ()
  2850. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function(buff)
  2851. return buff.ctrlType == a
  2852. end)
  2853. if isHave then
  2854. local buffPro = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[b], d, c)
  2855. target:AddBuff(buffPro)
  2856. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function ()
  2857. BattleLogic.BuffMgr:ClearBuff(target, function (buff)
  2858. return buff == buffPro
  2859. end)
  2860. end)
  2861. end
  2862. end)
  2863. end,
  2864. --> 按属性状态临时改属性
  2865. --> 若目标有[a]属性状态,则属性[b][c]改变[d]%
  2866. --> a[属性状态] b[属性] c[改变类型] d[float]
  2867. [240] = function(caster, target, args, interval, skill)
  2868. local a = args[1]
  2869. local b = args[2]
  2870. local c = args[3]
  2871. local d = args[4]
  2872. BattleLogic.WaitForTrigger(interval, function ()
  2873. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.PropertyChange, function(buff)
  2874. return buff.propertyChangeType == a
  2875. end)
  2876. if isHave then
  2877. local buffPro = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[b], d, c)
  2878. target:AddBuff(buffPro)
  2879. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function ()
  2880. BattleLogic.BuffMgr:ClearBuff(target, function (buff)
  2881. return buff == buffPro
  2882. end)
  2883. end)
  2884. end
  2885. BattleUtil.CalDamage(skill, caster, target, b, a)
  2886. end)
  2887. end,
  2888. --> 按控制状态暴击
  2889. --> 若目标有[a]控制状态,则必定暴击
  2890. --> a[控制状态]
  2891. [241] = function(caster, target, args, interval, skill)
  2892. local a = args[1]
  2893. BattleLogic.WaitForTrigger(interval, function ()
  2894. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function(buff)
  2895. return buff.ctrlType == a
  2896. end)
  2897. if isHave then
  2898. target.isFlagCrit = true
  2899. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2900. if not target:IsDead() then
  2901. target.isFlagCrit = false
  2902. end
  2903. end)
  2904. end
  2905. end)
  2906. end,
  2907. --> 按dot加控制状态
  2908. --> 若目标有[a]或[b]持续伤害状态,[c]%概率附加[d]控制状态[e]回合
  2909. --> a[持续伤害状态] b[持续伤害状态] c[float] d[控制状态] e[int]
  2910. [242] = function(caster, target, args, interval, skill)
  2911. local a = args[1]
  2912. local b = args[2]
  2913. local c = args[3]
  2914. local d = args[4]
  2915. local e = args[5]
  2916. BattleLogic.WaitForTrigger(interval, function ()
  2917. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff)
  2918. return buff.damageType == a or buff.damageType == b
  2919. end)
  2920. if isHave then
  2921. BattleUtil.RandomAction(c, function()
  2922. BattleUtil.RandomControl(c, d, caster, target, e)
  2923. end)
  2924. end
  2925. end)
  2926. end,
  2927. --> 有属性状态加控制状态
  2928. --> 若目标有[a]属性状态,则[b]%概率给目标附加[c]控制状态[d]回合
  2929. --> a[属性状态] b[float] c[控制状态] d[int]
  2930. [230] = function(caster, target, args, interval, skill)
  2931. local a = args[1]
  2932. local b = args[2]
  2933. local c = args[3]
  2934. local d = args[4]
  2935. BattleLogic.WaitForTrigger(interval, function ()
  2936. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.PropertyChange, function(buff)
  2937. return buff.propertyChangeType == a
  2938. end)
  2939. if isHave then
  2940. BattleUtil.RandomControl(b, c, caster, target, d)
  2941. end
  2942. end)
  2943. end,
  2944. --> 伤害均摊
  2945. --> 在场所有敌人平摊伤害(单体伤害不超过自身属性[a][b]倍)
  2946. --> a[属性] b[int]
  2947. [244] = function(caster, target, args, interval, skill)
  2948. local a = args[1]
  2949. local b = args[2]
  2950. BattleLogic.WaitForTrigger(interval, function ()
  2951. local list RoleManager.Query(function (r) return r.camp == target.camp end)
  2952. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  2953. if not target:IsDead() and list and #list > 0 then
  2954. local avgDmg = damage / max(#list, 1)
  2955. avgDmg = min(floor(target:GetRoleData(BattlePropList[a]) * b), avgDmg)
  2956. damagingFunc(damage - avgDmg)
  2957. for i=1, #list do
  2958. if list[i].uid ~= target.uid then
  2959. BattleUtil.ApplyDamage(skill, caster, list[i], avgDmg)
  2960. end
  2961. end
  2962. end
  2963. end
  2964. target.Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2965. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  2966. target.Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  2967. end)
  2968. end)
  2969. end,
  2970. --> 无视控制
  2971. --> 施放此技能时无视控制,驱散自身所有负面效果,免疫所有控制[a]回合
  2972. --> a[int]
  2973. [245] = function(caster, target, args, interval, skill)
  2974. local a = args[1]
  2975. BattleLogic.WaitForTrigger(interval, function ()
  2976. end)
  2977. end,
  2978. --> 随机制衡
  2979. --> 随机从攻击、防御、速度抽取一种制衡属性,从目标中选择一名制衡属性最高的敌方武将[a]改变类型其[a]%的相应属性[b]回合
  2980. --> a[改变类型] b[float] c[属性]
  2981. [246] = function(caster, target, args, interval, skill)
  2982. local a = args[1]
  2983. BattleLogic.WaitForTrigger(interval, function ()
  2984. end)
  2985. end,
  2986. --> 随机负面状态
  2987. --> 随机从降疗[a]%、减命中[b]%、减攻[c]%、中毒4个负面状态中选择[d]个状态给目标,持续[e]回合
  2988. --> a[float] b[float] c[float] d[int]
  2989. [247] = function(caster, target, args, interval, skill)
  2990. local a = args[1]
  2991. local b = args[2]
  2992. local c = args[3]
  2993. local d = args[4]
  2994. local e = args[5]
  2995. BattleLogic.WaitForTrigger(interval, function ()
  2996. local randarr = {
  2997. RoleDataName.CureFacter,
  2998. RoleDataName.Hit,
  2999. RoleDataName.Attack,
  3000. }
  3001. local fp = {
  3002. a,
  3003. b,
  3004. c,
  3005. }
  3006. local rand = Random.RangeInt(1, 4)
  3007. local rA = {1, 2, 3, 4}
  3008. local randV = {}
  3009. for _i = 1, min(d, 4) do
  3010. local _idx = Random.RangeInt(1, #rA)
  3011. table.insert(randV, rA[_idx])
  3012. table.remove(rA, _idx)
  3013. end
  3014. for _i = 1, #randV do
  3015. local randone = randV[_i]
  3016. if randone == 4 then
  3017. local buffPro = Buff.Create(caster, BuffName.DOT, e, 1, DotType.Poison, 2)
  3018. target:AddBuff(buffPro)
  3019. else
  3020. local buffPro = Buff.Create(caster, BuffName.PropertyChange, e, BattlePropList[randarr[randone]], fp[randone], 4)
  3021. target:AddBuff(buffPro)
  3022. end
  3023. end
  3024. end)
  3025. end,
  3026. --> 偷属性
  3027. --> 偷取属性[a]的[b]%,使目标该属性[c]改变, 自己该属性[d]改变, 持续[e]回合
  3028. --> a[属性] b[float] c[改变类型] d[改变类型] e[int]
  3029. [248] = function(caster, target, args, interval, skill)
  3030. local a = args[1]
  3031. local b = args[2]
  3032. local c = args[3]
  3033. local d = args[4]
  3034. local e = args[5]
  3035. BattleLogic.WaitForTrigger(interval, function ()
  3036. local stealpro = floor(target:GetRoleData(BattlePropList[a]) * b)
  3037. local buffPro = Buff.Create(caster, BuffName.PropertyChange, e, BattlePropList[a], stealpro, c)
  3038. buffPro.isEveryRound = true
  3039. target:AddBuff(buffPro)
  3040. buffPro = Buff.Create(caster, BuffName.PropertyChange, e, BattlePropList[a], stealpro, d)
  3041. buffPro.isEveryRound = true
  3042. caster:AddBuff(buffPro)
  3043. end)
  3044. end,
  3045. --> 多段伤害
  3046. --> 造成([a]%+目标损失血量百分比的[b]%)/ [c] 的[d]伤害
  3047. --> a[float] b[float] c[int] d[伤害类型]
  3048. [250] = function(caster, target, args, interval, skill)
  3049. local a = args[1]
  3050. local b = args[2]
  3051. local c = args[3]
  3052. local d = args[4]
  3053. local e = args[5]
  3054. BattleLogic.WaitForTrigger(interval, function ()
  3055. -- BattleUtil.CalDamage(skill, caster, target, d, a)
  3056. end)
  3057. end,
  3058. --> 属性状态
  3059. --> [a]%概率为[b]目标附加[c]属性状态[d]改变[e]%,[f]回合
  3060. --> a[float] b[目标] c[属性状态] d[改变类型] e[float] f[int]
  3061. [254] = function(caster, target, args, interval, skill)
  3062. local a = args[1]
  3063. local b = args[2]
  3064. local c = args[3]
  3065. local d = args[4]
  3066. local e = args[5]
  3067. local f = args[6]
  3068. BattleLogic.WaitForTrigger(interval, function ()
  3069. BattleUtil.RandomAction(a, function()
  3070. local changeProperty = function(_role, _a, _b, _c, _d)
  3071. local buff = Buff.Create(caster, BuffName.PropertyChange, _a, BattlePropList[_b], _c, _d)
  3072. _role:AddBuff(buff)
  3073. end
  3074. if b == 1 then
  3075. changeProperty(target, f, c, e, d)
  3076. elseif b == 2 then
  3077. changeProperty(caster, f, c, e, d)
  3078. elseif b == 3 then
  3079. changeProperty(target, f, c, e, d)
  3080. changeProperty(caster, f, c, e, d)
  3081. end
  3082. end)
  3083. end)
  3084. end,
  3085. --> 挑衅
  3086. --> [a]%概率附加挑衅,持续[b]回合
  3087. --> a[float] b[int]
  3088. [255] = function(caster, target, args, interval, skill)
  3089. local a = args[1]
  3090. local b = args[2]
  3091. BattleLogic.WaitForTrigger(interval, function ()
  3092. BattleUtil.RandomControl(a, ControlType.LockTarget, caster, target, b)
  3093. end)
  3094. end,
  3095. --> 挑衅,条件提高概率
  3096. --> [a]%概率附加挑衅, 如果目标有[b]属性状态, 概率提高[c]%,持续[d]回合
  3097. --> a[float] b[属性状态] c[float] d[int]
  3098. [256] = function(caster, target, args, interval, skill)
  3099. local a = args[1]
  3100. local b = args[2]
  3101. local c = args[3]
  3102. local d = args[4]
  3103. BattleLogic.WaitForTrigger(interval, function ()
  3104. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.PropertyChange, function(buff)
  3105. return buff.propertyChangeType == b
  3106. end)
  3107. local _a = a
  3108. if isHave then
  3109. _a = _a + _a * c
  3110. end
  3111. BattleUtil.RandomControl(_a, ControlType.LockTarget, caster, target, d)
  3112. end)
  3113. end,
  3114. --> 属性状态+属性变化
  3115. --> [a]%概率为[b]目标附加[c]属性状态[d]改变[e]%,且使属性[f][g]改变[h]%,[i]回合
  3116. --> a[float] b[目标] c[属性状态] d[改变类型] e[float] f[属性] g[改变类型] h[float] i[int]
  3117. [259] = function(caster, target, args, interval, skill)
  3118. local a = args[1]
  3119. local b = args[2]
  3120. local c = args[3]
  3121. local d = args[4]
  3122. local e = args[5]
  3123. local f = args[6]
  3124. local g = args[7]
  3125. local h = args[8]
  3126. local i = args[9]
  3127. BattleLogic.WaitForTrigger(interval, function ()
  3128. BattleUtil.RandomAction(a, function()
  3129. local changePropertyStatus = function(_role, _a, _b, _c, _d)
  3130. local buff = Buff.Create(caster, BuffName.PropertyChange, _a, BattlePropList[PropertyChangeTypeMap[_b]], _c, _d, _b)
  3131. _role:AddBuff(buff)
  3132. end
  3133. local changeProperty = function(_role, _a, _b, _c, _d)
  3134. local buff = Buff.Create(caster, BuffName.PropertyChange, _a, BattlePropList[_b], _c, _d)
  3135. _role:AddBuff(buff)
  3136. end
  3137. if b == 1 then
  3138. changePropertyStatus(target, i, c, e, d)
  3139. changeProperty(target, i, f, h, g)
  3140. elseif b == 2 then
  3141. changePropertyStatus(caster, i, c, e, d)
  3142. changeProperty(caster, i, f, h, g)
  3143. elseif b == 3 then
  3144. changePropertyStatus(target, i, c, e, d)
  3145. changeProperty(target, i, f, h, g)
  3146. changePropertyStatus(caster, i, c, e, d)
  3147. changeProperty(caster, i, f, h, g)
  3148. end
  3149. end)
  3150. end)
  3151. end,
  3152. --> 临时改属性
  3153. --> [a]%概率使[b]目标的属性[c][d]改变[e]%
  3154. --> a[float] b[目标类型] c[属性] d[改变类型] e[float]
  3155. [260] = function(caster, target, args, interval, skill)
  3156. local a = args[1]
  3157. local b = args[2]
  3158. local c = args[3]
  3159. local d = args[4]
  3160. local e = args[5]
  3161. BattleLogic.WaitForTrigger(interval, function ()
  3162. BattleUtil.RandomAction(a, function()
  3163. local changeProperty = function(_role, _a, _b, _c, _d)
  3164. local buff = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[_b], _c, _d)
  3165. _role:AddBuff(buff)
  3166. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  3167. buff.disperse = true
  3168. end)
  3169. end
  3170. if b == 1 then
  3171. changeProperty(target, nil, c, e, d)
  3172. elseif b == 2 then
  3173. changeProperty(caster, nil, c, e, d)
  3174. elseif b == 3 then
  3175. changeProperty(target, nil, c, e, d)
  3176. changeProperty(caster, nil, c, e, d)
  3177. end
  3178. end)
  3179. end)
  3180. end,
  3181. --> 加dot
  3182. --> [a]%概率给目标附加[b]持续伤害状态, 每回合损失施法者[c]属性[d]%的生命, 持续[e]回合
  3183. --> a[float] b[持续伤害状态] c[属性] d[float] e[int]
  3184. [261] = function(caster, target, args, interval, skill)
  3185. local a = args[1]
  3186. local b = args[2]
  3187. local c = args[3]
  3188. local d = args[4]
  3189. local e = args[5]
  3190. BattleLogic.WaitForTrigger(interval, function ()
  3191. BattleUtil.RandomAction(a, function()
  3192. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[c]), d))
  3193. local dot = Buff.Create(caster, BuffName.DOT, e, 1, b, val, 1)
  3194. dot.isRealDamage = true
  3195. target:AddBuff(dot)
  3196. end)
  3197. end)
  3198. end,
  3199. --> 按dot暴击
  3200. --> 若目标有[a]或[b]持续伤害状态,则暴击
  3201. --> a[持续伤害状态] b[持续伤害状态]
  3202. [262] = function(caster, target, args, interval, skill)
  3203. local a = args[1]
  3204. local b = args[2]
  3205. local c = args[3]
  3206. local d = args[4]
  3207. local e = args[5]
  3208. BattleLogic.WaitForTrigger(interval, function ()
  3209. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff)
  3210. return buff.damageType == a or buff.damageType == b
  3211. end)
  3212. if isHave then
  3213. target.isFlagCrit = true
  3214. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  3215. if not target:IsDead() then
  3216. target.isFlagCrit = false
  3217. end
  3218. end)
  3219. end
  3220. end)
  3221. end,
  3222. --> 反伤效果
  3223. --> 为目标附加反伤效果,反弹[a]%伤害, 持续[b]回合
  3224. --> a[float] b[int]
  3225. [263] = function(caster, target, args, interval, skill)
  3226. local a = args[1]
  3227. local b = args[2]
  3228. BattleLogic.WaitForTrigger(interval, function ()
  3229. local lastTrigger = 0
  3230. local OnPassiveDamaging = function(damagingFunc, atkRole, damage)
  3231. lastTrigger = lastTrigger + 1
  3232. if lastTrigger > 1 then --加入限定避免循环触发
  3233. return
  3234. end
  3235. if not target:IsDead() then
  3236. local reboundDmg = floor(BattleUtil.FP_Mul(damage, a))
  3237. BattleUtil.ApplyDamage(skill, atkRole, caster, reboundDmg)
  3238. end
  3239. lastTrigger = 0
  3240. end
  3241. target.Event:AddEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  3242. local brand = Buff.Create(caster, BuffName.Brand, b, BrandType.ReBound, function ()
  3243. target.Event:RemoveEvent(BattleEventName.PassiveBeDamaging, OnPassiveDamaging)
  3244. end)
  3245. target:AddBuff(brand)
  3246. end)
  3247. end,
  3248. --> 按dot加属性
  3249. --> 若目标有[a]持续伤害状态,则[b]目标类型的[c]属性[d]改变类型[e]%
  3250. --> a[持续伤害状态] b[目标类型] c[属性] d[改变类型] e[float]
  3251. [264] = function(caster, target, args, interval, skill)
  3252. local a = args[1]
  3253. local b = args[2]
  3254. local c = args[3]
  3255. local d = args[4]
  3256. local e = args[5]
  3257. BattleLogic.WaitForTrigger(interval, function ()
  3258. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff)
  3259. return buff.damageType == a
  3260. end)
  3261. if isHave then
  3262. local changeProperty = function(_role, _a, _b, _c, _d)
  3263. local buff = Buff.Create(caster, BuffName.PropertyChange, 0, BattlePropList[_b], _c, _d)
  3264. _role:AddBuff(buff)
  3265. BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
  3266. buff.disperse = true
  3267. end)
  3268. end
  3269. if b == 1 then
  3270. changeProperty(target, nil, c, e, d)
  3271. elseif b == 2 then
  3272. changeProperty(caster, nil, c, e, d)
  3273. elseif b == 3 then
  3274. changeProperty(target, nil, c, e, d)
  3275. changeProperty(caster, nil, c, e, d)
  3276. end
  3277. end
  3278. end)
  3279. end,
  3280. --> 按dot加控制状态
  3281. --> 若目标有[a]或[b]持续伤害状态,则[c]%概率给[d]目标类型附加[e]控制状态, 持续[f]回合
  3282. --> a[持续伤害状态] b[持续伤害状态] c[float] d[目标类型] e[控制状态] f[int]
  3283. [265] = function(caster, target, args, interval, skill)
  3284. local a = args[1]
  3285. local b = args[2]
  3286. local c = args[3]
  3287. local d = args[4]
  3288. local e = args[5]
  3289. local f = args[6]
  3290. BattleLogic.WaitForTrigger(interval, function ()
  3291. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff)
  3292. return buff.damageType == a or buff.damageType == b
  3293. end)
  3294. if isHave then
  3295. BattleUtil.RandomAction(c, function()
  3296. local addcontrol = function(_role)
  3297. BattleUtil.RandomControl(c, e, caster, _role, f)
  3298. end
  3299. if d == 1 then
  3300. addcontrol(target)
  3301. elseif d == 2 then
  3302. addcontrol(caster)
  3303. elseif d == 3 then
  3304. addcontrol(target)
  3305. addcontrol(caster)
  3306. end
  3307. end)
  3308. end
  3309. end)
  3310. end,
  3311. --> 支援特定**************************
  3312. --> 神兵绝对伤害
  3313. --> 造成[a]的绝对伤害(不走公式,直接削减目标血量或护盾值)
  3314. --> a[int]
  3315. [272] = function(caster, target, args, interval, skill)
  3316. local a = args[1]
  3317. BattleLogic.WaitForTrigger(interval, function ()
  3318. BattleUtil.ApplyDamage(skill, caster, target, a)
  3319. end)
  3320. end,
  3321. --> 神兵流血伤害
  3322. --> [a]%概率给目标附加[b]持续伤害状态, 每回合损失固定[c]数量的生命, 持续[d]回合
  3323. --> a[float] b[持续伤害状态] c[int] d[int]
  3324. [273] = function(caster, target, args, interval, skill)
  3325. local a = args[1]
  3326. local b = args[2]
  3327. local c = args[3]
  3328. local d = args[4]
  3329. BattleLogic.WaitForTrigger(interval, function ()
  3330. BattleUtil.RandomAction(a, function()
  3331. local dot = Buff.Create(caster, BuffName.DOT, d, 1, b, c, 1)
  3332. dot.isRealDamage = true
  3333. target:AddBuff(dot)
  3334. end)
  3335. end)
  3336. end,
  3337. --> 神兵伤害吸收盾
  3338. --> [a]改变携带者的[b]属性[c]%的伤害吸收盾,持续[d]回合
  3339. --> a[改变类型] b[属性] c[float] d[int]
  3340. [274] = function(caster, target, args, interval, skill)
  3341. local a = args[1]
  3342. local b = args[2]
  3343. local c = args[3]
  3344. local d = args[4]
  3345. BattleLogic.WaitForTrigger(interval, function ()
  3346. BattleUtil.RandomAction(a, function()
  3347. local val = floor(BattleUtil.FP_Mul(caster:GetRoleData(BattlePropList[b]), c))
  3348. local shield = Buff.Create(caster, BuffName.Shield, d, ShieldTypeName.NormalReduce, val, 0)
  3349. target:AddBuff(shield)
  3350. end)
  3351. end)
  3352. end,
  3353. --> 神兵昏迷无视抗控
  3354. --> [a]%概率[b]控制状态,持续[c]回合(无视抗控)
  3355. --> a[float] b[控制状态] c[int]
  3356. [275] = function(caster, target, args, interval, skill)
  3357. local a = args[1]
  3358. local b = args[2]
  3359. local c = args[3]
  3360. local d = args[4]
  3361. BattleLogic.WaitForTrigger(interval, function ()
  3362. BattleUtil.RandomControl(a, b, caster, target, c)
  3363. end)
  3364. end,
  3365. --> 按dot改属性
  3366. --> 若目标有[a]持续伤害状态,则[b]目标类型的[c]属性[d]改变类型[e]%,持续[f]回合
  3367. --> a[持续伤害状态] b[目标类型] c[属性] d[改变类型] e[float] f[int]
  3368. [276] = function(caster, target, args, interval, skill)
  3369. local a = args[1]
  3370. local b = args[2]
  3371. local c = args[3]
  3372. local d = args[4]
  3373. local e = args[5]
  3374. local f = args[6]
  3375. BattleLogic.WaitForTrigger(interval, function ()
  3376. local isHave = BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff)
  3377. return buff.damageType == a
  3378. end)
  3379. if isHave then
  3380. local changeProperty = function(_role, _a, _b, _c, _d)
  3381. local buff = Buff.Create(caster, BuffName.PropertyChange, f, BattlePropList[_b], _c, _d)
  3382. _role:AddBuff(buff)
  3383. end
  3384. if b == 1 then
  3385. changeProperty(target, nil, c, e, d)
  3386. end
  3387. end
  3388. end)
  3389. end,
  3390. }
  3391. return effectList