[分享]饥荒联机版,支持局域网联机。

YN130-眼睛炮塔建在地上后可搬运

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三0.眼睛炮塔建在地上后可搬运 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/eyeturret.lua文件, 5 6 1.在inst:AddComponent("inventoryitem")的下一行插入以下内容: 7 8 inst:AddComponent("stackable") 9 inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM 10 11 12 2.将下列内容: 13 14 inst.components.health:SetMaxHealth(TUNING.EYETURRET_HEALTH) 15 inst.components.health:StartRegen(TUNING.EYETURRET_REGEN, 1) 16 17 inst:AddComponent("combat") 18 inst.components.combat:SetRange(TUNING.EYETURRET_RANGE) 19 inst.components.combat:SetDefaultDamage(TUNING.EYETURRET_DAMAGE) 20 21 替换为: 22 23 inst.components.health:SetMaxHealth(TUNING.EYETURRET_HEALTH*10) 24 inst.components.health:StartRegen(TUNING.EYETURRET_REGEN*10, 1) 25 inst:AddComponent("combat") 26 inst.components.combat:SetRange(TUNING.EYETURRET_RANGE) 27 inst.components.combat:SetDefaultDamage(TUNING.EYETURRET_DAMAGE*10) 28local function turnon(inst) 29 inst.components.machine.ison = true 30 inst:Remove() 31 SpawnPrefab("eyeturret_item").Transform:SetPosition(inst.Transform:GetWorldPosition()) 32end 33 inst:AddComponent("machine") 34 inst.components.machine.turnonfn = turnon 35 36 即可在眼睛炮塔建在地上后仍能搬运,对其按鼠标右键即可解除部署,再按鼠标左键即可带走,到别处重新部署吧。另外将眼睛炮塔的生命值、回血效率、攻击力均提高了10倍,并且可堆叠

2025/04/23 · Bny

YN131-眼睛炮塔一次造10个(无须犀牛角、巨鹿眼球)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三一.眼睛炮塔一次造10个(无须犀牛角、巨鹿眼球) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/recipes.lua文件,将Recipe("eyeturret_item", {Ingredient("deerclops_eyeball", 1), Ingredient("minotaurhorn", 1), Ingredient("thulecite", 5)}, RECIPETABS.ANCIENT, TECH.ANCIENT_FOUR, nil, nil, true)替换为以下内容: 5 6Recipe("eyeturret_item", {Ingredient("thulecite", 5)}, RECIPETABS.ANCIENT, TECH.ANCIENT_FOUR, nil, nil, nil,10) 7 8 即可在远古选项(画着远古祭坛)下用5个铥矿石一次造10个眼睛炮塔,不需要靠近远古遗迹就可制造

2025/04/23 · Bny

YN132-靠近盆栽可补脑、可采蜂蜜,盆栽会发光

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三二.靠近盆栽可补脑、可采蜂蜜,盆栽会发光 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/pottedfern.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6 inst:AddTag("flower") 7 inst:AddComponent("sanityaura") 8 inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL 9 inst:AddComponent("pickable") 10 inst.components.pickable.picksound = "dontstarve/wilson/pickup_plants" 11 inst.components.pickable:SetUp("honey", 30) 12 local light = inst.entity:AddLight() 13 light:SetFalloff(0.5) 14 light:SetIntensity(.8) 15 light:SetRadius(1.0) 16 light:SetColour(146/255, 225/255, 146/255) 17 light:Enable(true) 18 19 即可靠近盆栽可补脑、可采蜂蜜(30秒生一次),还会招蜂引蝶,发出微光,让你的家多一份温馨。盆栽在建造选项(画着锤子)下,用5个叶子、1个蜗牛壳碎片建造

2025/04/23 · Bny

YN133-牙齿陷阱自动重置(1秒自动重置)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三三.牙齿陷阱自动重置(1秒自动重置) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/trap_teeth.lua文件,在 inst.components.finiteuses:Use(1)的下一行插入以下内容: 5 6 end 7 if inst.components.mine then 8 inst:DoTaskInTime(1, function() inst.components.mine:Reset() end ) 9 10 即可让牙齿陷阱在触发后1秒钟自动重置。修改其中的1为任意数字,即可设置几秒钟自动重置

2025/04/23 · Bny

YN134-部署牙齿陷阱零距离

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三四.部署牙齿陷阱零距离 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/trap_teeth.lua文件,将inst.components.deployable.min_spacing = .75替换为inst.components.deployable.min_spacing = 0 5 6 即可在部署牙齿陷阱时没有最小距离限制

2025/04/23 · Bny

YN135-回旋镖自动接住且无限使用

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三五.回旋镖自动接住且无限使用 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/boomerang.lua文件, 5 6 1.在owner.SoundEmitter:PlaySound("dontstarve/wilson/boomerang_return")的下一行插入owner.components.inventory:Equip(inst) 7 8 9 2.将下列内容: 10 11 inst:AddComponent("finiteuses") 12 inst.components.finiteuses:SetMaxUses(TUNING.BOOMERANG_USES) 13 inst.components.finiteuses:SetUses(TUNING.BOOMERANG_USES) 14 15 inst.components.finiteuses:SetOnFinished(OnFinished) 16 17 替换为: 18 19 --inst:AddComponent("finiteuses") 20 --inst.components.finiteuses:SetMaxUses(TUNING.BOOMERANG_USES) 21 --inst.components.finiteuses:SetUses(TUNING.BOOMERANG_USES) 22 23 --inst.components.finiteuses:SetOnFinished(OnFinished) 24 25 即可让回旋镖自动接住且无限使用

2025/04/23 · Bny

YN136-装备回旋镖召唤猎物(打猎游戏)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三六.装备回旋镖召唤猎物(打猎游戏) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/boomerang.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function cancreatelight(staff, caster, target, pos) 7 local ground = GetWorld() 8 if ground and pos then 9 local tile = ground.Map:GetTileAtPoint(pos.x, pos.y, pos.z) 10 return tile ~= GROUND.IMPASSIBLE and tile < GROUND.UNDERGROUND 11 end 12 return false 13end 14local function createlight(staff, target, pos) 15 local names = {"crow","robin","robin_winter","frog","mosquito","bee","killerbee","butterfly","rabbit","babybeefalo"} 16 local name = names[math.random(#names)] 17 local prey = SpawnPrefab(name) 18 prey.Transform:SetPosition(pos.x, pos.y, pos.z) 19end 20 inst:AddComponent("spellcaster") 21 inst.components.spellcaster:SetSpellFn(createlight) 22 inst.components.spellcaster:SetSpellTestFn(cancreatelight) 23 inst.components.spellcaster.canuseonpoint = true 24 inst.components.spellcaster.canusefrominventory = false 25 26 即可在装备回旋镖后,在空地上点鼠标右键召唤猎物,包括鸟、昆虫、青蛙、兔子、小牛,尽情捕猎吧

2025/04/23 · Bny

YN137-一支吹箭用20次(按百分比使用)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三七.一支吹箭用20次(按百分比使用) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/blowdart.lua文件, 5 6 1.将下列内容: 7 8local function onhit(inst, attacker, target) 9 local impactfx = SpawnPrefab("impact") 10 if impactfx and attacker then 11 local follower = impactfx.entity:AddFollower() 12 follower:FollowSymbol(target.GUID, target.components.combat.hiteffectsymbol, 0, 0, 0 ) 13 impactfx:FacePoint(attacker.Transform:GetWorldPosition()) 14 end 15 inst:Remove() 16end 17 18 替换为: 19 20local function onfinished(inst) 21 inst:Remove() 22end 23local function onhit(inst, attacker, target) 24 local impactfx = SpawnPrefab("impact") 25 if impactfx and attacker then 26 local follower = impactfx.entity:AddFollower() 27 follower:FollowSymbol(target.GUID, target.components.combat.hiteffectsymbol, 0, 0, 0 ) 28 impactfx:FacePoint(attacker.Transform:GetWorldPosition()) 29 end 30 if inst.components.finiteuses.current > 0 then 31 if inst.prefab == "blowdart_walrus" then 32 inst:Remove() 33 else 34 attacker.components.inventory:Equip(inst) 35 end 36 end 37end 38 39 40 2.在inst:AddComponent("inspectable")的下一行插入以下内容: 41 42 inst:AddComponent("finiteuses") 43 inst.components.finiteuses:SetOnFinished( onfinished ) 44 inst.components.finiteuses:SetMaxUses(20) 45 inst.components.finiteuses:SetUses(20) 46 47 即可让一支吹箭使用20次,每次击中敌人后自动回到手中,可以修改其中2处数字20为想要的使用次数。不要与“吹箭无限使用(射中目标后自动回到手中)”一同修改

2025/04/23 · Bny

YN138-吹箭无限使用(射中目标后自动回到手中)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三八.吹箭无限使用(射中目标后自动回到手中) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/blowdart.lua文件,将下列内容: 5 6 impactfx:FacePoint(attacker.Transform:GetWorldPosition()) 7 end 8 inst:Remove() 9 10 替换为: 11 12 impactfx:FacePoint(attacker.Transform:GetWorldPosition()) 13 end 14 if inst.prefab == "blowdart_walrus" then 15 inst:Remove() 16 else 17 attacker.components.inventory:Equip(inst) 18 end 19 20 即可让吹箭射中目标后自动回到手中,不要与“一支吹箭用20次(按百分比使用)”一同修改

2025/04/23 · Bny

YN139-快速找到骨眼(骨眼在地图上显示)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一三九.快速找到骨眼(骨眼在地图上显示) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/chester_eyebone.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6 local minimap = inst.entity:AddMiniMapEntity() 7 minimap:SetIcon( "chester.png" ) 8 9 即可在地图上看到骨眼的位置,显示为切斯特,生出切斯特后,则地图上有两个切斯特图标,一个是切斯特,一个是骨眼

2025/04/23 · Bny