游戏达人
  
- 贡献度
- 80
- 金元
- 19022
- 积分
- 2232
- 精华
- 1
- 注册时间
- 2010-11-27
|
靚仔 发表于 2013-11-14 16:23 
把更新发一下把
一九三.鱼人入侵(每个傍晚都可能遭到众多鱼人的伏击)
用记事本打开游戏目录\data\scripts\prefabs\forest.lua文件,在inst:AddComponent("frograin")的下一行插入以下内容:
local function OnNight(inst)
local player = GetPlayer()
local pt = Vector3(player.Transform:GetWorldPosition())
local nummerms = math.random(15)
local ground = GetWorld()
if math.random()< .2 then
for k = 1, nummerms do
local theta = 1 * 2 * PI
local radius = 12
local result_offset = FindValidPositionByFan(theta, radius, nummerms, function(offset)
local x,y,z = (pt + offset):Get()
local ents = TheSim:FindEntities(x,y,z , 1)
return not next(ents)
end)
if result_offset and ground.Map:GetTileAtPoint((pt + result_offset):Get()) ~= GROUND.IMPASSABLE then
local merm = SpawnPrefab("merm")
merm.Transform:SetPosition((pt + result_offset):Get())
merm.components.combat.target = player
GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40)
local fx = SpawnPrefab("collapse_small")
local pos = pt + result_offset
fx.Transform:SetPosition(pos.x, pos.y, pos.z)
end
end
end
end
inst:ListenForEvent( "dusktime", function() OnNight( inst ) end, GetWorld())
即可让主角在地面时,每天傍晚都有一定概率遭到众多鱼人(数字随机)的伏击。建议鱼人人数少时就和它们拼了,人数多时就跑,它们会暂时占据这个地区,等到白天它们睡着时再各个击破
一九四.电动斧子(拿黄金斧子自动放倒身边的树)
用记事本打开游戏目录\data\scripts\prefabs\axe.lua文件,
1.将下列内容:
local function onequipgold(inst, owner)
owner.AnimState:OverrideSymbol("swap_object", "swap_goldenaxe", "swap_goldenaxe")
owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold")
owner.AnimState:Show("ARM_carry")
owner.AnimState:Hide("ARM_normal")
end
替换为:
local function pickup(inst, owner)
local range = 3
local pos = Vector3(owner.Transform:GetWorldPosition())
local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range)
for k,v in pairs(ents) do
if v:HasTag("tree") and v.components.growable and not v:HasTag("stump") then
SpawnPrefab("pine_needles").Transform:SetPosition(owner.Transform:GetWorldPosition())
v:Remove()
v.components.lootdropper:DropLoot()
end
if v:HasTag("burnt") then
SpawnPrefab("pine_needles").Transform:SetPosition(owner.Transform:GetWorldPosition())
v:Remove()
v.components.lootdropper:SpawnLootPrefab("charcoal")
v.components.lootdropper:DropLoot()
end
end
inst.SoundEmitter:PlaySound("dontstarve/forest/treeCrumble")
return true
end
local function onequipgold(inst, owner)
if owner.components.inventory:Has("lightbulb", 1) then
inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end)
owner.components.inventory:ConsumeByName("lightbulb", 1)
end
owner.AnimState:OverrideSymbol("swap_object", "swap_goldenaxe", "swap_goldenaxe")
owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold")
owner.AnimState:Show("ARM_carry")
owner.AnimState:Hide("ARM_normal")
end
local function onunequipgold(inst, owner)
owner.AnimState:Hide("ARM_carry")
owner.AnimState:Show("ARM_normal")
if inst.task then inst.task:Cancel() inst.task = nil end
end
2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold )
即可拿黄金斧子自动放倒身边的树(类似电锯),效率极高,且不留树根,方便种新树。电动斧子需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动砍树了
一九五.电动镐(拿黄金镐自动凿开身边的石头)
1.用记事本打开游戏目录\data\scripts\prefabs\pickaxe.lua文件,将下列内容:
local function onequipgold(inst, owner)
owner.AnimState:OverrideSymbol("swap_object", "swap_goldenpickaxe", "swap_goldenpickaxe")
owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold")
owner.AnimState:Show("ARM_carry")
owner.AnimState:Hide("ARM_normal")
end
替换为:
local function pickup(inst, owner)
local range = 3
local pos = Vector3(owner.Transform:GetWorldPosition())
local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range)
for k,v in pairs(ents) do
if v.components.workable and v.components.workable.action == ACTIONS.MINE then
v:Remove()
v.components.lootdropper:DropLoot()
end
end
inst.SoundEmitter:PlaySound("dontstarve/wilson/rock_break")
return true
end
local function onequipgold(inst, owner)
if owner.components.inventory:Has("lightbulb", 1) then
inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end)
owner.components.inventory:ConsumeByName("lightbulb", 1)
end
owner.AnimState:OverrideSymbol("swap_object", "swap_goldenpickaxe", "swap_goldenpickaxe")
owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold")
owner.AnimState:Show("ARM_carry")
owner.AnimState:Hide("ARM_normal")
end
local function onunequipgold(inst, owner)
owner.AnimState:Hide("ARM_carry")
owner.AnimState:Show("ARM_normal")
if inst.task then inst.task:Cancel() inst.task = nil end
end
2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold )
即可拿黄金镐自动凿开身边的石头,效率极高,连大理石树、蜘蛛洞、远古雕像都可轻松凿平。电动镐需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动开矿了
|
|