代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。

原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html


 1
 2一五三.蓝色魔杖升级版(一打冻住一大片)
 3
 4	MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/staff.lua文件,将下列内容:
 5
 6local function onattack_blue(inst, attacker, target)
 7
 8	if attacker and attacker.components.sanity then
 9		attacker.components.sanity:DoDelta(-TUNING.SANITY_SUPERTINY)
10	end
11	
12	if target.components.freezable then
13		target.components.freezable:AddColdness(1)
14		target.components.freezable:SpawnShatterFX()
15	end
16
17	替换为:
18
19local function onattack_blue(inst, attacker, target)
20	local pos = Vector3(target.Transform:GetWorldPosition())
21	local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 15)
22	for k,v in pairs(ents) do
23		if v.components.freezable and not v:HasTag("player") then
24		   v.components.freezable:AddColdness(10)
25		   v.components.freezable:SpawnShatterFX()
26		end
27	end
28
29	即可让蓝色魔杖冻住一大片敌人,将其中15调整为更大数字,就可以加大冻住敌人的范围