代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
一五三.蓝色魔杖升级版(一打冻住一大片)
用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/staff.lua文件,将下列内容:
local function onattack_blue(inst, attacker, target)
if attacker and attacker.components.sanity then
attacker.components.sanity:DoDelta(-TUNING.SANITY_SUPERTINY)
end
if target.components.freezable then
target.components.freezable:AddColdness(1)
target.components.freezable:SpawnShatterFX()
end
替换为:
local function onattack_blue(inst, attacker, target)
local pos = Vector3(target.Transform:GetWorldPosition())
local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 15)
for k,v in pairs(ents) do
if v.components.freezable and not v:HasTag("player") then
v.components.freezable:AddColdness(10)
v.components.freezable:SpawnShatterFX()
end
end
即可让蓝色魔杖冻住一大片敌人,将其中15调整为更大数字,就可以加大冻住敌人的范围