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

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

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

第338页:刮刮乐

展开

二八八.刮刮乐(给路牌黄金买刮刮乐彩票中大奖)

  用记事本打开游戏目录\data\DLC0001\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个黄金,末等奖只有一团灰。存档退出时,身上不要留彩票,因为再读档后会过期作废(不能再刮奖)

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

责任编辑:Shy夏夏

上一页 331 332 333 334 335 336 337 338 339 340 341 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

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