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

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

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

第175页:霸王斧

展开

一七五.霸王斧(用蜻蜓鳞片种霸王斧,攻击敌人时震开并伤害周围敌人,可吸敌人的血)

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

  local function OnDeploy (inst, pt)

  local bigaxe = SpawnPrefab("dragon_scales")

  bigaxe.Transform:SetPosition(pt.x, pt.y, pt.z)

  bigaxe.AnimState:SetBank("Lucy_axe")

  bigaxe.AnimState:SetBuild("Lucy_axe")

  bigaxe.AnimState:PlayAnimation("idle")

  bigaxe.components.inventoryitem:ChangeImageName("lucy")

  bigaxe:AddComponent("named")

  bigaxe.components.named:SetName("Poleaxe")

  bigaxe:RemoveComponent("stackable")

  bigaxe:RemoveComponent("deployable")

  bigaxe:AddComponent("equippable")

  bigaxe.components.equippable.equipslot = EQUIPSLOTS.HANDS

  bigaxe.components.equippable:SetOnEquip(function(bigaxe, owner)

  owner.AnimState:OverrideSymbol("swap_object", "swap_lucy_axe", "swap_lucy_axe")

  owner.AnimState:Show("ARM_carry")

  owner.AnimState:Hide("ARM_normal")

  bigaxe.fire = SpawnPrefab( "campfirefire" )

  local follower = bigaxe.fire.entity:AddFollower()

  follower:FollowSymbol( owner.GUID, "swap_object", -2, -135, 1 )

  bigaxe.fire.AnimState:SetMultColour(255/255,0/255,0/255,1)

  bigaxe.fire:RemoveComponent("heater")

  bigaxe.fire.persists = false

  end )

  bigaxe.components.equippable:SetOnUnequip(function(bigaxe, owner)

  owner.AnimState:Hide("ARM_carry")

  owner.AnimState:Show("ARM_normal")

  bigaxe.fire:Remove()

  bigaxe.fire = nil

  end )

  bigaxe:AddComponent("weapon")

  bigaxe.components.weapon:SetDamage(500)

  bigaxe.components.weapon:SetOnAttack(function(bigaxe, attacker, target)

  GetPlayer().SoundEmitter:PlaySound("dontstarve_DLC001/creatures/glommer/foot_ground")

  SpawnPrefab("groundpoundring_fx").Transform:SetPosition(attacker.Transform:GetWorldPosition())

  GetPlayer().components.playercontroller:ShakeCamera(attacker, "FULL", 0.5, 0.05, 2, 40)

  if target.components.locomotor then target.components.locomotor:Stop() end

  if target.components.health:GetPercent() < 0.3 then

  target.AnimState:SetMultColour(255/255,0/255,0/255,1)

  end

  attacker.components.health:DoDelta(150)

  attacker:StartThread(function()

  for k = 1, 3 do

  local blood = SpawnPrefab("splash")

  blood.Transform:SetPosition(target.Transform:GetWorldPosition())

  blood.AnimState:SetMultColour(255/255,0/255,0/255,1)

  blood.Transform:SetScale(2, 2, 2)

  Sleep(.1)

  end

  end )

  target:AddTag("nomove")

  target:DoTaskInTime(0.4, function() target:RemoveTag("nomove") end )

  local pos = Vector3(attacker.Transform:GetWorldPosition())

  local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 8)

  for k,v in pairs(ents) do

  if v.components.health and v.components.combat and not v.components.health:IsDead() and not v:HasTag("nomove") then

  if v.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == v or v:HasTag("monster") then

  SpawnPrefab("explode_small").Transform:SetPosition(v.Transform:GetWorldPosition())

  v.components.health:DoDelta(-300)

  local pt01 = attacker:GetPosition()

  local pt02 = v:GetPosition()

  v.Transform:SetPosition((pt02.x-pt01.x)*1.5+pt02.x, 0, (pt02.z-pt01.z)*1.5+pt02.z)

  if v.components.locomotor then v.components.locomotor:Stop() end

  if v.components.health:GetPercent() < 0.3 then

  v.AnimState:SetMultColour(255/255,0/255,0/255,1)

  end

  end

  end

  end

  end )

  bigaxe:AddComponent("tool")

  bigaxe.components.tool:SetAction(ACTIONS.CHOP, 15)

  bigaxe:AddTag("bigaxes")

  inst.components.stackable:Get():Remove()

  end

  inst:AddComponent("deployable")

  inst.components.deployable.ondeploy = OnDeploy

  local function onsave(inst, data)

  if inst:HasTag("bigaxes") then

  data.bigaxes = true

  end

  end

  local function onload(inst, data)

  if data and data.bigaxes then

  inst.AnimState:SetBank("Lucy_axe")

  inst.AnimState:SetBuild("Lucy_axe")

  inst.AnimState:PlayAnimation("idle")

  inst.components.inventoryitem:ChangeImageName("lucy")

  inst:AddComponent("named")

  inst.components.named:SetName("Poleaxe")

  inst:RemoveComponent("stackable")

  inst:RemoveComponent("deployable")

  inst:AddComponent("equippable")

  inst.components.equippable.equipslot = EQUIPSLOTS.HANDS

  inst.components.equippable:SetOnEquip(function(inst, owner)

  owner.AnimState:OverrideSymbol("swap_object", "swap_lucy_axe", "swap_lucy_axe")

  owner.AnimState:Show("ARM_carry")

  owner.AnimState:Hide("ARM_normal")

  inst.fire = SpawnPrefab( "campfirefire" )

  local follower = inst.fire.entity:AddFollower()

  follower:FollowSymbol( owner.GUID, "swap_object", -2, -135, 1 )

  inst.fire.AnimState:SetMultColour(255/255,0/255,0/255,1)

  inst.fire:RemoveComponent("heater")

  inst.fire.persists = false

  end )

  inst.components.equippable:SetOnUnequip(function(inst, owner)

  owner.AnimState:Hide("ARM_carry")

  owner.AnimState:Show("ARM_normal")

  inst.fire:Remove()

  inst.fire = nil

  end )

  inst:AddComponent("weapon")

  inst.components.weapon:SetDamage(500)

  inst.components.weapon:SetOnAttack(function(inst, attacker, target)

  GetPlayer().SoundEmitter:PlaySound("dontstarve_DLC001/creatures/glommer/foot_ground")

  SpawnPrefab("groundpoundring_fx").Transform:SetPosition(attacker.Transform:GetWorldPosition())

  GetPlayer().components.playercontroller:ShakeCamera(attacker, "FULL", 0.5, 0.05, 2, 40)

  if target.components.locomotor then target.components.locomotor:Stop() end

  if target.components.health:GetPercent() < 0.3 then

  target.AnimState:SetMultColour(255/255,0/255,0/255,1)

  end

  attacker.components.health:DoDelta(150)

  attacker:StartThread(function()

  for k = 1, 3 do

  local blood = SpawnPrefab("splash")

  blood.Transform:SetPosition(target.Transform:GetWorldPosition())

  blood.AnimState:SetMultColour(255/255,0/255,0/255,1)

  blood.Transform:SetScale(2, 2, 2)

  Sleep(.1)

  end

  end )

  target:AddTag("nomove")

  target:DoTaskInTime(0.4, function() target:RemoveTag("nomove") end )

  local pos = Vector3(attacker.Transform:GetWorldPosition())

  local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 8)

  for k,v in pairs(ents) do

  if v.components.health and v.components.combat and not v.components.health:IsDead() and not v:HasTag("nomove") then

  if v.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == v or v:HasTag("monster") then

  SpawnPrefab("explode_small").Transform:SetPosition(v.Transform:GetWorldPosition())

  v.components.health:DoDelta(-300)

  local pt01 = attacker:GetPosition()

  local pt02 = v:GetPosition()

  v.Transform:SetPosition((pt02.x-pt01.x)*1.5+pt02.x, 0, (pt02.z-pt01.z)*1.5+pt02.z)

  if v.components.locomotor then v.components.locomotor:Stop() end

  if v.components.health:GetPercent() < 0.3 then

  v.AnimState:SetMultColour(255/255,0/255,0/255,1)

  end

  end

  end

  end

  end )

  inst:AddComponent("tool")

  inst.components.tool:SetAction(ACTIONS.CHOP, 15)

  inst:AddTag("bigaxes")

  end

  end

  inst.OnSave = onsave

  inst.OnLoad = onload

  即可用蜻蜓鳞片种霸王斧,装备霸王斧攻击时,自动会吸取敌人的血,补充主角生命值,同时震开并伤害周围的敌人(区域攻击),减少你被围殴的机会。霸王斧用来砍树也极其锋利,一斧便可砍倒一棵。蜻蜓鳞片靠打蜻蜓获得,也可在“巨型超市”花9-11个黄金购得

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

责任编辑:Shy夏夏

上一页 171 172 173 174 175 176 177 178 179 180 181 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

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