function zcyclop_stun(damage,addrage,attacker,receiver,minmax) //定义函数,函数名就是 posthitmaster= 后接的函数名~~废话。。 if minmax==0 and damage>0 then //minmax的逻辑判断,照搬就好~~
local stun=tonumber(Attack.get_custom_param("stun")) //从调用本函数的原函数的custom_param代码段中读取“stun”的值(这里就是取zcyclop.atom文件 stun {}中的custom_param{}的stun值),赋给stun PS:这个API函数很重要,可以实现.lua和.atom代码的互动,实现更多功能(个人感觉有了它,无所不能。。。) if stun~=nil then local rnd=Game.CurLocRand(1,100) //取1~100的一个随机数 if rnd<=stun then effect_stun_attack(receiver,0,2) //调用effect_stun_attack函数(游戏原有的 晕眩 处理函数,代码在spell_effects.lua文件里) return -damage,addrage end
end
end
return damage,addrage
end 总之利用这个接口,大家就尽情发挥想象力吧~~~~