Don't Starve Together

Don't Starve Together

欧皇模拟器
建议增加牛角和羊角的爆率
具体代码如下:
modinfo.lua

{
name = "beefalo",
label = "牛角爆率(beefalo)",
options ={
{description = "默认", data = 33},
{description = "40%", data = 40},
{description = "50%", data = 50},
{description = "60%", data = 60},
{description = "70%", data = 70},
{description = "80%", data = 80},
{description = "90%", data = 90},
{description = "100%", data = 100},
},
default = 2,
},
{
name = "lightninggoat",
label = "闪电羊角爆率(lightninggoat)",
options ={
{description = "默认", data = 25},
{description = "30%", data = 30},
{description = "40%", data = 40},
{description = "50%", data = 50},
{description = "60%", data = 60},
{description = "70%", data = 70},
{description = "80%", data = 80},
{description = "90%", data = 90},
{description = "100%", data = 100},
},
default = 2,
},

modMain.lua

local beefalo = GetModConfigData("beefalo")/100
local lightninggoathorn = GetModConfigData("lightninggoat")/100



local function updateLootTableBeefalo(inst)--牛角爆率,这个随便改
SetSharedLootTable( 'beefalo',
{
{'meat', 1.00},
{'meat', 1.00},
{'meat', 1.00},
{'meat', 1.00},
{'beefalowool', 1.00},
{'beefalowool', 1.00},
{'beefalowool', 1.00},
{'horn', horn},
{'horn', horn},
})
if(inst.components.lootdropper == nil) then
inst:AddComponent("lootdropper")
end
inst.components.lootdropper:SetChanceLootTable('beefalo')
end
AddPrefabPostInit("beefalo", updateLootTableBeefalo)


local function updateLootTableLightninggoat(inst)--闪电羊角爆率,这个随便改
SetSharedLootTable( 'lightninggoat',
{
{'meat', 1.00},
{'meat', 1.00},
{'goatmilk', 1.00},
{'lightninggoathorn', lightninggoathorn},
{'lightninggoathorn', lightninggoathorn},
})
if(inst.components.lootdropper == nil) then
inst:AddComponent("lootdropper")
end
inst.components.lootdropper:SetChanceLootTable('lightninggoat')
end
AddPrefabPostInit("lightninggoat", updateLootTableLightninggoat)