哈迪斯吧 关注:39,021贴子:180,928
  • 17回复贴,共1

哈迪斯1通过修改代码文件实现开局第一个祝福必定史诗/英雄

只看楼主收藏回复

自己不想下载mod,所以自己研究了一下代码,具体的修改步骤如下:
1.关闭游戏,浏览哈迪斯的本地文件

2.找到Content\Scripts\RoomManager.lua,用记事本打开,然后将代码粘贴到下图位置并保存,代码会放在下面,有两段,第一段是修改第一个祝福的等级,第二段是修改第一个赫尔墨斯祝福的等级,根据自己的需求添加就行

3.启动游戏就可以了


IP属地:广东1楼2025-03-10 09:54回复
    下面是修改第一个祝福等级为英雄级的代码,如果只想要史诗,就要把下面代码里面的 heroicRoll = 1改成 heroicRoll = 0,还有把 epicRoll = 0 改成 epicRoll = 1,代码:
    --第一个祝福等级
    if CurrentRun.HasFirstBoon == nil then
    CurrentRun.HasFirstBoon = false
    end
    if not CurrentRun.HasFirstBoon and referencedTable == "BoonData" then
    legendaryRoll = 0
    heroicRoll = 1 --英雄
    epicRoll = 0 --史诗
    rareRoll = 0 --稀有
    CurrentRun.HasFirstBoon = true
    end


    IP属地:广东2楼2025-03-10 09:58
    收起回复
      下面是修改第一个赫尔墨斯祝福等级为英雄级的代码,如果只想要史诗,就要把下面代码里面的 heroicRoll = 1改成 heroicRoll = 0,还有把 epicRoll = 0 改成 epicRoll = 1,代码:
      --第一个赫尔墨斯等级
      if CurrentRun.HasFirstHermesBoon == nil then
      CurrentRun.HasFirstHermesBoon = false
      end
      if not CurrentRun.HasFirstHermesBoon and referencedTable == "HermesData" then
      legendaryRoll =0
      heroicRoll = 1 --英雄
      epicRoll = 0 --史诗
      rareRoll = 0 --稀有
      CurrentRun.HasFirstHermesBoon = true
      end


      IP属地:广东3楼2025-03-10 09:59
      收起回复
        啊?现在都流行不打mod改源码了


        IP属地:福建来自Android客户端4楼2025-03-10 12:15
        收起回复
          哈迪斯2怎么改


          IP属地:江苏来自Android客户端5楼2025-03-10 15:30
          收起回复
            第二段不需要缩进吗


            IP属地:江苏来自Android客户端6楼2025-03-10 23:16
            收起回复
              歪日


              IP属地:安徽来自Android客户端7楼2025-03-10 23:37
              回复
                2,3楼的代码存在bug,比如第一层路过卡戎商店,商店售卖赫尔墨斯祝福,没购买的话也会消耗首次指定稀有度的次数,所以将代码进行了更新,如果已经按2,3楼修改了,要将2,3楼增加的那部分代码删掉,下面是新的修改方式,第一段代码将下面代码粘贴到图片位置
                function GetRarityChances1( args )
                local name = args.Name
                local ignoreTempRarityBonus = args.IgnoreTempRarityBonus
                local referencedTable = "BoonData"
                if name == "StackUpgrade" then
                referencedTable = "StackData"
                elseif name == "WeaponUpgrade" then
                referencedTable = "WeaponData"
                elseif name == "HermesUpgrade" then
                referencedTable = "HermesData"
                end
                local legendaryRoll = CurrentRun.Hero[referencedTable].LegendaryChance or 0
                local heroicRoll = CurrentRun.Hero[referencedTable].HeroicChance or 0
                local epicRoll = CurrentRun.Hero[referencedTable].EpicChance or 0
                local rareRoll = CurrentRun.Hero[referencedTable].RareChance or 0
                --第一个祝福等级
                if CurrentRun.HasFirstBoon == nil then
                CurrentRun.HasFirstBoon = false
                end
                if not CurrentRun.HasFirstBoon and referencedTable == "BoonData" then
                legendaryRoll = 0
                heroicRoll = 1 --英雄
                epicRoll = 0 --史诗
                rareRoll = 0 --稀有
                CurrentRun.HasFirstBoon = true
                end
                --第一个赫尔墨斯等级
                if CurrentRun.HasFirstHermesBoon == nil then
                CurrentRun.HasFirstHermesBoon = false
                end
                if not CurrentRun.HasFirstHermesBoon and referencedTable == "HermesData" then
                legendaryRoll =0
                heroicRoll = 1 --英雄
                epicRoll = 0 --史诗
                rareRoll = 0 --稀有
                CurrentRun.HasFirstHermesBoon = true
                end
                if CurrentRun.CurrentRoom.BoonRaritiesOverride then
                legendaryRoll = CurrentRun.CurrentRoom.BoonRaritiesOverride.LegendaryChance or legendaryRoll
                heroicRoll = CurrentRun.CurrentRoom.BoonRaritiesOverride.HeroicChance or heroicRoll
                epicRoll = CurrentRun.CurrentRoom.BoonRaritiesOverride.EpicChance or epicRoll
                rareRoll = CurrentRun.CurrentRoom.BoonRaritiesOverride.RareChance or rareRoll
                elseif args.BoonRaritiesOverride then
                legendaryRoll = args.BoonRaritiesOverride.LegendaryChance or legendaryRoll
                heroicRoll = args.BoonRaritiesOverride.HeroicChance or heroicRoll
                epicRoll = args.BoonRaritiesOverride.EpicChance or epicRoll
                rareRoll = args.BoonRaritiesOverride.RareChance or rareRoll
                end
                local metaupgradeRareBoost = GetNumMetaUpgrades( "RareBoonDropMetaUpgrade" ) * ( MetaUpgradeData.RareBoonDropMetaUpgrade.ChangeValue - 1 )
                local metaupgradeEpicBoost = GetNumMetaUpgrades( "EpicBoonDropMetaUpgrade" ) * ( MetaUpgradeData.EpicBoonDropMetaUpgrade.ChangeValue - 1 ) + GetNumMetaUpgrades( "EpicHeroicBoonMetaUpgrade" ) * ( MetaUpgradeData.EpicBoonDropMetaUpgrade.ChangeValue - 1 )
                local metaupgradeLegendaryBoost = GetNumMetaUpgrades( "DuoRarityBoonDropMetaUpgrade" ) * ( MetaUpgradeData.EpicBoonDropMetaUpgrade.ChangeValue - 1 )
                local metaupgradeHeroicBoost = GetNumMetaUpgrades( "EpicHeroicBoonMetaUpgrade" ) * ( MetaUpgradeData.EpicBoonDropMetaUpgrade.ChangeValue - 1 )
                legendaryRoll = legendaryRoll + metaupgradeLegendaryBoost
                heroicRoll = heroicRoll + metaupgradeHeroicBoost
                rareRoll = rareRoll + metaupgradeRareBoost
                epicRoll = epicRoll + metaupgradeEpicBoost
                local rarityTraits = GetHeroTraitValues("RarityBonus", { UnlimitedOnly = ignoreTempRarityBonus })
                for i, rarityTraitData in pairs(rarityTraits) do
                if rarityTraitData.RequiredGod == nil or rarityTraitData.RequiredGod == name then
                if rarityTraitData.RareBonus then
                rareRoll = rareRoll + rarityTraitData.RareBonus
                end
                if rarityTraitData.EpicBonus then
                epicRoll = epicRoll + rarityTraitData.EpicBonus
                end
                if rarityTraitData.HeroicBonus then
                heroicRoll = heroicRoll + rarityTraitData.HeroicBonus
                end
                if rarityTraitData.LegendaryBonus then
                legendaryRoll = legendaryRoll + rarityTraitData.LegendaryBonus
                end
                end
                end
                return
                {
                Rare = rareRoll,
                Epic = epicRoll,
                Heroic = heroicRoll,
                Legendary = legendaryRoll,
                }
                end


                IP属地:广东9楼2025-03-17 19:56
                回复
                  接楼上,把下图位置原本的 loot.RarityChances = GetRarityChances( loot )删掉,修改成下面代码,然后保存,就修改完成了
                  if not args.BoughtFromShop then
                  loot.RarityChances = GetRarityChances1( loot )
                  else
                  loot.RarityChances = GetRarityChances( loot )
                  end


                  IP属地:广东10楼2025-03-17 20:01
                  回复
                    大佬!!求帮忙弄一个哈迪斯2的开局英雄级别的祝福


                    IP属地:四川11楼2025-04-06 23:59
                    收起回复
                      很好用,感谢大佬


                      IP属地:浙江来自iPhone客户端12楼2025-04-09 12:28
                      收起回复