游民星空 > 攻略秘籍 > 攻略 > 正文

饥荒 全人物解锁及主角自动回血等实用修改教程

2015-01-21 11:28:46 来源:互联网 作者:易宁 我要投稿

第297页:观赏秃鹫

展开

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

  1.用记事本打开游戏目录\data\DLC0001\scripts\prefabs\spoiledfood.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable")

  2.用记事本打开游戏目录\data\DLC0001\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个蛛丝对地面点鼠标右键,如果拿着多个,则不会种出来),喂它腐烂食物,会掉落随机品种的植物种子,喂大肉、小肉会生高鸟蛋。不想要观赏秃鹫了,用锤子砸掉即可

更多相关内容请关注:饥荒专区

责任编辑:Shy夏夏

上一页 291 292 293 294 295 296 297 298 299 300 301 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

文章内容导航
游民星空APP
随手浏览游戏攻略
code
攻略合集
单机游戏下载
休闲娱乐
综合热点资讯
游民星空联运游戏