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

YN246-警戒模式(按键盘F8键主角自动巡逻并战斗,再按F8键恢复手动控制)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二四六.警戒模式(按键盘F8键主角自动巡逻并战斗,再按F8键恢复手动控制) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("playercontroller")的下一行插入以下内容: local items = { SWORD = "swap_spear" } local function EquipItem(inst, item) if item then inst.AnimState:OverrideSymbol("swap_object", item, item) inst.AnimState:Show("ARM_carry") inst.AnimState:Hide("ARM_normal") end end inst.items = items inst.equipfn = EquipItem EquipItem(inst) TheInput:AddKeyUpHandler(KEY_F8, function() if not inst:HasTag("patrol") then inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.talker:ShutUp() inst.components.playercontroller:Enable(false) inst:DoTaskInTime(0.3, function() inst:AddTag("patrol") inst.SoundEmitter:PlaySound("dontstarve/HUD/research_available") inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddComponent("knownlocations") local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() local head = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) inst.components.inventory:DropItem(head) local hands = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) inst.components.inventory:DropItem(hands) local body = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.BODY) inst.components.inventory:DropItem(body) inst.AnimState:OverrideSymbol("swap_object", "swap_spear", "swap_spear") inst.AnimState:Show("ARM_carry") inst.AnimState:Hide("ARM_normal") inst.HUD.controls.crafttabs:Hide() inst.HUD.controls.inv:Hide() local light = inst.entity:AddLight() light:SetIntensity(.8) light:SetRadius(20) light:SetFalloff(.6) light:Enable(true) light:SetColour(255/255,255/255,0/255) inst.components.locomotor.walkspeed = 10 inst.components.locomotor.runspeed = 15 inst:SetStateGraph("SGshadowwaxwell") inst.components.health:SetInvincible(true) inst.components.hunger:Pause() inst.components.sanity.ignore = true inst.components.temperature:SetTemp(20) inst.components.combat:SetDefaultDamage(200) inst.components.combat:SetAttackPeriod(0.25) inst.components.combat:SetRange(3) inst.components.combat:SetRetargetFunction(1, function(inst) if not inst.components.health:IsDead() then return FindEntity(inst, 50, function(guy) if guy.components.health and not guy.components.health:IsDead() then return guy.components.combat.target == inst or inst.components.combat.target == guy or guy:HasTag("monster") end end ) end end ) inst.components.combat:SetKeepTargetFunction(function(inst, target) return target and target:IsValid() end ) end ) else inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.talker:ShutUp() inst:DoTaskInTime(0.3, function() inst:RemoveTag("patrol") inst.SoundEmitter:PlaySound("dontstarve/HUD/research_available") inst.AnimState:SetBloomEffectHandle("") local brain = require "brains/wilsonbrain" inst:SetBrain(brain) inst:RestartBrain() inst:RemoveComponent("knownlocations") inst.AnimState:Hide("ARM_carry") inst.AnimState:Show("ARM_normal") inst.HUD.controls.crafttabs:Show() inst.HUD.controls.inv:Show() inst.Light:Enable(false) inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED inst:SetStateGraph("SGwilson") inst.components.health:SetInvincible(false) inst.components.hunger:Resume() inst.components.sanity.ignore = false inst.components.temperature:SetTemp(nil) inst.components.hunger:DoDelta(-inst.components.hunger.max*.5) inst.components.combat:SetDefaultDamage(TUNING.UNARMED_DAMAGE) inst.components.combat:SetAttackPeriod(TUNING.WILSON_ATTACK_PERIOD) inst.components.combat:SetRange(2) inst.components.combat:SetTarget(nil) inst.components.combat:SetRetargetFunction(nil, nil ) inst.components.combat:SetKeepTargetFunction(nil) inst.components.playercontroller:Enable(true) end ) end end ) 即可按键盘F8键,开启主角警戒模式,CPU将接管你对主角的控制权,让主角自动巡逻并保护所在地区(夜晚站岗),一旦发现敌人,会自行战斗,由于主角的生命、脑、饥饿值已全部锁死,并且无惧寒冷和黑暗,所以你无须担心主角的安全。再次按键盘F8键即可恢复手动操作,并扣减一半饥饿值,注意及时补充食物。开启警戒模式前,请将身上的装备全部卸下,否则将掉落在地上

2025/04/23 · Bny

YN247-观赏秃鹫(用蛛丝种笼中的秃鹫,喂腐烂食物产种子,喂肉生高鸟蛋)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二四七.观赏秃鹫(用蛛丝种笼中的秃鹫,喂腐烂食物产种子,喂肉生高鸟蛋) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/spoiledfood.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable") 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/silk.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function makecage(inst) local pt = inst:GetPosition() local cage = SpawnPrefab("silk") cage.Transform:SetPosition(pt.x, pt.y, pt.z) cage.AnimState:SetBank("birdcage") cage.AnimState:SetBuild("bird_cage") cage.AnimState:PlayAnimation("idle") cage.AnimState:SetMultColour(0/255,255/255,0/255,1) MakeObstaclePhysics(cage, .5 ) cage:RemoveComponent("tradable") cage:RemoveComponent("stackable") cage:RemoveComponent("inventoryitem") cage:RemoveComponent("upgrader") cage:RemoveComponent("deployable") cage:RemoveTag("cattoy") cage:AddComponent("named") cage.components.named:SetName("Buzzard") cage:AddComponent("lootdropper") cage:AddComponent("workable") cage.components.workable:SetWorkAction(ACTIONS.HAMMER) cage.components.workable:SetWorkLeft(3) cage.components.workable:SetOnFinishCallback(function(cage, worker) SpawnPrefab("collapse_big").Transform:SetPosition(cage.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") local pos = Vector3(cage.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 2) for k,v in pairs(ents) do if v:HasTag("cageanimal") then v:Remove() end end cage:Remove() end ) cage:AddComponent("trader") cage.components.trader:SetAcceptTest(function(cage, item) if item.prefab == "spoiled_food" or item.prefab == "meat" or item.prefab == "smallmeat" then return true end return false end ) cage.components.trader.onaccept = function(cage, giver, item) GetPlayer().SoundEmitter:PlaySound("dontstarve_DLC001/creatures/buzzard/taunt") if item.prefab == "spoiled_food" then for k = 1, math.random(5) do local names = {"carrot_seeds","corn_seeds","pumpkin_seeds","eggplant_seeds","durian_seeds","pomegranate_seeds","dragonfruit_seeds","watermelon_seeds","seeds"} local name = names[math.random(#names)] cage.components.lootdropper:SpawnLootPrefab(name) end end if item.prefab == "meat" or item.prefab == "smallmeat" then cage.components.lootdropper:SpawnLootPrefab("tallbirdegg") end end cage:AddTag("cages") local animal = SpawnPrefab("silk") animal.AnimState:SetBank("buzzard") animal.AnimState:SetBuild("buzzard_build") animal.AnimState:PlayAnimation("idle", true) animal.Transform:SetFourFaced() animal.Physics:SetActive(false) animal.entity:AddSoundEmitter() animal:AddTag("NOCLICK") animal:RemoveComponent("tradable") animal:RemoveComponent("stackable") animal:RemoveComponent("inventoryitem") animal:RemoveComponent("upgrader") animal:RemoveComponent("deployable") animal:RemoveTag("cattoy") local follower = animal.entity:AddFollower() follower:FollowSymbol( cage.GUID, "swap_object", -10, -220, -0.1 ) animal:DoPeriodicTask(10, function(animal) animal.AnimState:PlayAnimation("caw") animal.SoundEmitter:PlaySound("dontstarve_DLC001/creatures/buzzard/taunt") animal:DoTaskInTime(1.5, function() animal.AnimState:PlayAnimation("idle", true) end ) end ) animal:AddTag("cageanimal") end local function OnDeploy (inst, pt) makecage(inst) inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("cages") then data.cages = true end if inst:HasTag("cageanimal") then data.cageanimal = true end end local function onload(inst, data) if data and data.cages then makecage(inst) inst:Remove() end if data and data.cageanimal then inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload 即可用蛛丝种关在笼中的秃鹫(拿着1个蛛丝对地面点鼠标右键,如果拿着多个,则不会种出来),喂它腐烂食物,会掉落随机品种的植物种子,喂大肉、小肉会生高鸟蛋。不想要观赏秃鹫了,用锤子砸掉即可

2025/04/23 · Bny

YN248-迷你花坛(用燧石种花坛,给种子长出花朵,每晚招来萤火虫)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二四八.迷你花坛(用燧石种花坛,给种子长出花朵,每晚招来萤火虫) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/flint.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local names = {"f1","f2","f3","f4","f5","f6","f7","f8","f9","f10"} local function OnDeploy (inst, pt) local flowerpot = SpawnPrefab("flint") flowerpot.Transform:SetPosition(pt.x, pt.y, pt.z) flowerpot.AnimState:SetBank("firepit") flowerpot.AnimState:SetBuild("firepit") flowerpot.AnimState:PlayAnimation("idle",false) flowerpot.Transform:SetScale(0.5, 0.8, 0.5) flowerpot:RemoveComponent("edible") flowerpot:RemoveComponent("tradable") flowerpot:RemoveComponent("stackable") flowerpot:RemoveComponent("inventoryitem") flowerpot:RemoveComponent("bait") flowerpot:RemoveTag("molebait") flowerpot:AddTag("flowerpot") flowerpot:AddComponent("workable") flowerpot.components.workable:SetWorkAction(ACTIONS.HAMMER) flowerpot.components.workable:SetWorkLeft(3) flowerpot.components.workable:SetOnFinishCallback(function(flowerpot) SpawnPrefab("collapse_big").Transform:SetPosition(flowerpot.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") local pos1 = Vector3(flowerpot.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos1.x,pos1.y,pos1.z, 0.5) for k,v in pairs(ents) do if v:HasTag("newflower") then v:Remove() end end flowerpot:Remove() end ) flowerpot:ListenForEvent( "dusktime", function() if flowerpot:HasTag("flowering") then for k = 1,math.random(2,5) do local pt1 = flowerpot:GetPosition() local fireflies = SpawnPrefab("fireflies") fireflies.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 0, pt1.z+(math.random(3)-math.random(3))) end end end , GetWorld() ) flowerpot:ListenForEvent( "daytime", function() local pos = Vector3(flowerpot.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 5) for k,v in pairs(ents) do if v.prefab == "fireflies" and not v.components.inventoryitem:IsHeld() then v:Remove() end end end , GetWorld() ) flowerpot:AddComponent("trader") flowerpot.components.trader:SetAcceptTest(function(flowerpot, item) if not flowerpot:HasTag("flowering") then if item.prefab == "seeds" then return true end end return false end ) flowerpot.components.trader.onaccept = function(flowerpot, giver, item) local flower = SpawnPrefab("flint") flower.AnimState:SetBank("flowers") flower.AnimState:SetBuild("flowers") flower.animname = names[math.random(#names)] flower.AnimState:PlayAnimation(flower.animname) flower.AnimState:SetRayTestOnBB(true) flower.Transform:SetScale(1.5, 1.5, 1.5) flower.Physics:SetActive(false) local follower = flower.entity:AddFollower() follower:FollowSymbol( flowerpot.GUID, "swap_object", 0, -50, 0 ) flower:RemoveComponent("edible") flower:RemoveComponent("tradable") flower:RemoveComponent("stackable") flower:RemoveComponent("inventoryitem") flower:RemoveComponent("bait") flower:RemoveTag("molebait") flower:AddComponent("sanityaura") flower.components.sanityaura.aura = TUNING.SANITYAURA_SMALL flower:AddComponent("pickable") flower.components.pickable.picksound = "dontstarve/wilson/pickup_plants" flower.components.pickable:SetUp("petals", 0.1) flower.components.pickable.onpickedfn = function(flower) flower:Remove() flower = nil flowerpot:RemoveTag("flowering") end flower:AddTag("newflower") flower:AddTag("goodbye") flowerpot:AddTag("flowering") end inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("goodbye") then data.goodbye = true end if inst:HasTag("flowerpot") then data.flowerpot = true end if inst:HasTag("flowering") then data.flowering = true end end local function onload(inst, data) if data and data.goodbye then inst:Remove() end if data and data.flowerpot then inst.AnimState:SetBank("firepit") inst.AnimState:SetBuild("firepit") inst.AnimState:PlayAnimation("idle",false) inst.Transform:SetScale(0.5, 0.8, 0.5) inst:RemoveComponent("edible") inst:RemoveComponent("tradable") inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("bait") inst:RemoveTag("molebait") inst:AddTag("flowerpot") 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/wilson/rock_break") local pos1 = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos1.x,pos1.y,pos1.z, 0.5) for k,v in pairs(ents) do if v:HasTag("newflower") then v:Remove() end end inst:Remove() end ) inst:ListenForEvent( "dusktime", function() if inst:HasTag("flowering") then for k = 1,math.random(2,5) do local pt1 = inst:GetPosition() local fireflies = SpawnPrefab("fireflies") fireflies.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 0, pt1.z+(math.random(3)-math.random(3))) end end end , GetWorld() ) inst:ListenForEvent( "daytime", function() local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 5) for k,v in pairs(ents) do if v.prefab == "fireflies" and not v.components.inventoryitem:IsHeld() then v:Remove() end end end , GetWorld() ) inst:AddComponent("trader") inst.components.trader:SetAcceptTest(function(inst, item) if not inst:HasTag("flowering") then if item.prefab == "seeds" then return true end end return false end ) inst.components.trader.onaccept = function(inst, giver, item) local flower = SpawnPrefab("flint") flower.AnimState:SetBank("flowers") flower.AnimState:SetBuild("flowers") flower.animname = names[math.random(#names)] flower.AnimState:PlayAnimation(flower.animname) flower.AnimState:SetRayTestOnBB(true) flower.Transform:SetScale(1.5, 1.5, 1.5) flower.Physics:SetActive(false) local follower = flower.entity:AddFollower() follower:FollowSymbol( inst.GUID, "swap_object", 0, -50, 0 ) flower:RemoveComponent("edible") flower:RemoveComponent("tradable") flower:RemoveComponent("stackable") flower:RemoveComponent("inventoryitem") flower:RemoveComponent("bait") flower:RemoveTag("molebait") flower:AddComponent("sanityaura") flower.components.sanityaura.aura = TUNING.SANITYAURA_SMALL flower:AddComponent("pickable") flower.components.pickable.picksound = "dontstarve/wilson/pickup_plants" flower.components.pickable:SetUp("petals", 0.1) flower.components.pickable.onpickedfn = function(flower) flower:Remove() flower = nil inst:RemoveTag("flowering") end flower:AddTag("newflower") flower:AddTag("goodbye") inst:AddTag("flowering") end end if data and data.flowering then local flower = SpawnPrefab("flint") flower.AnimState:SetBank("flowers") flower.AnimState:SetBuild("flowers") flower.animname = names[math.random(#names)] flower.AnimState:PlayAnimation(flower.animname) flower.AnimState:SetRayTestOnBB(true) flower.Transform:SetScale(1.5, 1.5, 1.5) flower.Physics:SetActive(false) local follower = flower.entity:AddFollower() follower:FollowSymbol( inst.GUID, "swap_object", 0, -50, 0 ) flower:RemoveComponent("edible") flower:RemoveComponent("tradable") flower:RemoveComponent("stackable") flower:RemoveComponent("inventoryitem") flower:RemoveComponent("bait") flower:RemoveTag("molebait") flower:AddComponent("sanityaura") flower.components.sanityaura.aura = TUNING.SANITYAURA_SMALL flower:AddComponent("pickable") flower.components.pickable.picksound = "dontstarve/wilson/pickup_plants" flower.components.pickable:SetUp("petals", 0.1) flower.components.pickable.onpickedfn = function(flower) flower:Remove() flower = nil inst:RemoveTag("flowering") end flower:AddTag("newflower") flower:AddTag("goodbye") inst:AddTag("flowering") end end inst.OnSave = onsave inst.OnLoad = onload 即可用燧石种迷你花坛,在花坛中放入1个种子(拿着种子对花坛点鼠标左键),可开一朵花,品种随机。鼠标左键点花朵,可摘花(获得花瓣)。当花坛中有花时,靠近可以补脑,并且每晚都会招来萤火虫(天亮时消失),尽情捕捉吧。如果同时修改了“网上宠宠店”,就可以将抓到的萤火虫在线卖掉换黄金。不想要迷你花坛时,用锤子砸掉即可

2025/04/23 · Bny

YN249-橡树盆栽(用化肥种橡树盆栽,每天掉落橡果,靠近可补脑,鼠标左键点击树叶可变色)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二四九.橡树盆栽(用化肥种橡树盆栽,每天掉落橡果,靠近可补脑,鼠标左键点击树叶可变色) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/fertilizer.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function createoak(inst) local pt = inst:GetPosition() local oak = SpawnPrefab("fertilizer") oak.Transform:SetPosition(pt.x, pt.y, pt.z) oak.AnimState:SetBank("fertilizer") oak.AnimState:SetBuild("fertilizer") oak.AnimState:PlayAnimation("idle") oak.Transform:SetScale(1.2, 1.2, 1.2) oak:RemoveComponent("inventoryitem") oak:RemoveComponent("finiteuses") oak:RemoveComponent("fertilizer") oak:RemoveComponent("smotherer") oak:RemoveComponent("deployable") oak:AddTag("NOCLICK") oak:ListenForEvent( "daytime", function() local pos = Vector3(oak.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 2) for k,v in pairs(ents) do if v.components.inventoryitem and not v.components.inventoryitem:IsHeld() then if v.prefab == "acorn" then v:Remove() end end end oak:DoTaskInTime(0.3, function(oak) oak:StartThread(function() for k = 1,math.random(3,6) do local pt1 = oak:GetPosition() local acorn = SpawnPrefab("acorn") acorn.Transform:SetPosition(pt1.x+(math.random(2)-math.random(2)), 5, pt1.z+(math.random(2)-math.random(2))) Sleep(0.3) end end ) end ) end , GetWorld() ) oak:AddTag("oak") oak.tree = SpawnPrefab("fertilizer") oak.tree.AnimState:SetBank("tree_leaf") oak.tree.AnimState:SetBuild("tree_leaf_trunk_build") local names = {"tree_leaf_green_build","tree_leaf_red_build","tree_leaf_orange_build","tree_leaf_yellow_build"} local name = names[math.random(#names)] oak.tree.AnimState:OverrideSymbol("swap_leaves", name, "swap_leaves") oak.tree.AnimState:PlayAnimation("idle_tall") oak.tree.Transform:SetScale(0.8, 0.8, 0.8) oak.tree.Physics:SetActive(false) oak.tree:RemoveComponent("inventoryitem") oak.tree:RemoveComponent("finiteuses") oak.tree:RemoveComponent("fertilizer") oak.tree:RemoveComponent("smotherer") oak.tree:RemoveComponent("deployable") local follower = oak.tree.entity:AddFollower() follower:FollowSymbol( oak.GUID, "swap_object", -1, -115, 0 ) oak.tree:AddComponent("sanityaura") oak.tree.components.sanityaura.aura = TUNING.SANITYAURA_MED oak.tree:AddComponent("workable") oak.tree.components.workable:SetWorkAction(ACTIONS.CHOP) oak.tree.components.workable:SetWorkLeft(1) oak.tree.components.workable:SetOnFinishCallback(function() SpawnPrefab("collapse_big").Transform:SetPosition(oak.tree.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") local pos = Vector3(oak.tree.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 1) for k,v in pairs(ents) do if v:HasTag("oak") then v:Remove() end end oak.tree:Remove() end ) oak.tree.components.inspectable.getstatus = function() local names = {"tree_leaf_green_build","tree_leaf_red_build","tree_leaf_orange_build","tree_leaf_yellow_build"} local name = names[math.random(#names)] oak.tree.AnimState:OverrideSymbol("swap_leaves", name, "swap_leaves") end oak.tree:AddTag("goodbye") end local function OnDeploy (inst, pt) createoak(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("goodbye") then data.goodbye = true end if inst:HasTag("oak") then data.oak = true end end local function onload(inst, data) if data and data.goodbye then inst:Remove() end if data and data.oak then createoak(inst) inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload 即可用化肥种橡树盆栽,四季常青,每天清晨掉落橡果,靠近可补脑。鼠标左键点橡树,可改变树叶的颜色。不想要橡树盆栽了,用斧子砍掉即可。化肥在种植选项(画着胡萝卜)下,用3个便便、2个硬骨头、4个木头制造

2025/04/23 · Bny

YN250-小油灯(用蜘蛛腺体种小油灯,放在地上自动点燃,无限燃烧,可烧炭、烤食物、取暖、照明)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五0.小油灯(用蜘蛛腺体种小油灯,放在地上自动点燃,无限燃烧,可烧炭、烤食物、取暖、照明) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/log.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("cookable") inst.components.cookable.product = "charcoal" 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/spidergland.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local colours= { {198/255,43/255,43/255}, {79/255,153/255,68/255}, {35/255,105/255,235/255}, {233/255,208/255,69/255}, {109/255,50/255,163/255}, {222/255,126/255,39/255}, } local function OnDeploy (inst, pt) local lamp = SpawnPrefab("spidergland") lamp.Transform:SetPosition(pt.x, pt.y, pt.z) lamp.AnimState:SetBank("trinkets") lamp.AnimState:SetBuild("trinkets") lamp.AnimState:PlayAnimation(tostring(2)) lamp.components.inventoryitem:ChangeImageName("trinket_2") lamp.entity:AddSoundEmitter() lamp.Transform:SetScale(1.2,1.2,1.2) lamp.colour_idx = math.random(#colours) lamp.AnimState:SetMultColour(colours[lamp.colour_idx][1],colours[lamp.colour_idx][2],colours[lamp.colour_idx][3],1) lamp:RemoveComponent("stackable") lamp:RemoveComponent("tradable") lamp:RemoveComponent("healer") lamp:RemoveComponent("burnable") lamp:RemoveComponent("propagator") lamp:RemoveComponent("deployable") lamp:RemoveTag("cattoy") lamp:AddComponent("cooker") lamp:AddComponent("burnable") lamp.components.burnable:SetFXLevel(3) lamp.components.burnable:AddBurnFX("campfirefire", Vector3(0,0.5,0) ) lamp.components.burnable:Ignite(true) lamp.components.inventoryitem:SetOnDroppedFn(function() lamp.components.burnable:Ignite(true) lamp:AddTag("ontheground") end ) lamp.components.inventoryitem:SetOnPickupFn(function() lamp.components.burnable:Extinguish() lamp:RemoveTag("ontheground") end ) lamp.components.inventoryitem:SetOnPutInInventoryFn(function() lamp.components.burnable:Extinguish() lamp:RemoveTag("ontheground") end ) lamp:ListenForEvent("onignite", function() if not lamp.components.cooker then lamp:AddComponent("cooker") end end ) lamp:ListenForEvent("onextinguish", function() lamp.SoundEmitter:PlaySound("dontstarve/common/fireOut") if lamp.components.cooker then lamp:RemoveComponent("cooker") end end ) lamp:AddComponent("workable") lamp.components.workable:SetWorkAction(ACTIONS.HAMMER) lamp.components.workable:SetWorkLeft(3) lamp.components.workable:SetOnFinishCallback(function(lamp) SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(lamp.Transform:GetWorldPosition()) lamp:Remove() end ) lamp:AddTag("ontheground") lamp:AddTag("light") lamp:AddTag("lamps") inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("lamps") then data.lamps = true end if inst:HasTag("ontheground") then data.ontheground = true end data.colour_idx = inst.colour_idx end local function onload(inst, data) if data and data.lamps then inst.AnimState:SetBank("trinkets") inst.AnimState:SetBuild("trinkets") inst.AnimState:PlayAnimation(tostring(2)) inst.components.inventoryitem:ChangeImageName("trinket_2") inst.entity:AddSoundEmitter() inst.Transform:SetScale(1.2,1.2,1.2) inst.colour_idx = math.random(#colours) inst.AnimState:SetMultColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3],1) inst:RemoveComponent("stackable") inst:RemoveComponent("tradable") inst:RemoveComponent("healer") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") inst:RemoveTag("cattoy") inst:AddComponent("burnable") inst.components.burnable:SetFXLevel(3) inst.components.burnable:AddBurnFX("campfirefire", Vector3(0,0.5,0) ) inst.components.inventoryitem:SetOnDroppedFn(function() inst.components.burnable:Ignite(true) inst:AddTag("ontheground") end ) inst.components.inventoryitem:SetOnPickupFn(function() inst.components.burnable:Extinguish() inst:RemoveTag("ontheground") end ) inst.components.inventoryitem:SetOnPutInInventoryFn(function() inst.components.burnable:Extinguish() inst:RemoveTag("ontheground") end ) inst:ListenForEvent("onignite", function() if not inst.components.cooker then inst:AddComponent("cooker") end end ) inst:ListenForEvent("onextinguish", function() inst.SoundEmitter:PlaySound("dontstarve/common/fireOut") if inst.components.cooker then inst:RemoveComponent("cooker") end end ) inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst:Remove() end ) inst:AddTag("light") inst:AddTag("lamps") end if data and data.ontheground then inst.components.burnable:Ignite(true) inst:AddComponent("cooker") inst:AddTag("ontheground") end if data and data.colour_idx then inst.colour_idx = math.min(#colours, data.colour_idx) inst.AnimState:SetMultColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3],1) end end inst.OnSave = onsave inst.OnLoad = onload 即可用蜘蛛腺体种小油灯(颜色随机),无须任何燃料,放在地上自动点燃,拿起来自动熄灭。拿着木头对油灯按鼠标左键,可将木头烧成炭。也可烤食物、取暖、照明,出行必备。不想要小油灯时,用锤子砸掉即可

2025/04/23 · Bny

YN251-我的王国(用远古短棒种国王雕像,可获得税收,有警察巡逻并听你调遣)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五一.我的王国(用远古短棒种国王雕像,可获得税收,有警察巡逻并听你调遣) 用MT管理器打开游戏目录/assets/scripts/prefabs/ruins_bat.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local items = { SWORD = "swap_spear" } local function EquipItem(inst, item) if item then inst.AnimState:OverrideSymbol("swap_object", item, item) inst.AnimState:Show("ARM_carry") inst.AnimState:Hide("ARM_normal") end end inst.items = items inst.equipfn = EquipItem EquipItem(inst) local function createguru(inst) local pt = inst:GetPosition() local guru = SpawnPrefab("ruins_bat") guru.Transform:SetPosition(pt.x, pt.y, pt.z) guru.AnimState:SetBank("wilson") if GetPlayer().prefab == "wilson" then guru.AnimState:SetBuild("wilson") end if GetPlayer().prefab == "wendy" then guru.AnimState:SetBuild("wendy") end if GetPlayer().prefab == "wes" then guru.AnimState:SetBuild("wes") end if GetPlayer().prefab == "wickerbottom" then guru.AnimState:SetBuild("wickerbottom") end if GetPlayer().prefab == "willow" then guru.AnimState:SetBuild("willow") end if GetPlayer().prefab == "wolfgang" then guru.AnimState:SetBuild("wolfgang") end if GetPlayer().prefab == "wx78" then guru.AnimState:SetBuild("wx78") end if GetPlayer().prefab == "woodie" then guru.AnimState:SetBuild("woodie") end if GetPlayer().prefab == "waxwell" then guru.AnimState:SetBuild("waxwell") end if GetPlayer().prefab == "wathgrithr" then guru.AnimState:SetBuild("wathgrithr") end if GetPlayer().prefab == "webber" then guru.AnimState:SetBuild("webber") end guru.AnimState:PlayAnimation("idle") guru.AnimState:OverrideSymbol("swap_object", "swap_cane", "swap_cane") guru.AnimState:Hide("ARM_normal") guru.AnimState:Show("ARM_carry") guru.AnimState:OverrideSymbol("swap_hat", "hat_ruins", "swap_hat") guru.AnimState:Show("HAT") guru.AnimState:Show("HAT_HAIR") guru.AnimState:Hide("HAIR_NOHAT") guru.AnimState:Hide("HAIR") guru.Transform:SetFourFaced() guru.Transform:SetRotation( 0 ) guru.Transform:SetScale(3.5, 3.5, 3.5) local shadow = guru.entity:AddDynamicShadow() shadow:SetSize( 6, 3.5 ) local minimap = guru.entity:AddMiniMapEntity() minimap:SetIcon( "obelisk.png" ) guru.AnimState:SetBloomEffectHandle("shaders/anim.ksh") guru:AddTag("guru") guru:RemoveTag("sharp") guru:RemoveComponent("weapon") guru:RemoveComponent("finiteuses") guru:RemoveComponent("inventoryitem") guru:RemoveComponent("equippable") guru:RemoveComponent("deployable") local light = guru.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(10) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) guru:AddComponent("workable") guru.components.workable:SetWorkAction(ACTIONS.HAMMER) guru.components.workable:SetWorkLeft(5) guru.components.workable:SetOnFinishCallback(function(guru) SpawnPrefab("collapse_big").Transform:SetPosition(guru.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") guru:Remove() end ) guru:AddComponent("pickable") guru.components.pickable:SetUp("goldnugget", 480, math.random(15,25)) guru.components.pickable:SetOnPickedFn(function(guru) guru.AnimState:SetBloomEffectHandle("") end ) guru.components.pickable:SetOnRegenFn(function(guru) guru.AnimState:SetBloomEffectHandle("shaders/anim.ksh") end ) guru:ListenForEvent( "daytime", function() for k = 1,math.random(10,25) do local pt0 = guru:GetPosition() local ground = GetWorld() local x = pt0.x+(math.random(50)-math.random(50)) local z = pt0.z+(math.random(50)-math.random(50)) local tile = ground.Map:GetTileAtPoint(x,0, z) if tile ~= GROUND.IMPASSABLE and tile ~= GROUND.INVALID then local militia = SpawnPrefab("ruins_bat") militia.Transform:SetPosition(x,0,z) militia.AnimState:SetBank("wilson") local buildnames = {"wilson","wendy","wes","wickerbottom","willow","wolfgang","wx78"} local buildname = buildnames[math.random(#buildnames)] militia.AnimState:SetBuild(buildname) militia.AnimState:OverrideSymbol("swap_hat", "hat_walrus", "swap_hat") militia.AnimState:OverrideSymbol("swap_body", "armor_wood", "swap_body") militia.AnimState:OverrideSymbol("swap_object", "swap_spear", "swap_spear") militia.AnimState:Show("HAT") militia.AnimState:Show("HAT_HAIR") militia.AnimState:Hide("HAIR_NOHAT") militia.AnimState:Hide("HAIR") militia.AnimState:Hide("ARM_normal") militia.AnimState:Show("ARM_carry") militia.AnimState:PlayAnimation("idle") militia.Transform:SetFourFaced() local shadow = militia.entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) MakeCharacterPhysics(militia, 75, .5) local minimap = militia.entity:AddMiniMapEntity() minimap:SetIcon( "statue_small.png" ) militia:AddTag("militia") militia:AddComponent("locomotor") militia.components.locomotor.walkspeed = 5 militia.components.locomotor.runspeed = 10 militia:SetStateGraph("SGshadowwaxwell") local brain = require "brains/frogbrain" militia:SetBrain(brain) militia:RemoveTag("sharp") militia:RemoveComponent("weapon") militia:RemoveComponent("finiteuses") militia:RemoveComponent("inventoryitem") militia:RemoveComponent("equippable") militia:RemoveComponent("deployable") militia:AddComponent("follower") militia:AddComponent("knownlocations") militia:AddComponent("health") militia.components.health:SetMaxHealth(1200) militia.components.health.nofadeout = true militia:AddComponent("combat") militia.components.combat:SetDefaultDamage(20) militia.components.combat:SetAttackPeriod(1) militia.components.combat.hiteffectsymbol = "torso" militia.components.combat:SetRange(2, 3) militia.components.combat:SetRetargetFunction(2, function(militia) if not militia.components.health:IsDead() then return FindEntity(militia, 25, function(guy) if guy.components.health and not guy.components.health:IsDead() then return guy.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == guy or guy:HasTag("monster") end end ) end end ) militia.components.combat:SetKeepTargetFunction(function(militia, target) return target and target:IsValid() end ) militia:ListenForEvent("attacked", function(militia, data) militia.components.combat:SetTarget(data.attacker) end ) militia.components.inspectable.getstatus = function(militia) if not militia:HasTag("letsgo") then local brain = require "brains/abigailbrain" militia:SetBrain(brain) militia:RestartBrain() militia.components.follower:SetLeader(GetPlayer()) militia:AddTag("letsgo") else local brain = require "brains/frogbrain" militia:SetBrain(brain) militia:RestartBrain() militia.components.follower:SetLeader(nil) militia:RemoveTag("letsgo") end end militia:ListenForEvent( "nighttime", function() militia:Remove() end , GetWorld()) end end end , GetWorld()) end local function OnDeploy (inst, pt) if GetPlayer().components.inventory:Has("goldnugget", 1000) then GetPlayer().components.inventory:ConsumeByName("goldnugget", 1000) createguru(inst) inst:Remove() end end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("guru") then data.guru = true end if inst:HasTag("militia") then data.militia = true end if inst:HasTag("letsgo") then data.letsgo = true end end local function onload(inst, data) if data and data.guru then createguru(inst) inst:Remove() end if data and data.militia then inst.AnimState:SetBank("wilson") local buildnames = {"wilson","wendy","wes","wickerbottom","willow","wolfgang","wx78"} local buildname = buildnames[math.random(#buildnames)] inst.AnimState:SetBuild(buildname) inst.AnimState:OverrideSymbol("swap_hat", "hat_walrus", "swap_hat") inst.AnimState:OverrideSymbol("swap_body", "armor_wood", "swap_body") inst.AnimState:OverrideSymbol("swap_object", "swap_spear", "swap_spear") inst.AnimState:Show("HAT") inst.AnimState:Show("HAT_HAIR") inst.AnimState:Hide("HAIR_NOHAT") inst.AnimState:Hide("HAIR") inst.AnimState:Hide("ARM_normal") inst.AnimState:Show("ARM_carry") inst.AnimState:PlayAnimation("idle") inst.Transform:SetFourFaced() local shadow = inst.entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) MakeCharacterPhysics(inst, 75, .5) local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "statue_small.png" ) inst:AddTag("militia") inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 5 inst.components.locomotor.runspeed = 10 inst:SetStateGraph("SGshadowwaxwell") local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RemoveTag("sharp") inst:RemoveComponent("weapon") inst:RemoveComponent("finiteuses") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("equippable") inst:RemoveComponent("deployable") inst:AddComponent("follower") inst:AddComponent("knownlocations") inst:AddComponent("health") inst.components.health:SetMaxHealth(1200) inst.components.health.nofadeout = true inst:AddComponent("combat") inst.components.combat:SetDefaultDamage(20) inst.components.combat:SetAttackPeriod(1) inst.components.combat.hiteffectsymbol = "torso" inst.components.combat:SetRange(2, 3) inst.components.combat:SetRetargetFunction(2, function(inst) if not inst.components.health:IsDead() then return FindEntity(inst, 25, function(guy) if guy.components.health and not guy.components.health:IsDead() then return guy.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == guy or guy:HasTag("monster") end end ) end end ) inst.components.combat:SetKeepTargetFunction(function(inst, target) return target and target:IsValid() end ) inst:ListenForEvent("attacked", function(inst, data) inst.components.combat:SetTarget(data.attacker) end ) inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("letsgo") then local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst:AddTag("letsgo") else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) inst:RemoveTag("letsgo") end end inst:ListenForEvent( "nighttime", function() inst:Remove() end , GetWorld()) end if data and data.letsgo then local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst:AddTag("letsgo") end end inst.OnSave = onsave inst.OnLoad = onload 即可在身上有1000个黄金时,用远古短棒种国王雕像(你自己的形象),宣誓你在这块大陆上的主权,将消费1000个黄金,身上黄金数不足时,不会种出雕像。当雕像发光时,代表当地的税收已经上缴(每日一次),用鼠标左键点雕像,可收到税款。每天白天,雕像周围会有警察巡逻,黑夜将离去,他们会攻击任何来犯的敌人。鼠标左键点警察(不要拿武器,以免误伤),可让他跟随你(黑夜离去),再次点击可解除跟随。在大陆各地树起国王雕像,建立你的王国,统治整块大陆吧。可通过小地图查看你的势力范围,国王雕像在小地图上显示为方尖碑图标,警察显示为天使雕像图标。不想要国王雕像时,用锤子砸掉即可。远古短棒在远古选项(画着远古祭坛)下,用3个活木头、4个铥矿石、4个噩梦燃料制造,制造时须靠近远古祭坛

2025/04/23 · Bny

YN252-鲜果龙树(用蝙蝠棒种龙树,每天掉落水果,可上树)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五二.鲜果龙树(用蝙蝠棒种龙树,每天掉落水果,可上树) 用MT管理器打开游戏目录/assets/scripts/prefabs/batbat.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local colours= { {198/255,43/255,43/255}, {0/255,255/255,0/255}, {0/255,0/255,255/255}, {255/255,255/255,0/255}, {109/255,50/255,163/255}, {255/255,0/255,0/255}, {255/255,255/255,255/255}, } local function createtree(inst) local pt = inst:GetPosition() local phantom = SpawnPrefab("batbat") phantom.Transform:SetPosition(pt.x, pt.y, pt.z) phantom.AnimState:SetBank("firepit") phantom.AnimState:SetBuild("firepit") phantom.AnimState:PlayAnimation("idle",false) phantom.Transform:SetScale(0.8, 0.8, 0.8) phantom:RemoveComponent("weapon") phantom:RemoveComponent("finiteuses") phantom:RemoveComponent("inventoryitem") phantom:RemoveComponent("equippable") phantom:RemoveComponent("deployable") phantom:RemoveTag("dull") phantom:AddTag("NOCLICK") local light = phantom.entity:AddLight() phantom.Light:SetFalloff(0.6) phantom.Light:SetIntensity(.8) phantom.Light:SetRadius(5) phantom.colour_idx = math.random(#colours) phantom.Light:SetColour(colours[phantom.colour_idx][1],colours[phantom.colour_idx][2],colours[phantom.colour_idx][3]) phantom.Light:Enable(true) phantom:DoPeriodicTask(15, function() phantom.colour_idx = math.random(#colours) phantom.Light:SetColour(colours[phantom.colour_idx][1],colours[phantom.colour_idx][2],colours[phantom.colour_idx][3]) end ) phantom:ListenForEvent( "daytime", function() local pos = Vector3(phantom.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 5) for k,v in pairs(ents) do if v.components.inventoryitem and not v.components.inventoryitem:IsHeld() then if v.prefab == "durian" or v.prefab == "pomegranate" or v.prefab == "dragonfruit" then v:Remove() end end end phantom:DoTaskInTime(0.3, function(phantom) phantom:StartThread(function() for k = 1,math.random(3,7) do local pt1 = phantom:GetPosition() local names = {"durian","pomegranate","dragonfruit"} local name = names[math.random(#names)] local fruit = SpawnPrefab(name) fruit.Transform:SetPosition(pt1.x+(math.random(5)-math.random(5)), 5, pt1.z+(math.random(5)-math.random(5))) Sleep(0.3) end end ) end ) end , GetWorld() ) phantom:AddTag("phantom") phantom.long = SpawnPrefab("batbat") phantom.long.AnimState:SetBank("worm") phantom.long.AnimState:SetBuild("worm") phantom.long.AnimState:SetPercent("atk", 0.40) phantom.long.Transform:SetScale(1.5, 1.5, 1.5) phantom.long.Physics:SetActive(false) phantom.long:RemoveComponent("weapon") phantom.long:RemoveComponent("finiteuses") phantom.long:RemoveComponent("inventoryitem") phantom.long:RemoveComponent("equippable") phantom.long:RemoveComponent("deployable") phantom.long:RemoveTag("dull") local follower = phantom.long.entity:AddFollower() follower:FollowSymbol( phantom.GUID, "swap_object", 10, -90, 0 ) phantom.long.components.inspectable.getstatus = function() if not GetPlayer():HasTag("climbtree") then GetPlayer():AddTag("climbtree") GetPlayer().components.playercontroller:Enable(false) local pt0 = phantom:GetPosition() GetPlayer().Transform:SetPosition(pt0.x, 10.2, pt0.z) GetPlayer():DoTaskInTime(5, function() GetPlayer().Transform:SetPosition(pt0.x, 0, pt0.z) GetPlayer():RemoveTag("climbtree") GetPlayer().components.playercontroller:Enable(true) end ) end end phantom.long:AddTag("lightningrod") phantom.long:ListenForEvent("lightningstrike", function() phantom.long.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" ) phantom.long:DoTaskInTime(60, function() phantom.long.AnimState:SetBloomEffectHandle("") end ) end ) phantom.long:AddComponent("sanityaura") phantom.long.components.sanityaura.aura = TUNING.SANITYAURA_MED phantom.long:AddTag("goodbye") phantom.guo1 = SpawnPrefab("batbat") phantom.guo1.AnimState:SetBank("durian") phantom.guo1.AnimState:SetBuild("durian") phantom.guo1.AnimState:PlayAnimation("idle") phantom.guo1.Transform:SetScale(1.5, 1.5, 1.5) phantom.guo1.Physics:SetActive(false) phantom.guo1:RemoveComponent("weapon") phantom.guo1:RemoveComponent("finiteuses") phantom.guo1:RemoveComponent("inventoryitem") phantom.guo1:RemoveComponent("equippable") phantom.guo1:RemoveComponent("deployable") phantom.guo1:RemoveTag("dull") local follower = phantom.guo1.entity:AddFollower() follower:FollowSymbol( phantom.GUID, "swap_object", -550, -580, 0 ) phantom.guo1:AddTag("NOCLICK") phantom.guo1:AddTag("goodbye") phantom.guo2 = SpawnPrefab("batbat") phantom.guo2.AnimState:SetBank("pomegranate") phantom.guo2.AnimState:SetBuild("pomegranate") phantom.guo2.AnimState:PlayAnimation("idle") phantom.guo2.Transform:SetScale(1.5, 1.5, 1.5) phantom.guo2.Physics:SetActive(false) phantom.guo2:RemoveComponent("weapon") phantom.guo2:RemoveComponent("finiteuses") phantom.guo2:RemoveComponent("inventoryitem") phantom.guo2:RemoveComponent("equippable") phantom.guo2:RemoveComponent("deployable") phantom.guo2:RemoveTag("dull") local follower = phantom.guo2.entity:AddFollower() follower:FollowSymbol( phantom.GUID, "swap_object", 610, -690, 0 ) phantom.guo2:AddTag("NOCLICK") phantom.guo2:AddTag("goodbye") phantom.guo3 = SpawnPrefab("batbat") phantom.guo3.AnimState:SetBank("dragonfruit") phantom.guo3.AnimState:SetBuild("dragonfruit") phantom.guo3.AnimState:PlayAnimation("idle") phantom.guo3.Transform:SetScale(1.5, 1.5, 1.5) phantom.guo3.Physics:SetActive(false) phantom.guo3:RemoveComponent("weapon") phantom.guo3:RemoveComponent("finiteuses") phantom.guo3:RemoveComponent("inventoryitem") phantom.guo3:RemoveComponent("equippable") phantom.guo3:RemoveComponent("deployable") phantom.guo3:RemoveTag("dull") local follower = phantom.guo3.entity:AddFollower() follower:FollowSymbol( phantom.GUID, "swap_object", -290, -1385, 0 ) phantom.guo3:AddTag("NOCLICK") phantom.guo3:AddTag("goodbye") end local function OnDeploy (inst, pt) createtree(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("goodbye") then data.goodbye = true end if inst:HasTag("phantom") then data.phantom = true end end local function onload(inst, data) if data and data.goodbye then inst:Remove() end if data and data.phantom then createtree(inst) inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload MakeLargeBurnable(inst) MakeLargePropagator(inst) 即可用蝙蝠棒种龙树,靠近可补脑,每天会掉落各种水果。龙树可吸收闪电,起到避雷针的作用。鼠标左键点龙树,会爬上树顶眺望风景,5秒后滑下。龙树会不断变化七彩光,夜晚可照明。不想要龙树时,烧掉即可。蝙蝠棒在魔法选项(画着红骷髅)下,用5个蝙蝠翅膀、2个活木头、1个紫宝石制造

2025/04/23 · Bny

YN253-小病小灾(主角会感冒、食物中毒,吃曼德拉草可痊愈)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五三.小病小灾(主角会感冒、食物中毒,吃曼德拉草可痊愈) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("eater")的下一行插入以下内容: local function OnEat(inst, food) if food and food.prefab ~= "mandrake" then if math.random()<0.1 then if not inst:HasTag("poisoning") and not inst:HasTag("fever") then inst:AddTag("poisoning") inst.AnimState:SetMultColour(0/255,255/255,0/255,1) inst.components.health:DoDelta(-inst.components.health.maxhealth*.2) inst.components.sanity:DoDelta(-inst.components.sanity.max*.5) inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED*.3 inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED*.3 inst.components.combat:SetAttackPeriod(TUNING.WILSON_ATTACK_PERIOD*5) inst.poison = inst:DoPeriodicTask(10, function() inst.components.hunger:DoDelta(-20) inst.components.locomotor:Stop() inst.AnimState:PlayAnimation("pickup") SpawnPrefab("poop").Transform:SetPosition(inst.Transform:GetWorldPosition()) end ) end end end if food.prefab == "mandrake" then if inst:HasTag("poisoning") then inst:RemoveTag("poisoning") end if inst:HasTag("fever") then inst:RemoveTag("fever") end if inst.poison then inst.poison:Cancel() inst.poison = nil end if inst.fever then inst.fever:Cancel() inst.fever = nil end inst.AnimState:SetMultColour(255/255,255/255,255/255,1) inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED inst.components.combat:SetAttackPeriod(TUNING.WILSON_ATTACK_PERIOD) end end inst.components.eater:SetOnEatFn(OnEat) local function OnDay(inst) if inst:HasTag("poisoning") then inst:RemoveTag("poisoning") inst.AnimState:SetMultColour(255/255,255/255,255/255,1) inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED inst.components.combat:SetAttackPeriod(TUNING.WILSON_ATTACK_PERIOD) if inst.poison then inst.poison:Cancel() inst.poison = nil end end if not inst:HasTag("fever") then if math.random()<0.1 then inst:AddTag("fever") inst.AnimState:SetMultColour(255/255,0/255,0/255,1) inst.components.sanity:DoDelta(-inst.components.sanity.max*.5) inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED*.3 inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED*.3 inst.components.combat:SetAttackPeriod(TUNING.WILSON_ATTACK_PERIOD*5) inst.fever = inst:DoPeriodicTask(15, function() inst.components.health:DoDelta(-inst.components.health.maxhealth*.05) inst.components.locomotor:Stop() inst.AnimState:PlayAnimation("idle_shiver_pre") inst.AnimState:PushAnimation("idle_shiver_loop") inst.AnimState:PushAnimation("idle_shiver_pst", false) end ) end else inst:RemoveTag("fever") inst.AnimState:SetMultColour(255/255,255/255,255/255,1) inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED inst.components.combat:SetAttackPeriod(TUNING.WILSON_ATTACK_PERIOD) if inst.fever then inst.fever:Cancel() inst.fever = nil end end end inst:ListenForEvent( "daytime", function() OnDay(inst) end, GetWorld()) 即可让游戏有更加真实的体验,主角会感冒,浑身因发烧而呈红色,行动迟缓,生命值不断下降,如不注意补血,则有生命危险。另外,在吃食物时,也有一定概率发生食物中毒,浑身呈绿色,行动迟缓,且不断出现腹泻,饥饿值下降速度加快。无论感冒还是食物中毒,只要你抗过一天,基本都能痊愈,如果服用曼德拉草,则可立即痊愈。如果修改了“小诊所”,也可以给护士5个黄金治疗疾病。不要与“伍迪吃疯肉立即变海狸且随身物品不掉落”一同修改

2025/04/23 · Bny

YN254-噩梦草(用鸟粪种噩梦草,可采噩梦燃料,有一定概率出现地下巨人)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五四.噩梦草(用鸟粪种噩梦草,可采噩梦燃料,有一定概率出现地下巨人) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/guano.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local items = { SWORD = "swap_ham_bat" } local function EquipItem(inst, item) if item then inst.AnimState:OverrideSymbol("swap_object", item, item) inst.AnimState:Show("ARM_carry") inst.AnimState:Hide("ARM_normal") end end inst.items = items inst.equipfn = EquipItem EquipItem(inst) local function OnDeploy (inst, pt) local darkgrass = SpawnPrefab("guano") darkgrass.Transform:SetPosition(pt.x, pt.y, pt.z) darkgrass.AnimState:SetBank("marsh_plant") darkgrass.AnimState:SetBuild("marsh_plant") darkgrass.AnimState:PlayAnimation("idle") darkgrass.Transform:SetScale(1.8, 1.8, 1.8) darkgrass.AnimState:SetMultColour(255/255,255/255,0/255,1) darkgrass:RemoveComponent("stackable") darkgrass:RemoveComponent("inventoryitem") darkgrass:RemoveComponent("fertilizer") darkgrass:RemoveComponent("smotherer") darkgrass:RemoveComponent("fuel") darkgrass:RemoveComponent("burnable") darkgrass:RemoveComponent("propagator") darkgrass:RemoveComponent("deployable") MakeMediumBurnable(darkgrass) MakeSmallPropagator(darkgrass) if darkgrass.flies then darkgrass.flies:Remove() darkgrass.flies = nil end darkgrass:AddComponent("workable") darkgrass.components.workable:SetWorkAction(ACTIONS.DIG) darkgrass.components.workable:SetWorkLeft(1) darkgrass.components.workable:SetOnFinishCallback(function(darkgrass) SpawnPrefab("nightmarefuel").Transform:SetPosition(darkgrass.Transform:GetWorldPosition()) darkgrass:Remove() end ) darkgrass:AddComponent("pickable") darkgrass.components.pickable:SetUp("nightmarefuel", 480) darkgrass.components.pickable:SetOnRegenFn(function(darkgrass) darkgrass.AnimState:SetMultColour(255/255,255/255,0/255,1) end ) darkgrass.components.pickable:SetOnPickedFn(function(darkgrass) darkgrass.AnimState:SetMultColour(255/255,255/255,255/255,1) if math.random()<0.05 then GetPlayer().components.playercontroller:ShakeCamera(darkgrass, "FULL", 1.5, 0.03, 2, 30) GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") SpawnPrefab("collapse_big").Transform:SetPosition(darkgrass.Transform:GetWorldPosition()) local giant = SpawnPrefab("guano") giant.Transform:SetPosition(darkgrass.Transform:GetWorldPosition()) giant.entity:AddSoundEmitter() giant.AnimState:SetBank("wilson") giant.AnimState:SetBuild("wolfgang") giant.AnimState:PlayAnimation("idle") giant.AnimState:OverrideSymbol("swap_object", "swap_ham_bat", "swap_ham_bat") giant.AnimState:OverrideSymbol("swap_body", "armor_slurper", "swap_body") giant.AnimState:Show("ARM_carry") giant.AnimState:Hide("ARM_normal") giant.Transform:SetFourFaced() giant.Transform:SetScale(3.5,3.5,3.5) local sound = giant.entity:AddSoundEmitter() local shadow = giant.entity:AddDynamicShadow() shadow:SetSize( 6, 3.5 ) MakeCharacterPhysics(giant, 200, 1) local minimap = giant.entity:AddMiniMapEntity() minimap:SetIcon("wolfgang.png") local brain = require "brains/leifbrain" giant:SetBrain(brain) giant:AddComponent("locomotor") giant.components.locomotor.walkspeed = 1 giant.components.locomotor.runspeed = 2 giant:SetStateGraph("SGshadowwaxwell") giant:RemoveComponent("stackable") giant:RemoveComponent("inventoryitem") giant:RemoveComponent("fertilizer") giant:RemoveComponent("smotherer") giant:RemoveComponent("fuel") giant:RemoveComponent("burnable") giant:RemoveComponent("propagator") giant:RemoveComponent("deployable") if giant.flies then giant.flies:Remove() giant.flies = nil end giant:AddComponent("follower") giant:AddComponent("inventory") giant:AddComponent("combat") giant.components.combat.hiteffectsymbol = "torso" giant.components.combat:SetDefaultDamage(70) giant.components.combat:SetAttackPeriod(3) giant.components.combat.onhitotherfn = function() giant.SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") GetPlayer().components.playercontroller:ShakeCamera(giant, "FULL", 0.5, 0.05, 2, 40) end giant.components.combat:SetAreaDamage(5, 0.8) giant.components.combat:SetRetargetFunction(3, function(giant) if not giant.components.health:IsDead() then return FindEntity(giant, 20, function(guy) return giant.components.combat:CanTarget(guy) and not guy:HasTag("giant") end ) end end ) giant:ListenForEvent("attacked", function(giant, data) giant.components.combat:SetTarget(data.attacker) end ) giant.Physics:SetCollisionCallback(function(giant, other) if other and other.components.workable and other.components.workable.workleft > 0 then other.components.workable:Destroy(giant) end end ) giant:AddComponent("health") giant.components.health:SetMaxHealth(8000) giant.components.health.nofadeout = true giant:AddComponent("sanityaura") giant.components.sanityaura.aura = -TUNING.SANITYAURA_LARGE giant:ListenForEvent("death", function() local pt1 = giant:GetPosition() for k = 1,math.random(20,35) do local gold = SpawnPrefab("goldnugget") gold.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 0, pt1.z+(math.random(3)-math.random(3))) end local rewards = {"walrus_tusk","trunk_summer","trunk_winter","deerclops_eyeball","minotaurhorn"} local reward = rewards[math.random(#rewards)] SpawnPrefab(reward).Transform:SetPosition(pt1.x, 0, pt1.z) end ) giant:DoTaskInTime(480, function(giant) giant:Remove() end ) giant:AddTag("monster") giant:AddTag("giant") end end ) darkgrass:AddTag("darkgrass") inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("darkgrass") then data.darkgrass = true end if inst:HasTag("giant") then data.giant = true end end local function onload(inst, data) if data and data.darkgrass then inst.AnimState:SetBank("marsh_plant") inst.AnimState:SetBuild("marsh_plant") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(1.8, 1.8, 1.8) inst.AnimState:SetMultColour(255/255,255/255,0/255,1) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("fertilizer") inst:RemoveComponent("smotherer") inst:RemoveComponent("fuel") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") MakeMediumBurnable(inst) MakeSmallPropagator(inst) if inst.flies then inst.flies:Remove() inst.flies = nil end inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.DIG) inst.components.workable:SetWorkLeft(1) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("nightmarefuel").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst:Remove() end ) inst:AddComponent("pickable") inst.components.pickable:SetUp("nightmarefuel", 480) inst.components.pickable:SetOnRegenFn(function(inst) inst.AnimState:SetMultColour(255/255,255/255,0/255,1) end ) inst.components.pickable:SetOnPickedFn(function(inst) inst.AnimState:SetMultColour(255/255,255/255,255/255,1) if math.random()<0.05 then GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 1.5, 0.03, 2, 30) GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) local giant = SpawnPrefab("guano") giant.Transform:SetPosition(inst.Transform:GetWorldPosition()) giant.entity:AddSoundEmitter() giant.AnimState:SetBank("wilson") giant.AnimState:SetBuild("wolfgang") giant.AnimState:PlayAnimation("idle") giant.AnimState:OverrideSymbol("swap_object", "swap_ham_bat", "swap_ham_bat") giant.AnimState:OverrideSymbol("swap_body", "armor_slurper", "swap_body") giant.AnimState:Show("ARM_carry") giant.AnimState:Hide("ARM_normal") giant.Transform:SetFourFaced() giant.Transform:SetScale(3.5,3.5,3.5) local sound = giant.entity:AddSoundEmitter() local shadow = giant.entity:AddDynamicShadow() shadow:SetSize( 6, 3.5 ) MakeCharacterPhysics(giant, 200, 1) local minimap = giant.entity:AddMiniMapEntity() minimap:SetIcon("wolfgang.png") local brain = require "brains/leifbrain" giant:SetBrain(brain) giant:AddComponent("locomotor") giant.components.locomotor.walkspeed = 1 giant.components.locomotor.runspeed = 2 giant:SetStateGraph("SGshadowwaxwell") giant:RemoveComponent("stackable") giant:RemoveComponent("inventoryitem") giant:RemoveComponent("fertilizer") giant:RemoveComponent("smotherer") giant:RemoveComponent("fuel") giant:RemoveComponent("burnable") giant:RemoveComponent("propagator") giant:RemoveComponent("deployable") if giant.flies then giant.flies:Remove() giant.flies = nil end giant:AddComponent("follower") giant:AddComponent("inventory") giant:AddComponent("combat") giant.components.combat.hiteffectsymbol = "torso" giant.components.combat:SetDefaultDamage(70) giant.components.combat:SetAttackPeriod(3) giant.components.combat.onhitotherfn = function() giant.SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") GetPlayer().components.playercontroller:ShakeCamera(giant, "FULL", 0.5, 0.05, 2, 40) end giant.components.combat:SetAreaDamage(5, 0.8) giant.components.combat:SetRetargetFunction(3, function(giant) if not giant.components.health:IsDead() then return FindEntity(giant, 20, function(guy) return giant.components.combat:CanTarget(guy) and not guy:HasTag("giant") end ) end end ) giant:ListenForEvent("attacked", function(giant, data) giant.components.combat:SetTarget(data.attacker) end ) giant.Physics:SetCollisionCallback(function(giant, other) if other and other.components.workable and other.components.workable.workleft > 0 then other.components.workable:Destroy(giant) end end ) giant:AddComponent("health") giant.components.health:SetMaxHealth(8000) giant.components.health.nofadeout = true giant:AddComponent("sanityaura") giant.components.sanityaura.aura = -TUNING.SANITYAURA_LARGE giant:ListenForEvent("death", function() local pt1 = giant:GetPosition() for k = 1,math.random(20,35) do local gold = SpawnPrefab("goldnugget") gold.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 0, pt1.z+(math.random(3)-math.random(3))) end local rewards = {"walrus_tusk","trunk_summer","trunk_winter","deerclops_eyeball","minotaurhorn"} local reward = rewards[math.random(#rewards)] SpawnPrefab(reward).Transform:SetPosition(pt1.x, 0, pt1.z) end ) giant:DoTaskInTime(480, function(giant) giant:Remove() end ) giant:AddTag("monster") giant:AddTag("giant") end end ) inst:AddTag("darkgrass") end if data and data.giant then inst.entity:AddSoundEmitter() inst.AnimState:SetBank("wilson") inst.AnimState:SetBuild("wolfgang") inst.AnimState:PlayAnimation("idle") inst.AnimState:OverrideSymbol("swap_object", "swap_ham_bat", "swap_ham_bat") inst.AnimState:OverrideSymbol("swap_body", "armor_slurper", "swap_body") inst.AnimState:Show("ARM_carry") inst.AnimState:Hide("ARM_normal") inst.Transform:SetFourFaced() inst.Transform:SetScale(3.5,3.5,3.5) local sound = inst.entity:AddSoundEmitter() local shadow = inst.entity:AddDynamicShadow() shadow:SetSize( 6, 3.5 ) MakeCharacterPhysics(inst, 200, 1) local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon("wolfgang.png") local brain = require "brains/leifbrain" inst:SetBrain(brain) inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 1 inst.components.locomotor.runspeed = 2 inst:SetStateGraph("SGshadowwaxwell") inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("fertilizer") inst:RemoveComponent("smotherer") inst:RemoveComponent("fuel") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") if inst.flies then inst.flies:Remove() inst.flies = nil end inst:AddComponent("follower") inst:AddComponent("inventory") inst:AddComponent("combat") inst.components.combat.hiteffectsymbol = "torso" inst.components.combat:SetDefaultDamage(70) inst.components.combat:SetAttackPeriod(3) inst.components.combat.onhitotherfn = function() inst.SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.5, 0.05, 2, 40) end inst.components.combat:SetAreaDamage(5, 0.8) inst.components.combat:SetRetargetFunction(3, function(inst) if not inst.components.health:IsDead() then return FindEntity(inst, 20, function(guy) return inst.components.combat:CanTarget(guy) and not guy:HasTag("giant") end ) end end ) inst:ListenForEvent("attacked", function(inst, data) inst.components.combat:SetTarget(data.attacker) end ) inst.Physics:SetCollisionCallback(function(inst, other) if other and other.components.workable and other.components.workable.workleft > 0 then other.components.workable:Destroy(inst) end end ) inst:AddComponent("health") inst.components.health:SetMaxHealth(8000) inst.components.health.nofadeout = true inst:AddComponent("sanityaura") inst.components.sanityaura.aura = -TUNING.SANITYAURA_LARGE inst:ListenForEvent("death", function() local pt1 = inst:GetPosition() for k = 1,math.random(20,35) do local gold = SpawnPrefab("goldnugget") gold.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 0, pt1.z+(math.random(3)-math.random(3))) end local rewards = {"walrus_tusk","trunk_summer","trunk_winter","deerclops_eyeball","minotaurhorn"} local reward = rewards[math.random(#rewards)] SpawnPrefab(reward).Transform:SetPosition(pt1.x, 0, pt1.z) end ) inst:DoTaskInTime(480, function(inst) inst:Remove() end ) inst:AddTag("monster") inst:AddTag("giant") end end inst.OnSave = onsave inst.OnLoad = onload 即可用鸟粪(白色便便)种噩梦草(请远离基地种植),可采摘噩梦燃料,每天都能采一次。采摘时有一定概率出现地下巨人,将攻击你,消灭巨人可获得黄金、巨鹿眼球、远古守护者角、海象牙等宝物。巨人的血量及攻击力都很强,如果打不过,就先逃跑避避风头,一天后巨人将回到地下。巨人在小地图上显示为大力士的图标,绕着点走吧

2025/04/23 · Bny

YN255-天然温泉(用触手皮种温泉,可恢复生命和脑,可抓鱼)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五五.天然温泉(用触手皮种温泉,可恢复生命和脑,可抓鱼) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/tentaclespots.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function spa(inst) local pt = inst:GetPosition() local spa = SpawnPrefab("tentaclespots") spa.Transform:SetPosition(pt.x, pt.y, pt.z) spa.AnimState:SetBank("marsh_tile") spa.AnimState:SetBuild("marsh_tile") spa.AnimState:PlayAnimation("idle_cave",true) spa.AnimState:SetOrientation( ANIM_ORIENTATION.OnGround ) spa.AnimState:SetLayer( LAYER_BACKGROUND ) spa.AnimState:SetSortOrder( 3 ) spa.Transform:SetScale(1.5, 1.5, 1.5) spa:RemoveComponent("inventoryitem") spa:RemoveComponent("stackable") spa:RemoveComponent("fuel") spa:RemoveComponent("burnable") spa:RemoveComponent("propagator") spa:RemoveComponent("deployable") if spa.components.edible then spa:RemoveComponent("edible") end spa:AddTag("NOCLICK") spa:AddTag("spa") spa:DoPeriodicTask(math.random(10,20), function(spa) local pt1 = spa:GetPosition() local names = {"fish","eel"} local name = names[math.random(#names)] local fish = SpawnPrefab(name) fish.Transform:SetPosition(pt1.x+(math.random(4)-math.random(4)), 0, pt1.z+(math.random(4)-math.random(4))) SpawnPrefab("splash").Transform:SetPosition(fish.Transform:GetWorldPosition()) spa:DoTaskInTime(0.5, function(spa) local pos = Vector3(spa.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 5) for k,v in pairs(ents) do if v.components.inventoryitem and not v.components.inventoryitem:IsHeld() then if v.prefab == "fish" or v.prefab == "eel" then SpawnPrefab("splash").Transform:SetPosition(v.Transform:GetWorldPosition()) v:Remove() end end end end ) end ) spa:DoPeriodicTask(3, function(spa) local pos2 = Vector3(spa.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos2.x,pos2.y,pos2.z, 4.8) for k,v in pairs(ents) do if v:HasTag("player") then v.components.health:DoDelta(v.components.health.maxhealth*.02) v.components.sanity:DoDelta(v.components.sanity.max*.02) end end end ) local rock1 = SpawnPrefab("tentaclespots") rock1.Transform:SetPosition(pt.x-3.3-0.5, 0, pt.z-3.3+0.5) rock1.AnimState:SetBank("rock") rock1.AnimState:SetBuild("rock") rock1.AnimState:PlayAnimation("full") rock1.Transform:SetScale(2, 2, 2) rock1:AddTag("sparock") rock1:RemoveComponent("inventoryitem") rock1:RemoveComponent("stackable") rock1:RemoveComponent("fuel") rock1:RemoveComponent("burnable") rock1:RemoveComponent("propagator") rock1:RemoveComponent("deployable") if rock1.components.edible then rock1:RemoveComponent("edible") end rock1:AddComponent("workable") rock1.components.workable:SetWorkAction(ACTIONS.HAMMER) rock1.components.workable:SetWorkLeft(3) rock1.components.workable:SetOnFinishCallback(function(rock1) SpawnPrefab("collapse_big").Transform:SetPosition(rock1.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") local pos3 = Vector3(rock1.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos3.x,pos3.y,pos3.z, 10) for k,v in pairs(ents) do if v:HasTag("spa") then v:Remove() end if v:HasTag("sparock") then v:Remove() end end rock1:Remove() end ) local rock2 = SpawnPrefab("tentaclespots") rock2.Transform:SetPosition(pt.x-2.1-2.8, 0, pt.z-2.1+2.8) rock2.AnimState:SetBank("firepit") rock2.AnimState:SetBuild("firepit") rock2.AnimState:PlayAnimation("idle",false) rock2.Transform:SetScale(0.6, 1, 0.6) rock2:AddTag("sparock") rock2:RemoveComponent("inventoryitem") rock2:RemoveComponent("stackable") rock2:RemoveComponent("fuel") rock2:RemoveComponent("burnable") rock2:RemoveComponent("propagator") rock2:RemoveComponent("deployable") if rock2.components.edible then rock2:RemoveComponent("edible") end rock2:AddComponent("burnable") rock2.components.burnable:SetFXLevel(5) rock2.components.burnable:AddBurnFX("campfirefire", Vector3(0,0.6,0) ) rock2.components.burnable:Ignite(true) rock2:AddComponent("cooker") local rock3 = SpawnPrefab("tentaclespots") rock3.Transform:SetPosition(pt.x+2.1+2.1, 0, pt.z-2.1+2.1) rock3.AnimState:SetBank("flowers") rock3.AnimState:SetBuild("flowers") rock3.AnimState:PlayAnimation("f10") rock3.Transform:SetScale(1.8, 1.8, 1.8) rock3:AddTag("sparock") rock3:RemoveComponent("inventoryitem") rock3:RemoveComponent("stackable") rock3:RemoveComponent("fuel") rock3:RemoveComponent("burnable") rock3:RemoveComponent("propagator") rock3:RemoveComponent("deployable") if rock3.components.edible then rock3:RemoveComponent("edible") end end local function OnDeploy (inst, pt) spa(inst) inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("spa") then data.spa = true end if inst:HasTag("sparock") then data.sparock = true end end local function onload(inst, data) if data and data.spa then spa(inst) inst:Remove() end if data and data.sparock then inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload 即可用触手皮种温泉(拿着1个触手皮对地面点鼠标右键,如果拿着多个触手皮,则不会种出来),站在水里可以取暖,并补充生命值和脑值。温泉里会有鱼跳出水面,按住键盘空格键不放,有机会抓住鱼,在温泉旁的火盆里烤鱼吃吧。不想要温泉时,用锤子砸掉大石头即可

2025/04/23 · Bny