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

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



一八三.迷魂花阵(戴花环周围出现食人花眼睛保护主角)

	1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/hats.lua文件,将下列内容:

		inst:AddComponent("perishable")
		inst.components.perishable:SetPerishTime(TUNING.PERISH_FAST)
		inst.components.perishable:StartPerishing()
		inst.components.perishable:SetOnPerishFn(generic_perish)
		inst.components.equippable:SetOnEquip( opentop_onequip )

	替换为:

local function flower_equip(inst, owner)
	opentop_onequip(inst, owner)
	inst:AddComponent("minionspawner")
	inst.components.minionspawner.miniontype = "eyeplant"
	inst.components.minionspawner.maxminions = 27
	inst.components.minionspawner.minionspawntime = {min = 0.01, max = 0.01}
	inst.components.minionspawner.numminions = 10
	inst.components.minionspawner.shouldspawn = true
	inst.components.minionspawner:StartNextSpawn()
end
local function flower_unequip(inst, owner)
	onunequip(inst, owner)
	inst.components.minionspawner.shouldspawn = false
	inst.components.minionspawner:KillAllMinions()
	inst:RemoveComponent("minionspawner")
end
	inst.components.equippable:SetOnEquip( flower_equip )
	inst.components.equippable:SetOnUnequip( flower_unequip )


	2.用MT管理器打开游戏目录/assets/scripts/prefabs/eyeplant.lua文件,将下列内容:

			return (guy:HasTag("character") or guy:HasTag("monster") or guy:HasTag("animal") or guy:HasTag("prey") or guy:HasTag("eyeplant") or guy:HasTag("lureplant")) and not checkmaster(guy, inst)

	替换为:

			return (guy:HasTag("character") or guy:HasTag("monster") or guy:HasTag("animal") or guy:HasTag("prey") or guy:HasTag("eyeplant") or guy:HasTag("lureplant")) and not guy:HasTag("player") and not checkmaster(guy, inst)

	即可戴花环周围出现食人花眼睛保护主角,食人花眼睛被敌人打死一个又会再生一个。摘下花环,食人花眼睛立即消失