模组文件免费下载和使用,谨防上当受骗。

YN276-电动草叉(拿草叉自动铲起脚下的地皮)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七六.电动草叉(拿草叉自动铲起脚下的地皮) 用MT管理器打开游戏目录/assets/scripts/prefabs/pitchfork.lua文件,将下列内容: local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_pitchfork", "swap_pitchfork") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function onunequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end 替换为: local function pickup(inst, owner) local pt = owner:GetPosition() inst.components.terraformer:Terraform(pt) inst.SoundEmitter:PlaySound("dontstarve/wilson/dig") end local function onequip(inst, owner) if owner.components.inventory:Has("lightbulb", 1) then inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) owner.components.inventory:ConsumeByName("lightbulb", 1) end owner.AnimState:OverrideSymbol("swap_object", "swap_pitchfork", "swap_pitchfork") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function onunequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") if inst.task then inst.task:Cancel() inst.task = nil end end 即可拿草叉自动铲起脚下的地皮,效率极高,铲地的速度只取决于你走多快。电动草叉需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动铲地了

2025/04/23 · Bny

YN277-电动铺路铲(拿黄金铲自动将脚下的空地皮铺成路)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七七.电动铺路铲(拿黄金铲自动将脚下的空地皮铺成路) 用MT管理器打开游戏目录/assets/scripts/prefabs/shovel.lua文件, 1.将下列内容: local function onequipgold(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_goldenshovel", "swap_goldenshovel") owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end 替换为: local function pickup(inst, owner) inst.name = GROUND.ROAD local pt = owner:GetPosition() local ground = GetWorld() local tile = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z) if ground and tile == GROUND.DIRT then local original_tile_type = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z) local x, y = ground.Map:GetTileCoordsAtPoint(pt.x, pt.y, pt.z) if x and y then ground.Map:SetTile(x,y, inst.name) ground.Map:RebuildLayer( original_tile_type, x, y ) ground.Map:RebuildLayer( inst.name, x, y ) end local minimap = TheSim:FindFirstEntityWithTag("minimap") if minimap then minimap.MiniMap:RebuildLayer( original_tile_type, x, y ) minimap.MiniMap:RebuildLayer( inst.name, x, y ) end end inst.SoundEmitter:PlaySound("dontstarve/wilson/dig") end local function onequipgold(inst, owner) if owner.components.inventory:Has("lightbulb", 1) then inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) owner.components.inventory:ConsumeByName("lightbulb", 1) end owner.AnimState:OverrideSymbol("swap_object", "swap_goldenshovel", "swap_goldenshovel") owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function onunequipgold(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") if inst.task then inst.task:Cancel() inst.task = nil end end 2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold ) 即可拿黄金铲自动将脚下的空地皮铺成路,效率极高,铺路的速度只取决于你走多快。电动铺路铲需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能。将其中GROUND.ROAD(卵石路)替换为其他地皮名称,如GROUND.ROCKY(岩石地皮)、GROUND.DIRT(污垢地皮)、GROUND.SAVANNA(热带草原地皮)、GROUND.GRASS(长草地皮)、GROUND.FOREST(森林地皮)、GROUND.MARSH(沼泽地皮)、GROUND.WOODFLOOR(木质地板)、GROUND.CARPET(地毯地板)、GROUND.CHECKER(棋盘地板)、GROUND.CAVE(鸟粪地皮)、GROUND.FUNGUS(菌类地皮)、GROUND.FUNGUSRED(红菌类地皮)、GROUND.FUNGUSGREEN(绿菌类地皮)、GROUND.SINKHOLE(粘滑地皮)、GROUND.UNDERROCK(洞穴石地地皮)、GROUND.MUD(泥泞地皮),就可以自动铺其他地皮

2025/04/23 · Bny

YN278-地皮改造机(用排箫种地皮改造机,一次铺70块地皮)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七八.地皮改造机(用排箫种地皮改造机,一次铺70块地皮) 用MT管理器打开游戏目录/assets/scripts/prefabs/panflute.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function itemtest(inst, item, slot) if item.prefab == "turf_road" or item.prefab == "turf_rocky" or item.prefab == "turf_forest" or item.prefab == "turf_marsh" or item.prefab == "turf_grass" or item.prefab == "turf_savanna" or item.prefab == "turf_dirt" or item.prefab == "turf_woodfloor" or item.prefab == "turf_carpetfloor" or item.prefab == "turf_checkerfloor" or item.prefab == "turf_cave" or item.prefab == "turf_fungus" or item.prefab == "turf_fungus_red" or item.prefab == "turf_fungus_green" or item.prefab == "turf_sinkhole" or item.prefab == "turf_underrock" or item.prefab == "turf_mud" then return true end return false end local slotpos = { Vector3(0,-75,0)} local widgetbuttoninfo = { text = "Do", position = Vector3(0, -135, 0), fn = function(inst) if inst:HasTag("turfmachines") then if not inst.components.container:IsEmpty() then for k,v in pairs(inst.components.container.slots) do if v and v.prefab == "turf_road" then inst.rug = GROUND.ROAD end if v and v.prefab == "turf_rocky" then inst.rug = GROUND.ROCKY end if v and v.prefab == "turf_forest" then inst.rug = GROUND.FOREST end if v and v.prefab == "turf_marsh" then inst.rug = GROUND.MARSH end if v and v.prefab == "turf_grass" then inst.rug = GROUND.GRASS end if v and v.prefab == "turf_savanna" then inst.rug = GROUND.SAVANNA end if v and v.prefab == "turf_dirt" then inst.rug = GROUND.DIRT end if v and v.prefab == "turf_woodfloor" then inst.rug = GROUND.WOODFLOOR end if v and v.prefab == "turf_carpetfloor" then inst.rug = GROUND.CARPET end if v and v.prefab == "turf_checkerfloor" then inst.rug = GROUND.CHECKER end if v and v.prefab == "turf_cave" then inst.rug = GROUND.CAVE end if v and v.prefab == "turf_fungus" then inst.rug = GROUND.FUNGUS end if v and v.prefab == "turf_fungus_red" then inst.rug = GROUND.FUNGUSRED end if v and v.prefab == "turf_fungus_green" then inst.rug = GROUND.FUNGUSGREEN end if v and v.prefab == "turf_sinkhole" then inst.rug = GROUND.SINKHOLE end if v and v.prefab == "turf_underrock" then inst.rug = GROUND.UNDERROCK end if v and v.prefab == "turf_mud" then inst.rug = GROUND.MUD end v:Remove() end local pt = GetPlayer():GetPosition() for y = 10, 0, -1 do for x = 0, 10 do local tile = GetWorld().Map:GetTileAtPoint(pt.x-2.1*x+2.1*y-10.5+10.5, pt.y, pt.z+2.1*x+2.1*y-10.5-10.5) if tile ~= GROUND.IMPASSABLE then local original_tile_type = GetWorld().Map:GetTileAtPoint(pt.x-2.1*x+2.1*y-10.5+10.5, pt.y, pt.z+2.1*x+2.1*y-10.5-10.5) local x, y = GetWorld().Map:GetTileCoordsAtPoint(pt.x-2.1*x+2.1*y-10.5+10.5, pt.y, pt.z+2.1*x+2.1*y-10.5-10.5) GetWorld().Map:SetTile(x,y, inst.rug) GetWorld().Map:RebuildLayer( original_tile_type, x, y ) GetWorld().Map:RebuildLayer( inst.rug, x, y ) local minimap = TheSim:FindFirstEntityWithTag("minimap") minimap.MiniMap:RebuildLayer( original_tile_type, x, y ) minimap.MiniMap:RebuildLayer( inst.rug, x, y ) end end end end end end } local function OnDeploy (inst, pt) local turfmachine = SpawnPrefab("panflute") turfmachine.Transform:SetPosition(pt.x, pt.y, pt.z) turfmachine.AnimState:SetBank("researchlab3") turfmachine.AnimState:SetBuild("researchlab3") turfmachine.AnimState:PlayAnimation("idle") turfmachine.Transform:SetScale(0.5, 0.5, 0.5) turfmachine:RemoveComponent("instrument") turfmachine:RemoveComponent("tool") if turfmachine.components.finiteuses then turfmachine:RemoveComponent("finiteuses") end turfmachine:RemoveComponent("deployable") turfmachine.components.container.canbeopened = true turfmachine.components.inventoryitem:ChangeImageName("researchlab3") turfmachine:AddComponent("equippable") turfmachine.components.equippable.equipslot = EQUIPSLOTS.BODY turfmachine.components.equippable:SetOnEquip( function(turfmachine) GetPlayer().components.inventory:SetOverflow(turfmachine) turfmachine.components.container:Open(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_open", "open") end ) turfmachine.components.equippable:SetOnUnequip( function(turfmachine) turfmachine.components.container:Close(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_close", "open") end ) turfmachine:AddTag("turfmachines") inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("turfmachines") then data.turfmachines = true end end local function onload(inst, data) if data and data.turfmachines then inst.AnimState:SetBank("researchlab3") inst.AnimState:SetBuild("researchlab3") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.5, 0.5, 0.5) inst:RemoveComponent("instrument") inst:RemoveComponent("tool") if inst.components.finiteuses then inst:RemoveComponent("finiteuses") end inst:RemoveComponent("deployable") inst.components.container.canbeopened = true inst.components.inventoryitem:ChangeImageName("researchlab3") inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.BODY inst.components.equippable:SetOnEquip( function(inst) GetPlayer().components.inventory:SetOverflow(inst) inst.components.container:Open(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_open", "open") end ) inst.components.equippable:SetOnUnequip( function(inst) inst.components.container:Close(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_close", "open") end ) inst:AddTag("turfmachines") end end inst.OnSave = onsave inst.OnLoad = onload inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(-80,150,0) inst.components.container.side_widget = true inst.components.container.itemtestfn = itemtest inst.components.container.widgetbuttoninfo = widgetbuttoninfo inst.components.container.acceptsstacks = false inst.components.container.canbeopened = false 即可用排箫种地皮改造机,装备地皮改造机后,屏幕右侧将出现格子和按钮,在格子中放入1块地皮,按Do按钮,游戏会卡一下(5-10秒),70块地皮就铺好了,方便大面积改造地图。共支持17种地皮,只要可以放入格子的都可以铺。排箫在魔法选项(画着红骷髅)下用5个芦苇、1个曼德拉草、1个绳子制造

2025/04/23 · Bny

YN279-小型温室(用蝴蝶翅膀种小型温室,放入种子,10秒长出果实)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七九.小型温室(用蝴蝶翅膀种小型温室,放入种子,10秒长出果实) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/butterflywings.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function OnDeploy (inst, pt) local oven = SpawnPrefab("butterflywings") oven.Transform:SetPosition(pt.x, pt.y, pt.z) oven.AnimState:SetBank("skull_chest") oven.AnimState:SetBuild("skull_chest") oven.AnimState:PlayAnimation("closed") oven.Transform:SetScale(1.5, 1.5, 1.5) oven:AddTag("fridge") oven:AddTag("ovens") oven:RemoveComponent("edible") oven:RemoveComponent("tradable") oven:RemoveComponent("stackable") oven:RemoveComponent("inventoryitem") oven:RemoveComponent("perishable") oven:RemoveComponent("deployable") oven:RemoveTag("cattoy") oven:AddComponent("workable") oven.components.workable:SetWorkAction(ACTIONS.HAMMER) oven.components.workable:SetWorkLeft(3) oven.components.workable:SetOnFinishCallback(function(oven) SpawnPrefab("collapse_big").Transform:SetPosition(oven.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") oven:Remove() end ) oven.components.container.canbeopened = true inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("ovens") then data.ovens = true end end local function onload(inst, data) if data and data.ovens then inst.AnimState:SetBank("skull_chest") inst.AnimState:SetBuild("skull_chest") inst.AnimState:PlayAnimation("closed") inst.Transform:SetScale(1.5, 1.5, 1.5) inst:AddTag("fridge") inst:AddTag("ovens") inst:RemoveComponent("edible") inst:RemoveComponent("tradable") inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst:RemoveTag("cattoy") inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") inst:Remove() end ) inst.components.container.canbeopened = true end end local function itemtest(inst, item, slot) if item.prefab == "carrot" or item.prefab == "corn" or item.prefab == "pumpkin" or item.prefab == "eggplant" or item.prefab == "durian" or item.prefab == "pomegranate" or item.prefab == "dragonfruit" or item.prefab == "carrot_seeds" or item.prefab == "corn_seeds" or item.prefab == "pumpkin_seeds" or item.prefab == "eggplant_seeds" or item.prefab == "durian_seeds" or item.prefab == "pomegranate_seeds" or item.prefab == "dragonfruit_seeds" or item.prefab == "seeds" or item.prefab == "spoiled_food" or item.prefab == "lightbulb" or item.prefab == "watermelon_seeds" or item.prefab == "watermelon" then return true end return false end local slotpos = {} for y = 2, 0, -1 do for x = 0, 14 do table.insert(slotpos, Vector3(75*x-75*2+75, 75*y-75*2+75,0)) end end inst.OnSave = onsave inst.OnLoad = onload inst:AddComponent("container") local widgetbuttoninfo = { text = "Start", position = Vector3(450, -150, 0), fn = function(inst) if inst:HasTag("ovens") and inst.components.container:Has("lightbulb", 1) then inst.components.container:ConsumeByName("lightbulb", 1) inst.components.container:Close(GetPlayer()) inst.components.container.canbeopened = false inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:DoTaskInTime(10, function() inst.AnimState:SetBloomEffectHandle("") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") inst.components.container.canbeopened = true for k,v in pairs(inst.components.container.slots) do if v and v.prefab == "carrot_seeds" then v:Remove() local carrot = SpawnPrefab("carrot") inst.components.container:GiveItem(carrot) end if v and v.prefab == "corn_seeds" then v:Remove() local corn = SpawnPrefab("corn") inst.components.container:GiveItem(corn) end if v and v.prefab == "pumpkin_seeds" then v:Remove() local pumpkin = SpawnPrefab("pumpkin") inst.components.container:GiveItem(pumpkin) end if v and v.prefab == "eggplant_seeds" then v:Remove() local eggplant = SpawnPrefab("eggplant") inst.components.container:GiveItem(eggplant) end if v and v.prefab == "durian_seeds" then v:Remove() local durian = SpawnPrefab("durian") inst.components.container:GiveItem(durian) end if v and v.prefab == "pomegranate_seeds" then v:Remove() local pomegranate = SpawnPrefab("pomegranate") inst.components.container:GiveItem(pomegranate) end if v and v.prefab == "dragonfruit_seeds" then v:Remove() local dragonfruit = SpawnPrefab("dragonfruit") inst.components.container:GiveItem(dragonfruit) end if v and v.prefab == "watermelon_seeds" then v:Remove() local watermelon = SpawnPrefab("watermelon") inst.components.container:GiveItem(watermelon) end if v and v.prefab == "seeds" then v:Remove() local names = {"carrot","corn","pumpkin","eggplant","durian","pomegranate","dragonfruit","watermelon"} local name = names[math.random(#names)] local fruit = SpawnPrefab(name) inst.components.container:GiveItem(fruit) end if v.prefab == "carrot" or v.prefab == "corn" or v.prefab == "pumpkin" or v.prefab == "eggplant" or v.prefab == "durian" or v.prefab == "pomegranate" or v.prefab == "dragonfruit" or v.prefab == "watermelon" then v:Remove() local spoiled = SpawnPrefab("spoiled_food") inst.components.container:GiveItem(spoiled) end end end ) end end } inst.components.container.widgetbuttoninfo = widgetbuttoninfo inst.components.container.acceptsstacks = false inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(-250,200,0) inst.components.container.side_align_tip = 160 inst.components.container.canbeopened = false inst.components.container.itemtestfn = itemtest inst.components.container.onopenfn = function(inst) inst.AnimState:PlayAnimation("open") end inst.components.container.onclosefn = function(inst) inst.AnimState:PlayAnimation("close") end 即可用蝴蝶翅膀种小型温室(拿着1个蝴蝶翅膀对地面点鼠标右键,如果拿着多个,则不会种出来),无论冬夏都可种植农作物。鼠标左键点小型温室,可打开格子。将种子放入格子,并放1个荧光果(提供电能)后,点格子下面的Start按钮,植物即开始生长(温室亮灯)。10秒后(温室灯灭)即可打开温室,收获你的果实吧。每次种植都将消耗1个荧光果,格子内没有荧光果时,温室不会工作。如果把果实留在格子内,并点Start按钮(仍须有荧光果),则10秒后果实变成腐烂食物,可用来快速生产肥料。不想要小型温室时,用锤子砸掉即可,记得先取出里面的物品哦。蝴蝶翅膀可打死蝴蝶获得

2025/04/23 · Bny

YN280-随身灭火器(用寒冬背心种随身灭火器,装备后可灭火)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八0.随身灭火器(用寒冬背心种随身灭火器,装备后可灭火) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/trunkvest.lua文件,在inst.AnimState:SetBuild("armor_trunkvest_winter")的下一行插入以下内容: local function OnDeploy2(inst, pt) local extinguisher = SpawnPrefab("trunkvest_winter") extinguisher.Transform:SetPosition(pt.x, pt.y, pt.z) extinguisher.AnimState:SetBank("firefighter") extinguisher.AnimState:SetBuild("firefighter") extinguisher.AnimState:PlayAnimation("idle_on_loop") extinguisher.Transform:SetScale(0.5, 0.5, 0.5) extinguisher:RemoveComponent("inventoryitem") extinguisher:RemoveComponent("equippable") extinguisher:RemoveComponent("insulator") extinguisher:RemoveComponent("fueled") extinguisher:RemoveComponent("deployable") extinguisher:AddComponent("workable") extinguisher.components.workable:SetWorkAction(ACTIONS.HAMMER) extinguisher.components.workable:SetWorkLeft(3) extinguisher.components.workable:SetOnFinishCallback(function(extinguisher) SpawnPrefab("collapse_big").Transform:SetPosition(extinguisher.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") extinguisher:Remove() end ) extinguisher:AddComponent("inventoryitem") extinguisher.components.inventoryitem:ChangeImageName("firesuppressor") extinguisher:AddComponent("equippable") extinguisher.components.equippable.equipslot = EQUIPSLOTS.HANDS extinguisher.components.equippable:SetOnEquip(function(extinguisher, owner) extinguisher.task = extinguisher:DoPeriodicTask(1, function(extinguisher) local waterring = SpawnPrefab("groundpoundring_fx") waterring.Transform:SetPosition(owner.Transform:GetWorldPosition()) waterring.AnimState:SetBloomEffectHandle("shaders/anim.ksh") local pos = Vector3(extinguisher.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 10) for k,v in pairs(ents) do if v.components.burnable and v.components.burnable:IsBurning() then if v.prefab == "cactus" or v.prefab == "berrybush" or v.prefab == "berrybush2" or v.prefab == "carrot_planted" or v.prefab == "cave_banana_tree" or v.prefab == "cave_fern" or v.prefab == "deciduoustree" or v.prefab == "deciduoustree_normal" or v.prefab == "deciduoustree_tall" or v.prefab == "deciduoustree_short" or v.prefab == "evergreen" or v.prefab == "evergreen_normal" or v.prefab == "evergreen_tall" or v.prefab == "evergreen_short" or v.prefab == "evergreen_sparse" or v.prefab == "evergreen_sparse_normal" or v.prefab == "evergreen_sparse_tall" or v.prefab == "evergreen_sparse_short" or v.prefab == "flower" or v.prefab == "flower_evil" or v.prefab == "grass" or v.prefab == "marsh_bush" or v.prefab == "red_mushroom" or v.prefab == "green_mushroom" or v.prefab == "blue_mushroom" or v.prefab == "mushtree_tall" or v.prefab == "mushtree_medium" or v.prefab == "mushtree_small" or v.prefab == "sapling" or v.prefab == "flower_cave" or v.prefab == "flower_cave_double" or v.prefab == "flower_cave_triple" or v.prefab == "lichen" or v.prefab == "livingtree" or v.prefab == "marsh_tree" or v.prefab == "reeds" then if v.components.propagator then v.components.propagator.spreading = false end SpawnPrefab("collapse_big").Transform:SetPosition(v.Transform:GetWorldPosition()) SpawnPrefab(v.prefab).Transform:SetPosition(v.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/fireOut") v:Remove() end if v.prefab == "treasurechest" or v.prefab == "slow_farmplot" or v.prefab == "fast_farmplot" or v.prefab == "tent" or v.prefab == "wall_wood" or v.prefab == "wall_hay" or v.prefab == "cookpot" or v.prefab == "beebox" or v.prefab == "homesign" or v.prefab == "researchlab" or v.prefab == "researchlab2" or v.prefab == "researchlab3" or v.prefab == "researchlab4" or v.prefab == "meatrack" or v.prefab == "pighouse" or v.prefab == "rabbithouse" or v.prefab == "pottedfern" or v.prefab == "rainometer" or v.prefab == "winterometer" or v.prefab == "resurrectionstatue" or v.prefab == "siestahut" then SpawnPrefab("collapse_big").Transform:SetPosition(v.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/fireOut") v.components.burnable:Extinguish(true) end end end end ) end ) extinguisher.components.equippable:SetOnUnequip(function(extinguisher, owner) if extinguisher.task then extinguisher.task:Cancel() extinguisher.task = nil end end ) extinguisher:AddTag("extinguishers") inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy2 local function onsave2(inst, data) if inst:HasTag("extinguishers") then data.extinguishers = true end end local function onload2(inst, data) if data and data.extinguishers then inst.AnimState:SetBank("firefighter") inst.AnimState:SetBuild("firefighter") inst.AnimState:PlayAnimation("idle_on_loop") inst.Transform:SetScale(0.5, 0.5, 0.5) inst:RemoveComponent("inventoryitem") inst:RemoveComponent("equippable") inst:RemoveComponent("insulator") inst:RemoveComponent("fueled") inst:RemoveComponent("deployable") inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") inst:Remove() end ) inst:AddComponent("inventoryitem") inst.components.inventoryitem:ChangeImageName("firesuppressor") inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.HANDS inst.components.equippable:SetOnEquip(function(inst, owner) inst.task = inst:DoPeriodicTask(1, function(inst) local waterring = SpawnPrefab("groundpoundring_fx") waterring.Transform:SetPosition(owner.Transform:GetWorldPosition()) waterring.AnimState:SetBloomEffectHandle("shaders/anim.ksh") local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 10) for k,v in pairs(ents) do if v.components.burnable and v.components.burnable:IsBurning() then if v.prefab == "cactus" or v.prefab == "berrybush" or v.prefab == "berrybush2" or v.prefab == "carrot_planted" or v.prefab == "cave_banana_tree" or v.prefab == "cave_fern" or v.prefab == "deciduoustree" or v.prefab == "deciduoustree_normal" or v.prefab == "deciduoustree_tall" or v.prefab == "deciduoustree_short" or v.prefab == "evergreen" or v.prefab == "evergreen_normal" or v.prefab == "evergreen_tall" or v.prefab == "evergreen_short" or v.prefab == "evergreen_sparse" or v.prefab == "evergreen_sparse_normal" or v.prefab == "evergreen_sparse_tall" or v.prefab == "evergreen_sparse_short" or v.prefab == "flower" or v.prefab == "flower_evil" or v.prefab == "grass" or v.prefab == "marsh_bush" or v.prefab == "red_mushroom" or v.prefab == "green_mushroom" or v.prefab == "blue_mushroom" or v.prefab == "mushtree_tall" or v.prefab == "mushtree_medium" or v.prefab == "mushtree_small" or v.prefab == "sapling" or v.prefab == "flower_cave" or v.prefab == "flower_cave_double" or v.prefab == "flower_cave_triple" or v.prefab == "lichen" or v.prefab == "livingtree" or v.prefab == "marsh_tree" or v.prefab == "reeds" then if v.components.propagator then v.components.propagator.spreading = false end SpawnPrefab("collapse_big").Transform:SetPosition(v.Transform:GetWorldPosition()) SpawnPrefab(v.prefab).Transform:SetPosition(v.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/fireOut") v:Remove() end if v.prefab == "treasurechest" or v.prefab == "slow_farmplot" or v.prefab == "fast_farmplot" or v.prefab == "tent" or v.prefab == "wall_wood" or v.prefab == "wall_hay" or v.prefab == "cookpot" or v.prefab == "beebox" or v.prefab == "homesign" or v.prefab == "researchlab" or v.prefab == "researchlab2" or v.prefab == "researchlab3" or v.prefab == "researchlab4" or v.prefab == "meatrack" or v.prefab == "pighouse" or v.prefab == "rabbithouse" or v.prefab == "pottedfern" or v.prefab == "rainometer" or v.prefab == "winterometer" or v.prefab == "resurrectionstatue" or v.prefab == "siestahut" then SpawnPrefab("collapse_big").Transform:SetPosition(v.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/fireOut") v.components.burnable:Extinguish(true) end end end end ) end ) inst.components.equippable:SetOnUnequip(function(inst, owner) if inst.task then inst.task:Cancel() inst.task = nil end end ) inst:AddTag("extinguishers") end end inst.OnSave = onsave2 inst.OnLoad = onload2 即可用寒冬背心种随身灭火器,装备随身灭火器,可向外吹出强气流,靠近着火的建筑、植物,会自动灭火,让你对燃烧的基地不再束手无策。不想要随身灭火器了,用锤子砸掉即可。夏日背心在穿戴选项(画着帽子)下,用1个蓝色象鼻、8个蛛丝制造、2个牛毛制造

2025/04/23 · Bny

YN281-菜市场(在兔房买卖农产品)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八一.菜市场(在兔房买卖农产品) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rabbithouse.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function ShouldAcceptItem(inst, item) if item.prefab == "cave_banana" or item.prefab == "carrot" or item.prefab == "corn" or item.prefab == "pumpkin" or item.prefab == "eggplant" or item.prefab == "durian" or item.prefab == "pomegranate" or item.prefab == "dragonfruit" or item.prefab == "berries" or item.prefab == "cactus_meat" or item.prefab == "watermelon" or item.prefab == "acorn" or item.prefab == "goldnugget" then return true end return false end local function OnGetItemFromPlayer(inst, giver, item) if item.prefab == "cave_banana" or item.prefab == "carrot" or item.prefab == "corn" or item.prefab == "pumpkin" or item.prefab == "eggplant" or item.prefab == "durian" or item.prefab == "pomegranate" or item.prefab == "dragonfruit" or item.prefab == "berries" or item.prefab == "cactus_meat" or item.prefab == "watermelon" or item.prefab == "acorn" then local goldnugget = SpawnPrefab("goldnugget") giver.components.inventory:GiveItem(goldnugget) end if item.prefab == "goldnugget" then local names = {"cave_banana","carrot","corn","pumpkin","eggplant","durian","pomegranate","dragonfruit","berries","cactus_meat","watermelon","acorn"} local name = names[math.random(#names)] local veggie = SpawnPrefab(name) giver.components.inventory:GiveItem(veggie) end end inst:AddComponent("trader") inst.components.trader.onaccept = OnGetItemFromPlayer inst.components.trader:SetAcceptTest(ShouldAcceptItem) 即可将种出来的农产品卖给兔房(拿着农产品左键点兔房),获得1个黄金,黄金会自动打入账户(主角物品条)。也可以给兔房黄金,买入随机品种的农产品,可以买卖的农产品包括香蕉、胡萝卜、茄子、南瓜、玉米、榴莲、石榴、火龙果、浆果、仙人掌肉、西瓜、橡果

2025/04/23 · Bny

YN282-肉食店(在猪房买卖肉类)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八二.肉食店(在猪房买卖肉类) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/pighouse.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function ShouldAcceptItem(inst, item) if item.prefab == "meat" or item.prefab == "smallmeat" or item.prefab == "fish" or item.prefab == "eel" or item.prefab == "drumstick" or item.prefab == "bird_egg" or item.prefab == "froglegs" or item.prefab == "monstermeat" or item.prefab == "goldnugget" then return true end return false end local function OnGetItemFromPlayer(inst, giver, item) if item.prefab == "meat" or item.prefab == "smallmeat" or item.prefab == "fish" or item.prefab == "eel" or item.prefab == "drumstick" or item.prefab == "bird_egg" or item.prefab == "froglegs" or item.prefab == "monstermeat" then local goldnugget = SpawnPrefab("goldnugget") giver.components.inventory:GiveItem(goldnugget) end if item.prefab == "goldnugget" then local names = {"meat","smallmeat","fish","eel","drumstick","bird_egg","froglegs","monstermeat"} local name = names[math.random(#names)] local meat = SpawnPrefab(name) giver.components.inventory:GiveItem(meat) end end inst:AddComponent("trader") inst.components.trader.onaccept = OnGetItemFromPlayer inst.components.trader:SetAcceptTest(ShouldAcceptItem) 即可将各种肉类卖给猪房(拿着肉类左键点猪房),获得1个黄金,黄金会自动打入账户(主角物品条)。也可以给猪房黄金,买入随机品种的肉类,可以买卖的肉类包括大肉、小肉、鱼、鳗鱼、鸡腿、鸟蛋、蛙腿、疯肉

2025/04/23 · Bny

YN283-流动商贩(在猪村、兔村摆地摊)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八三.流动商贩(在猪村、兔村摆地摊) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/pigman.lua文件,在local function OnEat(inst, food)的下一行插入以下内容: if food.components.edible and food.components.edible.foodtype == "MEAT" then for k = 1, 2 do local gold = SpawnPrefab("goldnugget") gold.Transform:SetPosition(inst.Transform:GetWorldPosition()) end end 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/bunnyman.lua文件,在inst:AddComponent("eater")的下一行插入以下内容: local function OnEat(inst, food) if food.components.edible and food.components.edible.foodtype == "VEGGIE" then for k = 1, 2 do local gold = SpawnPrefab("goldnugget") gold.Transform:SetPosition(inst.Transform:GetWorldPosition()) end end end inst.components.eater:SetOnEatFn(OnEat) 即可在猪村将肉类(包括鱼、鸡蛋、蛙腿等)放在地上,在兔村将蔬菜(包括农产品、香蕉、浆果等)放在地上,它们会自动来买,每个肉类或蔬菜付2个黄金(扔在地上)。如果地图上没有猪村(地上)、兔村(地下一层),可以自己建造猪房、兔房形成

2025/04/23 · Bny

YN284-杂货收购行(将料理、帽子、绳子等杂货卖给帐篷换黄金)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八四.杂货收购行(将料理、帽子、绳子等杂货卖给帐篷换黄金) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rope.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable") 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/boards.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable") 3.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/cutstone.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable") 4.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/tent.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function ShouldAcceptItem(inst, item) if item:HasTag("hat") then return true end if item:HasTag("preparedfood") and item.prefab ~= "wetgoop" then return true end if item.prefab == "rope" or item.prefab == "boards" or item.prefab == "cutstone" or item.prefab == "foliage" or item.prefab == "honey" or item.prefab == "lightbulb" or item.prefab == "manrabbit_tail" or item.prefab == "pigskin" or item.prefab == "petals" or item.prefab == "petals_evil" or item.prefab == "slurper_pelt" or item.prefab == "wormlight" then return true end return false end local function OnGetItemFromPlayer(inst, giver, item) if item:HasTag("hat") then for k = 1, 3 do local goldnugget = SpawnPrefab("goldnugget") giver.components.inventory:GiveItem(goldnugget) end end if item:HasTag("preparedfood") and item.prefab ~= "wetgoop" then for k = 1, 5 do local goldnugget = SpawnPrefab("goldnugget") giver.components.inventory:GiveItem(goldnugget) end end if item.prefab == "rope" or item.prefab == "boards" or item.prefab == "cutstone" or item.prefab == "foliage" or item.prefab == "honey" or item.prefab == "lightbulb" or item.prefab == "manrabbit_tail" or item.prefab == "pigskin" or item.prefab == "petals" or item.prefab == "petals_evil" or item.prefab == "slurper_pelt" or item.prefab == "wormlight" then local goldnugget = SpawnPrefab("goldnugget") giver.components.inventory:GiveItem(goldnugget) end end inst:AddComponent("trader") inst.components.trader.onaccept = OnGetItemFromPlayer inst.components.trader:SetAcceptTest(ShouldAcceptItem) 即可将杂货卖给帐篷换黄金(拿着物品对帐篷点鼠标左键),其中料理收购价5个黄金,帽子3个黄金,绳子、木板、石砖、叶子、蜂蜜、荧光果、兔人尾巴、猪皮、花瓣、噩梦花瓣、啜食者皮、虫子果都是1个黄金

2025/04/23 · Bny

YN285-收藏品黑市(在鱼人房买收藏品卖给猪王赚差价)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八五.收藏品黑市(在鱼人房买收藏品卖给猪王赚差价) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/mermhouse.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function ShouldAcceptItem(inst, item) if GetPlayer().components.inventory:Has("goldnugget", 4) then if item.prefab == "goldnugget" then return true end end return false end local function OnGetItemFromPlayer(inst, giver, item) local names = {"trinket_1","trinket_2","trinket_3","trinket_4","trinket_5","trinket_6","trinket_7","trinket_8","trinket_9","trinket_10","trinket_11","trinket_12"} inst.name = names[math.random(#names)] local trinket = SpawnPrefab(inst.name) if item.prefab == "goldnugget" then giver.components.inventory:ConsumeByName("goldnugget", 3) giver.components.inventory:GiveItem(trinket) end end inst:AddComponent("trader") inst.components.trader.onaccept = OnGetItemFromPlayer inst.components.trader:SetAcceptTest(ShouldAcceptItem) 即可在鱼人房用黄金买入收藏品(拿着黄金对鱼人房点鼠标左键),4个黄金买1个,品种随机,收藏品会直接装进主角物品栏。拿到猪王那里卖出(拿着收藏品对猪王点鼠标左键),卖出价2-8个黄金(扔在地上),晚上猪王睡觉时不会交易。黑市交易有一定风险,会遭到流氓(鱼人)攻击,有些收藏品买卖会亏钱。身上黄金不足4个时无法买入

2025/04/23 · Bny