代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
一六八.电击枪(用橙色魔杖远程电晕敌人,使其任你宰割)
用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/staff.lua文件,将inst.components.blinkstaff.onblinkfn = onblink替换为以下内容:
local function onattack_orange(inst, owner, target)
if target.brain then
target.brain:Stop()
end
if target.components.combat then
target.components.combat:SetTarget(nil)
end
if target.components.locomotor then
target.components.locomotor:Stop()
end
target.AnimState:SetMultColour(125/255,125/255,125/255,1)
SpawnPrefab("lightning_rod_fx").Transform:SetPosition(target.Transform:GetWorldPosition())
end
inst:AddComponent("weapon")
inst.components.weapon:SetDamage(10)
inst.components.weapon:SetRange(20, 25)
inst.components.weapon:SetOnAttack(onattack_orange)
inst.components.weapon:SetProjectile("bishop_charge")
即可在装备橙色魔杖时,对敌人按鼠标左键将其电晕,其会失去行动能力,任你处置。对猴子、青蛙等比较讨厌的敌人很适用。橙色魔杖在远古选项(画着远古祭坛)下,用2个噩梦燃料、1个步行手杖、2个橙色宝石制造,制造时需要靠近远古祭坛