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

YN286-收藏品期货市场(制造栏增加期货市场选项,炒作收藏品)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八六.收藏品期货市场(制造栏增加期货市场选项,炒作收藏品) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/constants.lua文件,在DRESS = {str = "DRESS", sort=9, icon = "tab_dress.tex"},的下一行插入MARKET = {str = "MARKET", sort = 12, icon = "tab_book.tex"}, 2.用MT管理器打开游戏目录/assets/scripts/strings.lua文件,在ANCIENT = "Ancient",的下一行插入MARKET = "Market", 3.用MT管理器打开游戏目录/assets/DLC0002/scripts/recipes.lua文件,在require "tuning"的下一行插入以下内容: ----MARKET---- Recipe("trinket_1", {Ingredient("goldnugget", math.random(4,8))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_2", {Ingredient("goldnugget", math.random(6,12))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_3", {Ingredient("goldnugget", math.random(4,8))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_4", {Ingredient("goldnugget", math.random(5,10))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_5", {Ingredient("goldnugget", math.random(4,8))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_6", {Ingredient("goldnugget", math.random(5,10))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_7", {Ingredient("goldnugget", math.random(4,8))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_8", {Ingredient("goldnugget", math.random(8,16))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_9", {Ingredient("goldnugget", math.random(7,14))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_10", {Ingredient("goldnugget", math.random(2,4))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_11", {Ingredient("goldnugget", math.random(5,10))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) Recipe("trinket_12", {Ingredient("goldnugget", math.random(8,16))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 4.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/trinkets.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddTag("trinket") 5.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/scienceprototyper.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function SpawnLootPrefab(inst, lootprefab) local player = GetPlayer() local loot = SpawnPrefab(lootprefab) player.components.inventory:GiveItem(loot) return loot end local function ShouldAcceptItem(inst, item) if item:HasTag("trinket") then return true end return false end local function OnGetItemFromPlayer(inst, giver, item) local recipe = GetRecipe(item.prefab) local loot = {} if item:HasTag("trinket") then for k,v in ipairs(recipe.ingredients) do if not string.find(v.type, "gem") then local amt = math.ceil(v.amount * 1) for n = 1, amt do table.insert(loot, v.type) end end end end if #loot <= 0 then return end for k,v in pairs(loot) do SpawnLootPrefab(item, v) end end inst:AddComponent("trader") inst.components.trader.onaccept = OnGetItemFromPlayer inst.components.trader:SetAcceptTest(ShouldAcceptItem) 即可在主角制造栏添加收藏品期货按钮(画着3本书),收藏品价格随每次读档而改变,在低价时买入(直接从造制造栏买入),在高价时卖出(拿着收藏品对科学机器点鼠标左键),获得当时标价的黄金(自动装入主角物品栏),从而赚取差价。如果同时修改了“手动存档”、“快速读档”(见本修改技巧),就可以在不退出游戏情况下,按F5存档,再按F6读档刷新价格。本条可以与“收藏品黑市”同时修改

2025/04/23 · Bny

YN287-巨型超市(在主角制造栏中增加商店选项,用黄金买珍贵物品)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八七.巨型超市(在主角制造栏中增加商店选项,用黄金买珍贵物品) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/constants.lua文件,将ANCIENT = {str = "ANCIENT", sort = 10, icon = "tab_crafting_table.tex"}替换为以下内容: ANCIENT = {str = "ANCIENT", sort = 10, icon = "tab_crafting_table.tex"}, SHOP = {str = "SHOP", sort = 11, icon = "tab_gemology.tex"} 2.用MT管理器打开游戏目录/assets/scripts/strings.lua文件,在ANCIENT = "Ancient",的下一行插入SHOP = "Shop", 3.用MT管理器打开游戏目录/assets/DLC0002/scripts/recipes.lua文件,在----GEMS----的下一行插入以下内容: ----SHOP---- Recipe("nightmarefuel", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("livinglog", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("gears", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("marble", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("petals_evil", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("boneshard", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("ice", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("slurtle_shellpieces", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("pigskin", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("silk", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("spidergland", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("tentaclespots", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("tentaclespike", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("feather_crow", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("feather_robin", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("feather_robin_winter", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("stinger", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("honeycomb", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("butterflywings", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("houndstooth", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("horn", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("tallbirdegg", {Ingredient("goldnugget", 1+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("manrabbit_tail", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("slurper_pelt", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("lightninggoathorn", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("batwing", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("trunk_summer", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("trunk_winter", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("walrus_tusk", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("deerclops_eyeball", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("minotaurhorn", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("dragon_scales", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("bearger_fur", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("goose_feather", {Ingredient("goldnugget", 1+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("coontail", {Ingredient("goldnugget", 1+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("poop", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("beardhair", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("mandrake", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("lightbulb", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("cactus_meat", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("cactus_flower", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("wormlight", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("lureplantbulb", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("fireflies", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("redgem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("bluegem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("orangegem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("yellowgem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("greengem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("thulecite_pieces", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("red_cap", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("green_cap", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("blue_cap", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("monstermeat", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("honey", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("butter", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("butterflymuffin", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("frogglebunwich", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("taffy", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("pumpkincookie", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("stuffedeggplant", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("fishsticks", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("honeynuggets", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("honeyham", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("dragonpie", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("kabobs", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("mandrakesoup", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("baconeggs", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("meatballs", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("bonestew", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("perogies", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("turkeydinner", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("ratatouille", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("jammypreserves", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("fruitmedley", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("fishtacos", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("waffles", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("unagi", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("flowersalad", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("icecream", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("watermelonicle", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("trailmix", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("hotchili", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("guacamole", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("krampus_sack", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("slurtlehat", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) Recipe("armorsnurtleshell", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 即可在主角制造栏中增加商店选项(制造栏最底下画着宝石戒指),用黄金购买珍贵物品,包括坎普斯背包、珍贵材料、料理等。每次读档后,超市价格都会有一定浮动,趁打折时多买一些吧。如果同时修改了“菜市场”、“肉食店”、“流动商贩”、“杂货收购行”、“收藏品黑市”、“收藏品期货市场”(见本修改技巧),即可通过出售农产品、肉类、杂货、收藏品换取购物的黄金,形成饥荒世界完整的金钱交易体系。不要与“制造坎普斯背包”一同修改

2025/04/23 · Bny

YN288-刮刮乐(给路牌黄金买刮刮乐彩票中大奖)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八八.刮刮乐(给路牌黄金买刮刮乐彩票中大奖) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/homesign.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function ShouldAcceptItem(inst, item) if item.prefab == "goldnugget" then return true end return false end local function OnGetItemFromPlayer(inst, giver, item) if item.prefab == "goldnugget" then local papyrus = SpawnPrefab("papyrus") papyrus:AddComponent("lootdropper") papyrus.components.inspectable.getstatus = function(papyrus) if math.random()<.01 then for k = 1, 50 do papyrus.components.lootdropper:SpawnLootPrefab("goldnugget") end elseif math.random()<.05 then for k = 1, 10 do papyrus.components.lootdropper:SpawnLootPrefab("goldnugget") end elseif math.random()<.15 then for k = 1, 2 do papyrus.components.lootdropper:SpawnLootPrefab("goldnugget") end elseif math.random()<.3 then papyrus.components.lootdropper:SpawnLootPrefab("goldnugget") else papyrus.components.lootdropper:SpawnLootPrefab("ash") end SpawnPrefab("collapse_small").Transform:SetPosition(papyrus.Transform:GetWorldPosition()) papyrus.components.stackable:Get():Remove() end giver.components.inventory:GiveItem(papyrus) end end inst:AddComponent("trader") inst.components.trader.onaccept = OnGetItemFromPlayer inst.components.trader:SetAcceptTest(ShouldAcceptItem) 即可给路牌黄金买刮刮乐彩票(拿黄金对路牌按鼠标左键),彩票(1张纸)直接装入主角物品栏,对物品栏中的纸按鼠标右键即可刮奖,一等奖50个黄金,二等奖10个黄金,三等奖2个黄金,四等奖1个黄金,末等奖只有一团灰。存档退出时,身上不要留彩票,因为再读档后会过期作废(不能再刮奖)

2025/04/23 · Bny

YN289-自动取款机(用活木头种自动取款机,存入的黄金每天给3%利息)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二八九.自动取款机(用活木头种自动取款机,存入的黄金每天给3%利息) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/livinglog.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function itemtest(inst, item, slot) if item.prefab == "goldnugget" then return true end return false end local slotpos = {} for y = 2, 0, -1 do for x = 0, 8 do table.insert(slotpos, Vector3(75*x-75*2+75, 75*y-75*2+75,0)) end end local function OnDeploy (inst, pt) local bank = SpawnPrefab("livinglog") bank.Transform:SetPosition(pt.x, pt.y, pt.z) bank.Transform:SetScale(1.5, 1.5, 1.5) bank.AnimState:SetBank("ruins_vase") bank.AnimState:SetBuild("ruins_vase") bank.AnimState:PlayAnimation("idle") bank:RemoveComponent("stackable") bank:RemoveComponent("fuel") bank:RemoveComponent("edible") bank:RemoveComponent("inventoryitem") bank:RemoveComponent("repairer") bank:RemoveComponent("burnable") bank:RemoveComponent("propagator") bank:RemoveComponent("deployable") bank.components.container.canbeopened = true bank:AddComponent("workable") bank.components.workable:SetWorkAction(ACTIONS.HAMMER) bank.components.workable:SetWorkLeft(3) bank.components.workable:SetOnFinishCallback(function(bank) SpawnPrefab("collapse_big").Transform:SetPosition(bank.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") bank:Remove() end ) bank:ListenForEvent( "daytime", function() local num_found = 0 for k,v in pairs(bank.components.container.slots) do if v and v.prefab == "goldnugget" then num_found = num_found + v.components.stackable:StackSize() end end local Interests = math.floor(num_found/100*3) for k = 1, Interests do bank.components.container:ConsumeByName("goldnugget", -1) end end, GetWorld()) bank:AddTag("banks") inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("banks") then data.banks = true end end local function onload(inst, data) if data and data.banks then inst.Transform:SetScale(1.5, 1.5, 1.5) inst.AnimState:SetBank("ruins_vase") inst.AnimState:SetBuild("ruins_vase") inst.AnimState:PlayAnimation("idle") inst:RemoveComponent("stackable") inst:RemoveComponent("fuel") inst:RemoveComponent("edible") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("repairer") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") inst.components.container.canbeopened = true 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:ListenForEvent( "daytime", function() local num_found = 0 for k,v in pairs(inst.components.container.slots) do if v and v.prefab == "goldnugget" then num_found = num_found + v.components.stackable:StackSize() end end local Interests = math.floor(num_found/100*3) for k = 1, Interests do inst.components.container:ConsumeByName("goldnugget", -1) end end, GetWorld()) inst:AddTag("banks") 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(-100,200,0) inst.components.container.side_align_tip = 160 inst.components.container.canbeopened = false inst.components.container.itemtestfn = itemtest 即可用活木头种自动取款机,鼠标左键点击打开格子,再点击关闭,只能用于存取黄金。将黄金放入取款机,每日天亮时将给予3%利息,不足1个黄金的零头自动抹去(比如存90个黄金,利息为2.7,则只给2个黄金)。土豪们,这是饥荒世界提供的金融服务,将巨款存进去,躺着吃利息吧。如果不想要自动取款机了,用锤子砸掉即可,记住之前把钱取出来哦

2025/04/23 · Bny

YN290-逝者的赌局(绳子种人骨,用黄金下注猪拳击手生死战)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二九0.逝者的赌局(绳子种人骨,用黄金下注猪拳击手生死战) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rope.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function OnDeploy (inst, pt) local skeleton = SpawnPrefab("skeleton") if skeleton then skeleton:PushEvent("growfromrope") skeleton.Transform:SetPosition(pt.x, pt.y, pt.z) inst.components.stackable:Get():Remove() end end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/skeleton.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function game(inst) local light = inst.entity:AddLight() light:Enable(true) local num_found = 0 for k,v in pairs(inst.components.container.slots) do if v and v.prefab == "goldnugget" then num_found = num_found + v.components.stackable:StackSize() end end inst.components.container:Close(GetPlayer()) inst.components.container.canbeopened = false GetPlayer().components.playercontroller:Enable(false) local bonuspoint1 = math.random(5) local bonuspoint2 = math.random(5) local pt = Vector3(inst.Transform:GetWorldPosition()) local red = SpawnPrefab("pigman") red.Transform:SetPosition(pt.x+4+3, 0, pt.z+4-3) red.components.health:SetMaxHealth(100 * bonuspoint1) red.components.health:DoDelta(200 * bonuspoint1) red.AnimState:SetMultColour(255/255,0/255,0/255,1) red.AnimState:OverrideSymbol("swap_hat", "hat_football", "swap_hat") red.AnimState:Show("hat") local blue = SpawnPrefab("pigman") blue.Transform:SetPosition(pt.x+4-3, 0, pt.z+4+3) blue.components.health:SetMaxHealth(100 * bonuspoint2) blue.components.health:DoDelta(200 * bonuspoint2) blue.AnimState:SetMultColour(0/255,100/255,255/255,1) blue.AnimState:OverrideSymbol("swap_hat", "hat_football", "swap_hat") blue.AnimState:Show("hat") red.components.combat.target = blue blue.components.combat.target = red TheCamera:SetTarget(red) red:ListenForEvent("death", function() inst:DoTaskInTime(3, function() blue:Remove() GetPlayer().components.sanity:DoDelta(-10) GetPlayer().AnimState:PlayAnimation("hit") GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") inst.components.container:DestroyContents() inst.components.container.canbeopened = true GetPlayer().components.playercontroller:Enable(true) TheCamera:SetTarget(GetPlayer()) light:Enable(false) end ) end ) blue:ListenForEvent("death", function() inst:DoTaskInTime(3, function() red:Remove() GetPlayer().components.sanity:DoDelta(10) for k = 1, num_found do inst.components.container:ConsumeByName("goldnugget", -1) end GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/get_gold") inst.components.container.canbeopened = true GetPlayer().components.playercontroller:Enable(true) TheCamera:SetTarget(GetPlayer()) light:Enable(false) end ) end ) end local slotpos = { Vector3(0,-75,0)} local widgetbuttoninfo = { text = "GO", position = Vector3(0, -165, 0), fn = function(inst) if not inst.components.container:IsEmpty() then game(inst) end end } local function itemtest(inst, item, slot) if item.prefab == "goldnugget" then return true end return false end inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(0,200,0) inst.components.container.side_align_tip = 160 inst.components.container.itemtestfn = itemtest inst.components.container.widgetbuttoninfo = widgetbuttoninfo local light = inst.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(50) light:Enable(false) light:SetColour(180/255, 195/255, 50/255) MakeMediumBurnable(inst) 即可用绳子种人骨头,鼠标左键点人骨,出现1个格子及GO按钮,在格子中放入黄金后(赌金随意)按GO按钮,红、蓝两个猪拳手出击对战,如果红方获胜,你就赢得1倍奖金(在人骨的格子里领取),并增加10点脑。如果蓝方获胜,格子里的赌金将被收走(逝者获胜),同时减10点脑。平局(双方同时死)判定为逝者获胜。比赛中主角无法走动及攻击(防止作弊),但可以边吃东西边看比赛。人骨最好种在远离猪房、兔房的空旷处,以免干扰比赛。不想要人骨了,烧掉即可。逝者的赌局全天开放,不要沉迷赌博哦

2025/04/23 · Bny

YN291-小酒馆(用剃刀种小酒馆,听音乐、喝烧酒、吃料理、小憩一下)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二九一.小酒馆(用剃刀种小酒馆,听音乐、喝烧酒、吃料理、小憩一下) 用MT管理器打开游戏目录/assets/scripts/prefabs/razor.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function bar(inst) local pt = inst:GetPosition() local waiter = SpawnPrefab("razor") waiter.Transform:SetPosition(pt.x, pt.y, pt.z) waiter.AnimState:SetBank("wilson") waiter.AnimState:SetBuild("wes") waiter.AnimState:Hide("ARM_carry") waiter.AnimState:Show("ARM_normal") waiter.Transform:SetFourFaced() waiter.AnimState:PlayAnimation("idle") waiter:AddTag("waiter") waiter:RemoveComponent("inventoryitem") waiter:RemoveComponent("shaver") waiter:RemoveComponent("deployable") waiter:AddComponent("trader") waiter.components.trader:SetAcceptTest(function(waiter, item) if GetPlayer().components.inventory:Has("goldnugget", 1) then if item.prefab == "goldnugget" then return true end end return false end ) waiter.components.trader.onaccept = function(waiter, giver, item) waiter.AnimState:PlayAnimation("idle_onemanband1_loop",true) waiter:DoTaskInTime(5, function() waiter.AnimState:PlayAnimation("idle") end ) GetPlayer().components.sanity:DoDelta(3) end local bar = SpawnPrefab("razor") bar.Transform:SetPosition(pt.x+0.8, 0, pt.z+0.8) bar.AnimState:SetBank("ruins_table") bar.AnimState:SetBuild("ruins_table") bar.AnimState:PlayAnimation("idle") bar:AddTag("goodbye") bar:RemoveComponent("inventoryitem") bar:RemoveComponent("shaver") bar:RemoveComponent("deployable") bar:AddComponent("trader") bar.components.trader:SetAcceptTest(function(bar, item) if GetPlayer().components.inventory:Has("goldnugget", 5) then if item.prefab == "goldnugget" then return true end end return false end ) bar.components.trader.onaccept = function(bar, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 4) waiter.AnimState:PlayAnimation("give") local wine = SpawnPrefab("razor") wine.AnimState:SetBank("ruins_vase") wine.AnimState:SetBuild("ruins_vase") wine.AnimState:PlayAnimation("idle") wine.Transform:SetScale(0.5, 0.5, 0.5) wine.Physics:SetActive(false) wine:AddTag("goodbye") wine.components.inventoryitem.canbepickedup = false local follower = wine.entity:AddFollower() follower:FollowSymbol( bar.GUID, "swap_object", -100, -170, 0 ) wine.components.inspectable.getstatus = function(wine) wine:Remove() wine = nil GetPlayer().sg:GoToState("eat") GetPlayer().components.sanity:DoDelta(-5) GetPlayer().components.health:DoDelta(20) end end local icebox = SpawnPrefab("razor") icebox.Transform:SetPosition(pt.x-1.6+0.8, 0, pt.z+1.6+0.8) icebox.AnimState:SetBank("icebox") icebox.AnimState:SetBuild("ice_box") icebox.AnimState:PlayAnimation("closed") icebox.AnimState:SetMultColour(255/255,255/255,255/255,1) icebox:AddTag("goodbye") icebox:RemoveComponent("inventoryitem") icebox:RemoveComponent("shaver") icebox:RemoveComponent("deployable") icebox:AddComponent("trader") icebox.components.trader:SetAcceptTest(function(icebox, item) if GetPlayer().components.inventory:Has("goldnugget", 5) then if item.prefab == "goldnugget" then return true end end return false end ) icebox.components.trader.onaccept = function(icebox, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 4) waiter.AnimState:PlayAnimation("give") local names = {"butterflymuffin","frogglebunwich","taffy","pumpkincookie","stuffedeggplant","fishsticks","honeynuggets","honeyham","dragonpie","kabobs","mandrakesoup","baconeggs","meatballs","bonestew","perogies","turkeydinner","ratatouille","jammypreserves","fruitmedley","fishtacos","waffles","unagi","flowersalad","icecream","watermelonicle","trailmix","hotchili","guacamole"} local name = names[math.random(#names)] local snack = SpawnPrefab(name) giver.components.inventory:GiveItem(snack) end local chair = SpawnPrefab("razor") chair.Transform:SetPosition(pt.x+1.5+0.8, 0, pt.z-1.5+0.8) chair.AnimState:SetBank("ruins_chair") chair.AnimState:SetBuild("ruins_chair") chair.AnimState:PlayAnimation("idle") chair:AddTag("goodbye") chair:RemoveComponent("inventoryitem") chair:RemoveComponent("shaver") chair:RemoveComponent("deployable") chair.components.inspectable.getstatus = function() TheFrontEnd:Fade(true,1) GetClock():NextPhase() GetPlayer().components.hunger:DoDelta(-10) GetPlayer().components.sanity:DoDelta(25) end local music = SpawnPrefab("razor") music.Transform:SetPosition(pt.x+1.5-0.8, 0, pt.z-1.5-0.8) music.AnimState:SetBank("phonograph") music.AnimState:SetBuild("phonograph") music.AnimState:PlayAnimation("idle") music:AddTag("goodbye") music:RemoveComponent("inventoryitem") music:RemoveComponent("shaver") music:RemoveComponent("deployable") music.entity:AddSoundEmitter() music:AddComponent("machine") music.components.machine.turnonfn = function(music) music.AnimState:PlayAnimation("play_loop", true) music.SoundEmitter:PlaySound("dontstarve/maxwell/ragtime", "ragtime") end music.components.machine.turnofffn = function(music) music.AnimState:PlayAnimation("idle") music.SoundEmitter:KillSound("ragtime") music.SoundEmitter:PlaySound("dontstarve/music/gramaphone_end") end music.components.machine:TurnOff() local pot = SpawnPrefab("razor") pot.Transform:SetPosition(pt.x-1.5-1.1, 0, pt.z+1.5-1.1) pot.AnimState:SetBank("cook_pot") pot.AnimState:SetBuild("cook_pot") pot.Transform:SetScale(0.8, 0.8, 0.8) pot.AnimState:PlayAnimation("cooking_loop", true) pot:AddTag("goodbye") pot:RemoveComponent("inventoryitem") pot:RemoveComponent("shaver") pot:RemoveComponent("deployable") pot.AnimState:SetBloomEffectHandle("shaders/anim.ksh") local light = pot.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(10) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) end local function OnDeploy (inst, pt) bar(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("waiter") then data.waiter = true end if inst:HasTag("goodbye") then data.goodbye = true end end local function onload(inst, data) if data and data.waiter then bar(inst) inst:Remove() end if data and data.goodbye then inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload MakeLargeBurnable(inst) MakeLargePropagator(inst) 即可用剃刀种小酒馆,给桌子5个黄金(拿着黄金对桌子点鼠标左键),服务员会为你热1瓶烧酒,左键点桌上的酒瓶即可喝掉,补20点血,但会减5点脑(喝多了会头晕)。给冰箱5个黄金,可以购买料理(直接放入物品栏)。如果你满意酒馆的服务,可以向服务员支付小费(拿着黄金对服务员点鼠标左键),每次1个黄金,补3点脑。如果想休息一下,就用左键点椅子,时间会跳到下一时段,补25点脑,减少10点饥饿。鼠标右键点留声机,可以开关音乐。冬天天冷时,靠近锅会很暖和。不想要小酒馆时,烧掉即可。剃刀在工具选项(画着斧子和镐)下,用2个树枝、2个燧石制造

2025/04/23 · Bny

YN292-野球拳赌场(用火腿短棍种野球拳赌场,与庄家玩剪刀、石头、布赢奖金)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二九二.野球拳赌场(用火腿短棍种野球拳赌场,与庄家玩剪刀、石头、布赢奖金) 用MT管理器打开游戏目录/assets/scripts/prefabs/hambat.lua文件, 1.在Asset("ANIM", "anim/swap_ham_bat.zip"),的下一行插入以下内容: Asset("ANIM", "anim/wolfgang.zip"), Asset("ANIM", "anim/wolfgang_skinny.zip"), Asset("ANIM", "anim/wolfgang_mighty.zip"), Asset("ANIM", "anim/player_wolfgang.zip"), 2.将inst.OnLoad = OnLoad替换为以下内容: local function game(inst) local pt = inst:GetPosition() local makers = SpawnPrefab("hambat") makers.Transform:SetPosition(pt.x, pt.y, pt.z) makers.AnimState:SetBank("wilson") makers.AnimState:SetBuild("wolfgang") makers.AnimState:Hide("ARM_carry") makers.AnimState:Show("ARM_normal") makers.Transform:SetFourFaced() makers.AnimState:PlayAnimation("idle") makers:RemoveComponent("weapon") makers:RemoveComponent("edible") makers:RemoveComponent("perishable") makers:RemoveComponent("inventoryitem") makers:RemoveComponent("equippable") makers:RemoveTag("show_spoilage") makers:AddTag("makers") local light = makers.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(10) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) local chest1 = SpawnPrefab("hambat") chest1.Transform:SetPosition(pt.x-1+2, pt.y, pt.z-1-2) chest1.AnimState:SetBank("pandoras_chest_large") chest1.AnimState:SetBuild("pandoras_chest_large") chest1.AnimState:PlayAnimation("closed") chest1.AnimState:SetBloomEffectHandle("shaders/anim.ksh") chest1:RemoveComponent("weapon") chest1:RemoveComponent("edible") chest1:RemoveComponent("perishable") chest1:RemoveComponent("inventoryitem") chest1:RemoveComponent("equippable") chest1:RemoveTag("show_spoilage") chest1:AddTag("goodbye") local chest2 = SpawnPrefab("hambat") chest2.Transform:SetPosition(pt.x-1-2, pt.y, pt.z-1+2) chest2.AnimState:SetBank("pandoras_chest_large") chest2.AnimState:SetBuild("pandoras_chest_large") chest2.AnimState:PlayAnimation("closed") chest2.AnimState:SetBloomEffectHandle("shaders/anim.ksh") chest2:RemoveComponent("weapon") chest2:RemoveComponent("edible") chest2:RemoveComponent("perishable") chest2:RemoveComponent("inventoryitem") chest2:RemoveComponent("equippable") chest2:RemoveTag("show_spoilage") chest2:AddTag("goodbye") local carpet = SpawnPrefab("hambat") carpet.Transform:SetPosition(pt.x+2.5, 0, pt.z+2.5) carpet.AnimState:SetBuild("staff_purple_base_ground") carpet.AnimState:SetBank("staff_purple_base_ground") carpet.AnimState:PlayAnimation("idle") carpet.AnimState:SetOrientation( ANIM_ORIENTATION.OnGround ) carpet.AnimState:SetLayer( LAYER_BACKGROUND ) carpet.AnimState:SetSortOrder( 3 ) carpet.Transform:SetRotation( 45 ) carpet.AnimState:SetMultColour(255/255,0/255,0/255,1) carpet.AnimState:SetBloomEffectHandle("shaders/anim.ksh") carpet:RemoveComponent("weapon") carpet:RemoveComponent("edible") carpet:RemoveComponent("perishable") carpet:RemoveComponent("inventoryitem") carpet:RemoveComponent("equippable") carpet:RemoveTag("show_spoilage") carpet:AddTag("goodbye") carpet:AddComponent("trader") carpet.components.trader:SetAcceptTest(function(carpet, item) if GetPlayer().components.inventory:Has("goldnugget", 11) then if item.prefab == "goldnugget" then return true end end return false end ) carpet.components.trader.onaccept = function(carpet, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 9) makers.AnimState:PlayAnimation("give") local gold = SpawnPrefab("hambat") gold.Transform:SetPosition(pt.x+2.5, 0, pt.z+2.5) gold.AnimState:SetBank("goldnugget") gold.AnimState:SetBuild("gold_nugget") gold.AnimState:PlayAnimation("idle") gold.AnimState:PlayAnimation("sparkle") gold.AnimState:PushAnimation("idle") gold:RemoveComponent("weapon") gold:RemoveComponent("edible") gold:RemoveComponent("perishable") gold:RemoveComponent("inventoryitem") gold:RemoveComponent("equippable") gold:RemoveTag("show_spoilage") gold:AddTag("goodbye") local rock = SpawnPrefab("hambat") rock.Transform:SetPosition(pt.x+4+1.8, 0, pt.z+4-1.8) rock.AnimState:SetBank("rocks") rock.AnimState:SetBuild("rocks") rock.AnimState:PlayAnimation("f1") rock:RemoveComponent("weapon") rock:RemoveComponent("edible") rock:RemoveComponent("perishable") rock:RemoveComponent("inventoryitem") rock:RemoveComponent("equippable") rock:RemoveTag("show_spoilage") rock:AddTag("goodbye") rock.Transform:SetScale(1.2, 1.2, 1.2) rock.AnimState:SetBloomEffectHandle("shaders/anim.ksh") local shears = SpawnPrefab("hambat") shears.Transform:SetPosition(pt.x+4, 0, pt.z+4) shears.AnimState:SetBank("razor") shears.AnimState:SetBuild("razor") shears.AnimState:PlayAnimation("idle") shears:RemoveComponent("weapon") shears:RemoveComponent("edible") shears:RemoveComponent("perishable") shears:RemoveComponent("inventoryitem") shears:RemoveComponent("equippable") shears:RemoveTag("show_spoilage") shears:AddTag("goodbye") shears.Transform:SetScale(1.2, 1.2, 1.2) shears.AnimState:SetBloomEffectHandle("shaders/anim.ksh") local colth = SpawnPrefab("hambat") colth.Transform:SetPosition(pt.x+3.8-1.9, 0, pt.z+3.8+1.9) colth.AnimState:SetBank("blueprint") colth.AnimState:SetBuild("blueprint") colth.AnimState:PlayAnimation("idle") colth:RemoveComponent("weapon") colth:RemoveComponent("edible") colth:RemoveComponent("perishable") colth:RemoveComponent("inventoryitem") colth:RemoveComponent("equippable") colth:RemoveTag("show_spoilage") colth:AddTag("goodbye") colth.Transform:SetScale(1.2, 1.2, 1.2) colth.AnimState:SetBloomEffectHandle("shaders/anim.ksh") local names = {"rocks","razor","blueprint"} local goldnugget = SpawnPrefab("goldnugget") rock.components.inspectable.getstatus = function(rock) makers.AnimState:PlayAnimation("give") local name = names[math.random(#names)] local fist = SpawnPrefab(name) fist.Transform:SetPosition(pt.x+0.7, 0, pt.z+0.7) fist:AddTag("goodbye") fist.Transform:SetScale(1.2, 1.2, 1.2) fist.AnimState:SetBloomEffectHandle("shaders/anim.ksh") fist.components.inventoryitem.canbepickedup = false shears:Remove() colth:Remove() GetPlayer():DoTaskInTime(3, function() rock:Remove() fist:Remove() gold:Remove() end ) if fist.prefab == "rocks" then makers.AnimState:SetBuild("wolfgang") GetPlayer():DoTaskInTime(3, function() for k = 1, 10 do GetPlayer().components.inventory:GiveItem(goldnugget) end end ) end if fist.prefab == "razor" then makers.AnimState:SetBuild("wolfgang_skinny") makers.AnimState:PlayAnimation("hit") GetPlayer():DoTaskInTime(3, function() for k = 1, 20 do GetPlayer().components.inventory:GiveItem(goldnugget) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/get_gold") end end ) end if fist.prefab == "blueprint" then makers.AnimState:SetBuild("wolfgang_mighty") makers.AnimState:PlayAnimation("idle_onemanband1_loop",true) GetPlayer():DoTaskInTime(3, function() makers.AnimState:PlayAnimation("idle") SpawnPrefab("collapse_small").Transform:SetPosition(pt.x+2.5, 0, pt.z+2.5) GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") end ) end end shears.components.inspectable.getstatus = function(shears) makers.AnimState:PlayAnimation("give") local name = names[math.random(#names)] local fist = SpawnPrefab(name) fist.Transform:SetPosition(pt.x+0.7, 0, pt.z+0.7) fist:AddTag("goodbye") fist.Transform:SetScale(1.2, 1.2, 1.2) fist.AnimState:SetBloomEffectHandle("shaders/anim.ksh") fist.components.inventoryitem.canbepickedup = false rock:Remove() colth:Remove() GetPlayer():DoTaskInTime(3, function() shears:Remove() fist:Remove() gold:Remove() end ) if fist.prefab == "razor" then makers.AnimState:SetBuild("wolfgang") GetPlayer():DoTaskInTime(3, function() for k = 1, 10 do GetPlayer().components.inventory:GiveItem(goldnugget) end end ) end if fist.prefab == "blueprint" then makers.AnimState:SetBuild("wolfgang_skinny") makers.AnimState:PlayAnimation("hit") GetPlayer():DoTaskInTime(3, function() for k = 1, 20 do GetPlayer().components.inventory:GiveItem(goldnugget) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/get_gold") end end ) end if fist.prefab == "rocks" then makers.AnimState:SetBuild("wolfgang_mighty") makers.AnimState:PlayAnimation("idle_onemanband1_loop",true) GetPlayer():DoTaskInTime(3, function() makers.AnimState:PlayAnimation("idle") SpawnPrefab("collapse_small").Transform:SetPosition(pt.x+2.5, 0, pt.z+2.5) GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") end ) end end colth.components.inspectable.getstatus = function(colth) makers.AnimState:PlayAnimation("give") local name = names[math.random(#names)] local fist = SpawnPrefab(name) fist.Transform:SetPosition(pt.x+0.7, 0, pt.z+0.7) fist:AddTag("goodbye") fist.Transform:SetScale(1.2, 1.2, 1.2) fist.AnimState:SetBloomEffectHandle("shaders/anim.ksh") fist.components.inventoryitem.canbepickedup = false shears:Remove() rock:Remove() GetPlayer():DoTaskInTime(3, function() colth:Remove() fist:Remove() gold:Remove() end ) if fist.prefab == "blueprint" then makers.AnimState:SetBuild("wolfgang") GetPlayer():DoTaskInTime(3, function() for k = 1, 10 do GetPlayer().components.inventory:GiveItem(goldnugget) end end ) end if fist.prefab == "rocks" then makers.AnimState:SetBuild("wolfgang_skinny") makers.AnimState:PlayAnimation("hit") GetPlayer():DoTaskInTime(3, function() for k = 1, 20 do GetPlayer().components.inventory:GiveItem(goldnugget) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/get_gold") end end ) end if fist.prefab == "razor" then makers.AnimState:SetBuild("wolfgang_mighty") makers.AnimState:PlayAnimation("idle_onemanband1_loop",true) GetPlayer():DoTaskInTime(3, function() makers.AnimState:PlayAnimation("idle") SpawnPrefab("collapse_small").Transform:SetPosition(pt.x+2.5, 0, pt.z+2.5) GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") end ) end end end end local function OnDeploy (inst, pt) game(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("makers") then data.makers = true end if inst:HasTag("goodbye") then data.goodbye = true end end local function onload(inst, data) if data and data.makers then game(inst) inst:Remove() end if data and data.goodbye then inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload MakeLargeBurnable(inst) MakeLargePropagator(inst) 即可用火腿短棍种野球拳赌场,给红色三角10个黄金(拿着黄金对红色三角点鼠标左键),会出现石头、剪子、布选项,用鼠标左键点击要出的选项(比如点石头),庄家会同时出拳。野球拳的规则是,石头赢剪子输布、剪子赢布输石头、布赢石头输剪子。如果胜利则获得本金加10个黄金(共20个黄金),打平退还本金,输了就输掉本金。庄家不会与穷光蛋对赌,在付了10个黄金的本金后,身上至少须保有1个黄金。不想要野球拳赌场时,烧掉即可。火腿短棍在战斗选项(画着两把剑)下,用1个猪皮、2个树枝、2个大肉制造

2025/04/23 · Bny

YN293-网上宠宠店(将鸟、兔子、昆虫、鼹鼠放入网店销售箱在线销售)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二九三.网上宠宠店(将鸟、兔子、昆虫、鼹鼠放入网店销售箱在线销售) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rabbit.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("stackable") inst.components.stackable.maxsize = 999 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/birds.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("stackable") inst.components.stackable.maxsize = 999 3.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/mole.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("stackable") inst.components.stackable.maxsize = 999 4.用MT管理器打开游戏目录/assets/scripts/prefabs/bugnet.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function netsell(inst) inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" ) inst:DoTaskInTime(3, function() inst.AnimState:SetBloomEffectHandle( "" ) end ) if inst.components.container:Has("goldnugget", 10) then if inst.components.container:Has("bee", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("bee", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum) end if inst.components.container:Has("killerbee", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("killerbee", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum*2) end if inst.components.container:Has("butterfly", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("butterfly", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum) end if inst.components.container:Has("fireflies", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("fireflies", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum*2) end if inst.components.container:Has("crow", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("crow", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum*3) end if inst.components.container:Has("robin", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("robin", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum*3) end if inst.components.container:Has("robin_winter", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("robin_winter", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum*3) end if inst.components.container:Has("rabbit", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("rabbit", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum*2) end if inst.components.container:Has("mole", 3) then local sellnum = math.random(1,3) inst.components.container:ConsumeByName("mole", sellnum) inst.components.container:ConsumeByName("goldnugget", -sellnum*5) end end end local function OnDeploy (inst, pt) if GetPlayer().components.inventory:Has("goldnugget", 200) then GetPlayer().components.inventory:ConsumeByName("goldnugget", 200) local sellbox = SpawnPrefab("bugnet") sellbox.Transform:SetPosition(pt.x, pt.y, pt.z) sellbox.AnimState:SetBank("bee_box") sellbox.AnimState:SetBuild("bee_box") sellbox.AnimState:PlayAnimation("idle") sellbox.AnimState:SetMultColour(0/255,255/255,0/255,1) sellbox.Transform:SetScale(1.2, 1.2, 1.2) sellbox:AddTag("sellbox") sellbox.components.container.canbeopened = true sellbox:RemoveComponent("weapon") sellbox:RemoveComponent("tool") sellbox:RemoveComponent("finiteuses") sellbox:RemoveComponent("inventoryitem") sellbox:RemoveComponent("equippable") sellbox:AddTag("fridge") MakeLargeBurnable(sellbox) inst:Remove() end end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("sellbox") then data.sellbox = true end end local function onload(inst, data) if data and data.sellbox then inst.AnimState:SetBank("bee_box") inst.AnimState:SetBuild("bee_box") inst.AnimState:PlayAnimation("idle") inst.AnimState:SetMultColour(0/255,255/255,0/255,1) inst.Transform:SetScale(1.2, 1.2, 1.2) inst:AddTag("sellbox") inst.components.container.canbeopened = true inst:RemoveComponent("weapon") inst:RemoveComponent("tool") inst:RemoveComponent("finiteuses") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("equippable") inst:AddTag("fridge") MakeLargeBurnable(inst) end end local function itemtest(inst, item, slot) if item.prefab == "goldnugget" or item.prefab == "bee" or item.prefab == "killerbee" or item.prefab == "butterfly" or item.prefab == "fireflies" or item.prefab == "crow" or item.prefab == "robin" or item.prefab == "robin_winter" or item.prefab == "rabbit" or item.prefab == "mole" then return true end return false end local slotpos = {Vector3(75,150,0)} for y = 2, 0, -1 do for x = 0, 4 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") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(-100,200,0) inst.components.container.side_align_tip = 160 inst.components.container.canbeopened = false inst.components.container.itemtestfn = itemtest inst:DoPeriodicTask(30, function() if inst:HasTag("sellbox") then netsell(inst) end end ) 即可用捕虫网种网店销售箱,将花费200个黄金,身上黄金数不足时,不给网店销售箱。左键点网店销售箱会打开格子,在箱子最顶上的格子里放入10个黄金的保证金,并放入小宠物后(几个品种都可以,但一个品种至少3只),即可在线销售。网店销售箱亮灯时,是在联网结算,打开箱子可看到商品库存的减少、黄金数量的上升,可以取出黄金用于消费,但最顶上的格子里必须保留至少10个黄金的保证金。鼹鼠定价5个黄金,鸟定价3个黄金,杀人蜂、萤火虫、兔子定价2个黄金,蜜蜂、蝴蝶定价1个黄金,当某种商品库存不足3只时,该品种将无人购买,请及时检查并补货。千万不要将黄金放在下面的商品格中,而将最顶上的保证金格子空着,这代表所有商品定价0个黄金,小心被哄抢哦。从此经营自己的网上宠宠店,捕捉小宠物在线销售吧。不需要网店销售箱时,烧掉即可,记得取出黄金和商品哦

2025/04/23 · Bny

YN294-采矿场(用多功能工具种采矿场,打工赚黄金,买卖宝石)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二九四.采矿场(用多功能工具种采矿场,打工赚黄金,买卖宝石) 用MT管理器打开游戏目录/assets/scripts/prefabs/axe_pickaxe.lua文件, 1.在Asset("ANIM", "anim/swap_multitool_axe_pickaxe.zip"),的下一行插入以下内容: Asset("ANIM", "anim/wolfgang.zip"), Asset("ANIM", "anim/wolfgang_skinny.zip"), Asset("ANIM", "anim/wolfgang_mighty.zip"), Asset("ANIM", "anim/player_wolfgang.zip"), Asset("SOUND", "sound/wolfgang.fsb"), 2.在inst:AddComponent("inspectable")的下一行插入以下内容: local function mining(inst) local pt = inst:GetPosition() local boss = SpawnPrefab("multitool_axe_pickaxe") boss.Transform:SetPosition(pt.x, pt.y, pt.z) boss.AnimState:SetBank("wilson") boss.AnimState:SetBuild("wolfgang") boss.AnimState:Hide("ARM_carry") boss.AnimState:Show("ARM_normal") boss.Transform:SetFourFaced() boss.AnimState:OverrideSymbol("swap_hat", "hat_miner", "swap_hat") boss.AnimState:Show("HAT") boss.AnimState:Show("HAT_HAIR") boss.AnimState:Hide("HAIR_NOHAT") boss.AnimState:Hide("HAIR") boss.AnimState:PlayAnimation("idle") boss:AddTag("boss") boss:RemoveComponent("weapon") boss:RemoveComponent("tool") boss:RemoveComponent("finiteuses") boss:RemoveComponent("inventoryitem") boss:RemoveComponent("equippable") boss:RemoveComponent("deployable") boss:RemoveTag("sharp") local light = boss.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(5) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) boss:AddComponent("trader") boss.components.trader:SetAcceptTest(function(boss, item) if item.prefab == "goldnugget" then return true end if item.prefab == "purplegem" or item.prefab == "bluegem" or item.prefab == "redgem" or item.prefab == "orangegem" or item.prefab == "yellowgem" or item.prefab == "greengem" then return true end return false end ) boss.components.trader.onaccept = function(boss, giver, item) boss.AnimState:PlayAnimation("give") if item.prefab == "goldnugget" then SpawnPrefab("pickaxe").Transform:SetPosition(pt.x+0.5, 0, pt.z+0.5) end if item.prefab == "purplegem" or item.prefab == "bluegem" or item.prefab == "redgem" or item.prefab == "orangegem" or item.prefab == "yellowgem" or item.prefab == "greengem" then SpawnPrefab("goldnugget").Transform:SetPosition(pt.x+0.5, 0, pt.z+0.5) end end boss.components.inspectable.getstatus = function(boss) boss.AnimState:PlayAnimation("give") local rock = SpawnPrefab("multitool_axe_pickaxe") rock.Transform:SetPosition(pt.x+1.5, 0, pt.z+1.5) rock.AnimState:SetBank("rock") rock.AnimState:SetBuild("rock") rock.AnimState:PlayAnimation("full") rock.Transform:SetScale(0.5, 0.5, 0.5) rock:AddTag("goodbye") rock:RemoveComponent("weapon") rock:RemoveComponent("tool") rock:RemoveComponent("finiteuses") rock:RemoveComponent("inventoryitem") rock:RemoveComponent("equippable") rock:RemoveComponent("deployable") rock:RemoveTag("sharp") rock:AddComponent("workable") rock.components.workable:SetWorkAction(ACTIONS.MINE) rock.components.workable:SetWorkLeft(30) rock.components.workable:SetOnWorkCallback(function(rock, worker, workleft) if rock.components.workable.workleft <= 0 then rock.SoundEmitter:PlaySound("dontstarve/wilson/rock_break") boss.AnimState:PlayAnimation("give") for k = 1, 3 do SpawnPrefab("goldnugget").Transform:SetPosition(pt.x+0.5, 0, pt.z-0.5) end rock:Remove() else if rock.components.workable.workleft < 10 then rock.AnimState:PlayAnimation("low") elseif rock.components.workable.workleft < 20 then rock.AnimState:PlayAnimation("med") else rock.AnimState:PlayAnimation("full") end end end) end local mountain = SpawnPrefab("multitool_axe_pickaxe") mountain.Transform:SetPosition(pt.x-2, 0, pt.z-2) mountain.AnimState:SetBank("rock2") mountain.AnimState:SetBuild("rock2") mountain.AnimState:PlayAnimation("full") mountain.Transform:SetScale(2, 2, 2) mountain:AddTag("goodbye") mountain:RemoveComponent("weapon") mountain:RemoveComponent("tool") mountain:RemoveComponent("finiteuses") mountain:RemoveComponent("inventoryitem") mountain:RemoveComponent("equippable") mountain:RemoveComponent("deployable") mountain:RemoveTag("sharp") local miner = SpawnPrefab("multitool_axe_pickaxe") miner.Transform:SetPosition(pt.x+3-2, 0, pt.z-3-2) miner.AnimState:SetBank("wilson") miner.AnimState:SetBuild("wes") miner.Transform:SetFourFaced() miner.AnimState:OverrideSymbol("swap_hat", "hat_miner", "swap_hat") miner.AnimState:Show("HAT") miner.AnimState:Show("HAT_HAIR") miner.AnimState:Hide("HAIR_NOHAT") miner.AnimState:Hide("HAIR") miner.AnimState:OverrideSymbol("swap_object", "swap_pickaxe", "swap_pickaxe") miner.AnimState:Show("ARM_carry") miner.AnimState:Hide("ARM_normal") miner.AnimState:PlayAnimation("pickaxe_pre") miner.AnimState:PlayAnimation("pickaxe_loop", true) miner.Transform:SetRotation( 270 ) miner:AddTag("goodbye") miner:RemoveComponent("weapon") miner:RemoveComponent("tool") miner:RemoveComponent("finiteuses") miner:RemoveComponent("inventoryitem") miner:RemoveComponent("equippable") miner:RemoveComponent("deployable") miner:RemoveTag("sharp") miner:DoPeriodicTask(30, function() miner.AnimState:PlayAnimation("pickaxe_pre") miner.AnimState:PlayAnimation("pickaxe_loop", true) miner.Transform:SetRotation( 270 ) end ) miner:AddComponent("trader") miner.components.trader:SetAcceptTest(function(miner, item) if item.prefab == "goldnugget" then return true end return false end ) miner.components.trader.onaccept = function(miner, giver, item) miner.AnimState:PlayAnimation("give") miner.Transform:SetRotation(GetPlayer().Transform:GetRotation() - 180) local names = {"purplegem","bluegem","redgem","orangegem","yellowgem","greengem"} local name = names[math.random(#names)] local gem = SpawnPrefab(name) GetPlayer().components.inventory:GiveItem(gem) end end local function OnDeploy (inst, pt) mining(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("boss") then data.boss = true end if inst:HasTag("goodbye") then data.goodbye = true end end local function onload(inst, data) if data and data.boss then mining(inst) inst:Remove() end if data and data.goodbye then inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload MakeLargeBurnable(inst) MakeLargePropagator(inst) 即可用多功能工具种采矿场,鼠标左键点工头(大力士),他会拿出要你加工的石头,用镐将石头凿碎,即可获得3个黄金的工钱(工头会扔在地上)。可以向工头购买镐(拿着黄金对工头点鼠标左键),每把1个黄金。也可以将自己的宝石卖给工头(拿着宝石对工头点鼠标左键),每颗1个黄金。当然也可以私下向矿工(维斯)购买宝石(拿着黄金对矿工点鼠标左键),同样每颗1个黄金(宝石将直接放入主角物品栏),颜色随机。不想要采矿场时,烧掉即可。多功能工具在远古选项(画着远古祭坛)下,用1把黄金斧头、1把黄金镐、2个铥矿石制造,制造时需要靠近远古祭坛

2025/04/23 · Bny

YN295-雇佣兵工厂(用大理石盔甲种兵工厂,打工赚黄金,购买机械雇佣兵)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二九五.雇佣兵工厂(用大理石盔甲种兵工厂,打工赚黄金,购买机械雇佣兵) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rook.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function onsave(inst, data) if inst:HasTag("retinue") then data.retinue = true end if inst:HasTag("highretinue") then data.highretinue = true end if inst:HasTag("letgo") then data.letgo = true end end local function onload(inst, data) if data and data.retinue then inst.components.health:SetMaxHealth(1000) inst.components.combat:SetDefaultDamage(100) inst:RemoveTag("monster") inst:AddTag("retinue") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "chessjunk.png" ) inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.follower:SetLeader(nil) inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("letgo") then local brain = require "brains/rookbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst:AddTag("letgo") else inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.follower:SetLeader(nil) inst:RemoveTag("letgo") end end inst:AddComponent("trader") inst.components.trader:SetAcceptTest(function(inst, item) if GetPlayer().components.inventory:Has("goldnugget", 50) then if item.prefab == "goldnugget" then return true end end return false end ) inst.components.trader.onaccept = function(inst, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 49) GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.components.health:SetMaxHealth(2000) inst.components.health:DoDelta(2000) inst.components.combat:SetDefaultDamage(200) inst:AddTag("highretinue") inst.components.locomotor.walkspeed = 15 inst.components.locomotor.runspeed = 20 end inst.Physics:SetCollisionCallback(function(inst, other) if other and other.components.workable and other.components.workable.workleft > 0 then SpawnPrefab("collapse_small").Transform:SetPosition(other:GetPosition():Get()) other.components.workable:Destroy(inst) end end) inst.components.locomotor.walkspeed = 10 inst.components.locomotor.runspeed = 15 inst.components.combat:SetAttackPeriod( 1 ) inst.components.combat:SetRetargetFunction(3, function(inst) if not inst.components.health:IsDead() then return FindEntity(inst, 20, 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 ) if data and data.highretinue then inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.components.health:SetMaxHealth(2000) inst.components.combat:SetDefaultDamage(200) inst:AddTag("highretinue") inst.components.locomotor.walkspeed = 15 inst.components.locomotor.runspeed = 20 end if data and data.letgo then local brain = require "brains/rookbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst:AddTag("letgo") end end end inst.OnSave = onsave inst.OnLoad = onload 2.用MT管理器打开游戏目录/assets/scripts/prefabs/bishop.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function onsave(inst, data) if inst:HasTag("retinue") then data.retinue = true end if inst:HasTag("highretinue") then data.highretinue = true end if inst:HasTag("letgo") then data.letgo = true end end local function onload(inst, data) if data and data.retinue then inst.components.health:SetMaxHealth(500) inst.components.combat:SetDefaultDamage(30) inst:RemoveTag("monster") inst:AddTag("retinue") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "chessjunk.png" ) inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.follower:SetLeader(nil) inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("letgo") then local brain = require "brains/rookbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst:AddTag("letgo") else inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.follower:SetLeader(nil) inst:RemoveTag("letgo") end end inst:AddComponent("trader") inst.components.trader:SetAcceptTest(function(inst, item) if GetPlayer().components.inventory:Has("goldnugget", 30) then if item.prefab == "goldnugget" then return true end end return false end ) inst.components.trader.onaccept = function(inst, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 29) GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.components.health:SetMaxHealth(1000) inst.components.health:DoDelta(1000) inst.components.combat:SetDefaultDamage(60) inst:AddTag("highretinue") inst.components.locomotor.walkspeed = 15 end inst.components.locomotor.walkspeed = 10 inst.components.combat:SetAttackPeriod( 0.5 ) inst.components.combat:SetRetargetFunction(3, function(inst) if not inst.components.health:IsDead() then return FindEntity(inst, 20, 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 ) if data and data.highretinue then inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.components.health:SetMaxHealth(1000) inst.components.combat:SetDefaultDamage(60) inst:AddTag("highretinue") inst.components.locomotor.walkspeed = 15 end if data and data.letgo then local brain = require "brains/rookbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst:AddTag("letgo") end end end inst.OnSave = onsave inst.OnLoad = onload 3.用MT管理器打开游戏目录/assets/scripts/prefabs/knight.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function onsave(inst, data) if inst:HasTag("retinue") then data.retinue = true end if inst:HasTag("highretinue") then data.highretinue = true end if inst:HasTag("letgo") then data.letgo = true end end local function onload(inst, data) if data and data.retinue then inst.components.health:SetMaxHealth(500) inst.components.combat:SetDefaultDamage(15) inst:RemoveTag("monster") inst:AddTag("retinue") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "chessjunk.png" ) inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.follower:SetLeader(nil) inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("letgo") then local brain = require "brains/rookbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst:AddTag("letgo") else inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.follower:SetLeader(nil) inst:RemoveTag("letgo") end end inst:AddComponent("trader") inst.components.trader:SetAcceptTest(function(inst, item) if GetPlayer().components.inventory:Has("goldnugget", 15) then if item.prefab == "goldnugget" then return true end end return false end ) inst.components.trader.onaccept = function(inst, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 14) GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.components.health:SetMaxHealth(1000) inst.components.health:DoDelta(1000) inst.components.combat:SetDefaultDamage(30) inst:AddTag("highretinue") inst.components.locomotor.walkspeed = 15 end inst.components.locomotor.walkspeed = 10 inst.components.combat:SetAttackPeriod( 0.5 ) inst.components.combat:SetRetargetFunction(3, function(inst) if not inst.components.health:IsDead() then return FindEntity(inst, 20, 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 ) if data and data.highretinue then inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.components.health:SetMaxHealth(1000) inst.components.combat:SetDefaultDamage(30) inst:AddTag("highretinue") inst.components.locomotor.walkspeed = 15 end if data and data.letgo then local brain = require "brains/rookbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst:AddTag("letgo") end end end inst.OnSave = onsave inst.OnLoad = onload 4.用MT管理器打开游戏目录/assets/scripts/prefabs/armor_marble.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function repairshop(inst) local pt = inst:GetPosition() local repairboss = SpawnPrefab("armormarble") repairboss.Transform:SetPosition(pt.x, pt.y, pt.z) repairboss.AnimState:SetBank("wilson") repairboss.AnimState:SetBuild("wx78") repairboss.AnimState:OverrideSymbol("swap_hat", "hat_top", "swap_hat") repairboss.AnimState:Show("HAT") repairboss.AnimState:Show("HAT_HAIR") repairboss.AnimState:Hide("HAIR_NOHAT") repairboss.AnimState:Hide("HAIR") repairboss.AnimState:OverrideSymbol("swap_body", "armor_marble", "swap_body") repairboss.AnimState:OverrideSymbol("swap_object", "swap_hammer", "swap_hammer") repairboss.AnimState:Show("ARM_carry") repairboss.AnimState:Hide("ARM_normal") repairboss.Transform:SetFourFaced() repairboss.AnimState:PlayAnimation("idle") repairboss:AddTag("repairboss") repairboss.components.inventoryitem.canbepickedup = false local light = repairboss.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(10) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) repairboss:AddComponent("trader") repairboss.components.trader:SetAcceptTest(function(repairboss, item) if item.prefab == "goldnugget" then return true end return false end ) repairboss.components.trader.onaccept = function(repairboss, giver, item) repairboss.AnimState:PlayAnimation("give") SpawnPrefab("hammer").Transform:SetPosition(pt.x+0.5, 0, pt.z+0.5) end repairboss.components.inspectable.getstatus = function(repairboss) repairboss.AnimState:PlayAnimation("give") GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_stone") local chessjunk = SpawnPrefab("armormarble") chessjunk.Transform:SetPosition(pt.x+3.1, 0, pt.z+3.1) chessjunk.AnimState:SetBank("chessmonster_ruins") chessjunk.AnimState:SetBuild("chessmonster_ruins") chessjunk.AnimState:PlayAnimation("idle3") chessjunk:AddTag("goodbye") chessjunk.components.inventoryitem.canbepickedup = false chessjunk:AddComponent("workable") chessjunk.components.workable:SetWorkAction(ACTIONS.HAMMER) chessjunk.components.workable:SetWorkLeft(30) chessjunk.components.workable:SetOnWorkCallback(function(chessjunk, worker, workleft) if chessjunk.components.workable.workleft <= 0 then GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/chessjunk_break") chessjunk:Remove() local goods = SpawnPrefab("armormarble") goods.Transform:SetPosition(pt.x+3.1, 0, pt.z+3.1) goods:AddTag("goodbye") goods.components.inventoryitem.canbepickedup = false if math.random()<.33 then goods.AnimState:SetBank("rook") goods.AnimState:SetBuild("rook_nightmare") goods.AnimState:PlayAnimation("idle") goods.Transform:SetScale(0.66, 0.66, 0.66) elseif math.random()<.66 then goods.AnimState:SetBank("bishop") goods.AnimState:SetBuild("bishop_nightmare") goods.AnimState:PlayAnimation("idle_loop", true) else goods.AnimState:SetBank("knight") goods.AnimState:SetBuild("knight_nightmare") goods.AnimState:PlayAnimation("idle_loop", true) end GetPlayer():DoTaskInTime(2, function() repairboss.AnimState:PlayAnimation("give") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/get_gold") for k = 1, 3 do SpawnPrefab("goldnugget").Transform:SetPosition(pt.x+0.5, 0, pt.z-0.5) end goods:Remove() end ) else if chessjunk.components.workable.workleft < 10 then chessjunk.AnimState:PlayAnimation("idle1") elseif chessjunk.components.workable.workleft < 20 then chessjunk.AnimState:PlayAnimation("idle2") else chessjunk.AnimState:PlayAnimation("idle3") end end end) end local chessjunk1 = SpawnPrefab("armormarble") chessjunk1.Transform:SetPosition(pt.x-3, 0, pt.z-3) chessjunk1.AnimState:SetBank("rook") chessjunk1.AnimState:SetBuild("rook_nightmare") chessjunk1.Transform:SetFourFaced() chessjunk1.AnimState:PlayAnimation("idle") chessjunk1.Transform:SetScale(0.66, 0.66, 0.66) chessjunk1:AddTag("goodbye") chessjunk1.components.inventoryitem.canbepickedup = false chessjunk1:AddComponent("trader") chessjunk1.components.trader:SetAcceptTest(function(chessjunk1, item) if GetPlayer().components.inventory:Has("goldnugget", 50) then if item.prefab == "goldnugget" then return true end end return false end ) chessjunk1.components.trader.onaccept = function(chessjunk1, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 49) repairboss.AnimState:PlayAnimation("give") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") local retinue1 = SpawnPrefab("rook_nightmare") retinue1.Transform:SetPosition(pt.x+3.1, 0, pt.z+3.1) retinue1.components.follower:SetLeader(GetPlayer()) retinue1.components.health:SetMaxHealth(1000) retinue1.components.combat:SetDefaultDamage(100) retinue1:RemoveTag("monster") retinue1:AddTag("retinue") retinue1:AddTag("letgo") local minimap = retinue1.entity:AddMiniMapEntity() minimap:SetIcon( "chessjunk.png" ) retinue1.components.inspectable.getstatus = function(retinue1) if not retinue1:HasTag("letgo") then local brain = require "brains/rookbrain" retinue1:SetBrain(brain) retinue1:RestartBrain() retinue1.components.follower:SetLeader(GetPlayer()) retinue1:AddTag("letgo") else retinue1.components.locomotor:Stop() retinue1.components.follower:SetLeader(nil) retinue1:SetBrain(nil) retinue1:RemoveTag("letgo") end end retinue1:AddComponent("trader") retinue1.components.trader:SetAcceptTest(function(retinue1, item) if GetPlayer().components.inventory:Has("goldnugget", 50) then if item.prefab == "goldnugget" then return true end end return false end ) retinue1.components.trader.onaccept = function(retinue1, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 49) GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") retinue1.AnimState:SetBloomEffectHandle("shaders/anim.ksh") retinue1.components.health:SetMaxHealth(2000) retinue1.components.health:DoDelta(2000) retinue1.components.combat:SetDefaultDamage(200) retinue1:AddTag("highretinue") retinue1.components.locomotor.walkspeed = 15 retinue1.components.locomotor.runspeed = 20 end retinue1.Physics:SetCollisionCallback(function(retinue1, other) if other and other.components.workable and other.components.workable.workleft > 0 then SpawnPrefab("collapse_small").Transform:SetPosition(other:GetPosition():Get()) other.components.workable:Destroy(retinue1) end end) retinue1.components.locomotor.walkspeed = 10 retinue1.components.locomotor.runspeed = 15 retinue1.components.combat:SetAttackPeriod( 1 ) retinue1.components.combat:SetRetargetFunction(3, function(retinue1) if not retinue1.components.health:IsDead() then return FindEntity(retinue1, 20, 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 ) retinue1.components.combat:SetKeepTargetFunction(function(retinue1, target) return target and target:IsValid() end ) end local chessjunk2 = SpawnPrefab("armormarble") chessjunk2.Transform:SetPosition(pt.x-3+2.3, 0, pt.z-3-2.3) chessjunk2.AnimState:SetBank("bishop") chessjunk2.AnimState:SetBuild("bishop_nightmare") chessjunk2.Transform:SetFourFaced() chessjunk2.AnimState:PlayAnimation("idle_loop", true) chessjunk2:AddTag("goodbye") chessjunk2.components.inventoryitem.canbepickedup = false chessjunk2:AddComponent("trader") chessjunk2.components.trader:SetAcceptTest(function(chessjunk2, item) if GetPlayer().components.inventory:Has("goldnugget", 30) then if item.prefab == "goldnugget" then return true end end return false end ) chessjunk2.components.trader.onaccept = function(chessjunk2, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 29) repairboss.AnimState:PlayAnimation("give") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") local retinue2 = SpawnPrefab("bishop_nightmare") retinue2.Transform:SetPosition(pt.x+3.1, 0, pt.z+3.1) retinue2.components.follower:SetLeader(GetPlayer()) retinue2.components.health:SetMaxHealth(500) retinue2.components.combat:SetDefaultDamage(30) retinue2:RemoveTag("monster") retinue2:AddTag("retinue") retinue2:AddTag("letgo") local minimap = retinue2.entity:AddMiniMapEntity() minimap:SetIcon( "chessjunk.png" ) retinue2.components.inspectable.getstatus = function(retinue2) if not retinue2:HasTag("letgo") then local brain = require "brains/rookbrain" retinue2:SetBrain(brain) retinue2:RestartBrain() retinue2.components.follower:SetLeader(GetPlayer()) retinue2:AddTag("letgo") else retinue2.components.locomotor:Stop() retinue2.components.follower:SetLeader(nil) retinue2:SetBrain(nil) retinue2:RemoveTag("letgo") end end retinue2:AddComponent("trader") retinue2.components.trader:SetAcceptTest(function(retinue2, item) if GetPlayer().components.inventory:Has("goldnugget", 30) then if item.prefab == "goldnugget" then return true end end return false end ) retinue2.components.trader.onaccept = function(retinue2, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 29) GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") retinue2.AnimState:SetBloomEffectHandle("shaders/anim.ksh") retinue2.components.health:SetMaxHealth(1000) retinue2.components.health:DoDelta(1000) retinue2.components.combat:SetDefaultDamage(60) retinue2:AddTag("highretinue") retinue2.components.locomotor.walkspeed = 15 end retinue2.components.locomotor.walkspeed = 10 retinue2.components.combat:SetAttackPeriod( 0.5 ) retinue2.components.combat:SetRetargetFunction(3, function(retinue2) if not retinue2.components.health:IsDead() then return FindEntity(retinue2, 20, 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 ) retinue2.components.combat:SetKeepTargetFunction(function(retinue2, target) return target and target:IsValid() end ) end local chessjunk3 = SpawnPrefab("armormarble") chessjunk3.Transform:SetPosition(pt.x-3-2, 0, pt.z-3+2) chessjunk3.AnimState:SetBank("knight") chessjunk3.AnimState:SetBuild("knight_nightmare") chessjunk3.Transform:SetFourFaced() chessjunk3.AnimState:PlayAnimation("idle_loop", true) chessjunk3:AddTag("goodbye") chessjunk3.components.inventoryitem.canbepickedup = false chessjunk3:AddComponent("trader") chessjunk3.components.trader:SetAcceptTest(function(chessjunk3, item) if GetPlayer().components.inventory:Has("goldnugget", 15) then if item.prefab == "goldnugget" then return true end end return false end ) chessjunk3.components.trader.onaccept = function(chessjunk3, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 14) repairboss.AnimState:PlayAnimation("give") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") local retinue3 = SpawnPrefab("knight_nightmare") retinue3.Transform:SetPosition(pt.x+3.1, 0, pt.z+3.1) retinue3.components.follower:SetLeader(GetPlayer()) retinue3.components.health:SetMaxHealth(500) retinue3.components.combat:SetDefaultDamage(15) retinue3:RemoveTag("monster") retinue3:AddTag("retinue") retinue3:AddTag("letgo") local minimap = retinue3.entity:AddMiniMapEntity() minimap:SetIcon( "chessjunk.png" ) retinue3.components.inspectable.getstatus = function(retinue3) if not retinue3:HasTag("letgo") then local brain = require "brains/rookbrain" retinue3:SetBrain(brain) retinue3:RestartBrain() retinue3.components.follower:SetLeader(GetPlayer()) retinue3:AddTag("letgo") else retinue3.components.locomotor:Stop() retinue3.components.follower:SetLeader(nil) retinue3:SetBrain(nil) retinue3:RemoveTag("letgo") end end retinue3:AddComponent("trader") retinue3.components.trader:SetAcceptTest(function(retinue3, item) if GetPlayer().components.inventory:Has("goldnugget", 15) then if item.prefab == "goldnugget" then return true end end return false end ) retinue3.components.trader.onaccept = function(retinue3, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 14) GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") retinue3.AnimState:SetBloomEffectHandle("shaders/anim.ksh") retinue3.components.health:SetMaxHealth(1000) retinue3.components.health:DoDelta(1000) retinue3.components.combat:SetDefaultDamage(30) retinue3:AddTag("highretinue") retinue3.components.locomotor.walkspeed = 15 end retinue3.components.locomotor.walkspeed = 10 retinue3.components.combat:SetAttackPeriod( 0.5 ) retinue3.components.combat:SetRetargetFunction(3, function(retinue3) if not retinue3.components.health:IsDead() then return FindEntity(retinue3, 20, 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 ) retinue3.components.combat:SetKeepTargetFunction(function(retinue3, target) return target and target:IsValid() end ) end local garbage1 = SpawnPrefab("armormarble") garbage1.Transform:SetPosition(pt.x+4-1, 0, pt.z-4-1) garbage1.AnimState:SetBank("researchlab2") garbage1.AnimState:SetBuild("researchlab2") garbage1.AnimState:PlayAnimation("proximity_loop", true) garbage1:AddTag("goodbye") garbage1.components.inventoryitem.canbepickedup = false local garbage2 = SpawnPrefab("armormarble") garbage2.Transform:SetPosition(pt.x+4+1, 0, pt.z-4+1) garbage2.AnimState:SetBank("researchlab2") garbage2.AnimState:SetBuild("researchlab2") garbage2.AnimState:PlayAnimation("proximity_loop", true) garbage2:AddTag("goodbye") garbage2.components.inventoryitem.canbepickedup = false local garbage3 = SpawnPrefab("armormarble") garbage3.Transform:SetPosition(pt.x+4+3, 0, pt.z-4+3) garbage3.AnimState:SetBank("researchlab2") garbage3.AnimState:SetBuild("researchlab2") garbage3.AnimState:PlayAnimation("proximity_loop", true) garbage3:AddTag("goodbye") garbage3.components.inventoryitem.canbepickedup = false end local function OnDeploy (inst, pt) repairshop(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("repairboss") then data.repairboss = true end if inst:HasTag("goodbye") then data.goodbye = true end end local function onload(inst, data) if data and data.repairboss then repairshop(inst) inst:Remove() end if data and data.goodbye then inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload MakeLargeBurnable(inst) MakeLargePropagator(inst) 即可用大理石盔甲种雇佣兵工厂,鼠标左键点老板(机器人),他会拿出要你加工的零件,用锤子将零件砸成机械兵,即可获得3个黄金的工钱(老板会扔在地上)。可以向老板购买锤子(拿着黄金对老板点鼠标左键),每把1个黄金。拿着黄金对老板背后的机械兵点鼠标左键,可以购买相应品种的机械雇佣兵,其中机械犀牛每只50个黄金,机械主教每只30个黄金,机械马每只15个黄金,打造你的铁甲战团吧。鼠标左键点雇佣兵,可停止跟随,再次点击可继续跟随,点击时手中不要拿武器,以免误伤。忘记将雇佣军驻扎在何处时,可以打开小地图查找,将显示为机器零件的图标。拥有机械雇佣兵后,可以进一步为它们升级,拿着黄金对自己的机械兵点鼠标左键(同样犀牛50个黄金、主教30个黄金、马15个黄金),可将它们升级为超级机械雇佣兵(身上发亮),攻防及行军速度都将大幅提高。大战之后,给雇佣兵黄金(数量同上),可以将它们的血补满。不想要雇佣兵工厂时,烧掉即可。大理石盔甲在战斗选项(画着两把剑)下,用12块大理石、4条绳子制造

2025/04/23 · Bny