battlebrothers吧 关注:22,443贴子:291,663
  • 18回复贴,共1

关于传奇以及PTR的正义修改方法

只看楼主收藏回复

需要工具:CNUT编译以及反编译工具(我之前的帖子有下载地址)
不过针对PTR的修改可能不需要上述工具,毕竟PTR是NUT文件不是CNUT文件


IP属地:云南1楼2023-03-03 13:18回复
    正义(修改)方案一:
    关于传奇训练场,最高训练上限15点属性点和1点特质上限的修改


    IP属地:云南2楼2023-03-03 13:19
    回复
      通过打开传奇MOD本体压缩包\scripts\skills\traits\的目录下找到intensive_training_trait.cnut的文件,将其编译为nut文件之后可得以下
      HitpointsAdded = 0,
      StaminaAdded = 0,
      BraveAdded = 0,
      IniAdded = 0,
      MatkAdded = 0,
      RatkAdded = 0,
      MdefAdded = 0,
      RdefAdded = 0,
      TraitGained = "",
      BonusXP = 0.0,
      MaxSkillsCanBeAdded = 15
      },
      function create()
      {
      this.m.ID = "trait.intensive_training_trait";
      this.m.Name = "Training progress";
      this.m.Icon = "ui/traits/IntensiveTraining.png";
      this.m.Description = "This character can increase their abilities if you upgrade your camp training facilities.";
      this.m.Order = this.Const.SkillOrder.Background + 1;
      this.m.Type = this.Const.SkillType.Background | this.Const.SkillType.Trait;
      this.m.IsActive = false;
      this.m.IsStacking = false;
      this.m.IsHidden = false;
      this.m.IsHidden = false;
      this.m.IsSerialized = true;
      }
      function addRandomSkills( _bro, _skillsNum )
      {
      for( local i = 0; i < _skillsNum; i++ )
      {
      local attr = this.Math.rand(0, this.Const.Attributes.COUNT - 1);
      switch(attr)
      {
      case 0:
      _bro.getBaseProperties().Hitpoints += 1;
      this.addHitpoint();
      break;
      case 1:
      _bro.getBaseProperties().Bravery += 1;
      this.addBrave();
      break;
      case 2:
      _bro.getBaseProperties().Stamina += 1;
      this.addStamina();
      break;
      case 3:
      _bro.getBaseProperties().Initiative += 1;
      this.addIni();
      break;
      case 4:
      if (_bro.getBaseProperties().MeleeSkill > _bro.getBaseProperties().RangedSkill)
      {
      _bro.getBaseProperties().MeleeSkill += 1;
      this.addMatk();
      }
      else
      {
      _bro.getBaseProperties().RangedSkill += 1;
      this.addRatk();
      }
      break;
      case 5:
      _bro.getBaseProperties().MeleeDefense += 1;
      this.addMdef();
      break;
      default:
      _bro.getBaseProperties().RangedDefense += 1;
      this.addRdef();
      break;
      }
      }
      _bro.getSkills().update();
      }
      function getBonusXP()
      {
      return this.m.BonusXP;
      }
      function finishedTraining( _traitGained )
      {
      this.m.Description = "This character completed training and can\'t get any more skills from training. Training experience is slightly improved.";
      this.m.TraitGained = _traitGained;
      this.m.BonusXP = 0.05;
      }
      function addHitpoint()
      {
      this.m.HitpointsAdded++;
      }
      function addStamina()
      {
      this.m.StaminaAdded++;
      }
      function addBrave()
      {
      this.m.BraveAdded++;
      }
      function addIni()
      {
      this.m.IniAdded++;
      }
      function addMatk()
      {
      this.m.MatkAdded++;
      }
      function addRatk()
      {
      this.m.RatkAdded++;
      }
      function addMdef()
      {
      this.m.MdefAdded++;
      }
      function addRdef()
      {
      this.m.RdefAdded++;
      }
      function getDescription()
      {
      return this.m.Description;
      }
      function getStatsIncreased()
      {
      return this.m.HitpointsAdded + this.m.StaminaAdded + this.m.BraveAdded + this.m.IniAdded + this.m.MatkAdded + this.m.RatkAdded + this.m.MdefAdded + this.m.RdefAdded;
      }
      function isMaxReached()
      {
      return this.getStatsIncreased() >= this.m.MaxSkillsCanBeAdded;
      }
      function getMaxSkillsCanBeAdded()
      {
      return this.m.MaxSkillsCanBeAdded;
      }
      function successfullyTrained( _bro )
      {
      }
      function getTooltip()
      {
      local tooltip = this.skill.getTooltip();
      tooltip.push({
      id = 6,
      type = "text",
      icon = "",
      text = ""
      });
      if (this.getContainer().getActor().getBackground().getNameOnly() == "Donkey")
      {
      tooltip.push({
      id = 6,
      type = "text",
      icon = "ui/tooltips/warning.png",
      text = "Donkeys don\'t train"
      });
      }
      else if (this.getStatsIncreased() > 0)
      {
      tooltip.push({
      id = 6,
      type = "text",
      icon = "",
      text = "Training results so far:"
      });
      tooltip.push({
      id = 6,
      type = "text",
      icon = "ui/icons/special.png",
      text = "[color=" + this.Const.UI.Color.PositiveValue + "]" + this.getStatsIncreased() + "[/color] skill points"
      });
      if (this.isMaxReached())
      {
      tooltip.push({
      id = 6,
      type = "text",
      icon = "ui/icons/special.png",
      text = "[color=" + this.Const.UI.Color.PositiveValue + "]" + 1 + "[/color] Perk point"
      });
      tooltip.push({
      id = 6,
      type = "text",
      icon = "ui/icons/special.png",
      text = "[color=" + this.Const.UI.Color.PositiveValue + "]" + this.m.TraitGained + "[/color] trait"
      });
      }
      }
      else
      {
      tooltip.push({
      id = 6,
      type = "text",
      icon = "ui/tooltips/warning.png",
      text = "This character has not started training"
      });
      }
      return tooltip;
      }
      function isHidden()
      {
      if (this.getStatsIncreased() == 0)
      {
      return true;
      }
      else
      {
      return false;
      }
      }
      function onSerialize( _out )
      {
      this.skill.onSerialize(_out);
      _out.writeU16(this.m.HitpointsAdded);
      _out.writeU16(this.m.StaminaAdded);
      _out.writeU16(this.m.BraveAdded);
      _out.writeU16(this.m.IniAdded);
      _out.writeU16(this.m.MatkAdded);
      _out.writeU16(this.m.RatkAdded);
      _out.writeU16(this.m.MdefAdded);
      _out.writeU16(this.m.RdefAdded);
      _out.writeF32(this.m.BonusXP);
      _out.writeString(this.m.TraitGained);
      }
      function onDeserialize( _in )
      {
      this.skill.onDeserialize(_in);
      this.m.HitpointsAdded = _in.readU16();
      this.m.StaminaAdded = _in.readU16();
      this.m.BraveAdded = _in.readU16();
      this.m.IniAdded = _in.readU16();
      this.m.MatkAdded = _in.readU16();
      this.m.RatkAdded = _in.readU16();
      this.m.MdefAdded = _in.readU16();
      this.m.RdefAdded = _in.readU16();
      this.m.BonusXP = _in.readF32();
      this.m.TraitGained = _in.readString();
      }
      });


      IP属地:云南3楼2023-03-03 13:23
      收起回复
        关于PTR技能树大修MOD下,独狼开局或者说十字军开局的武器大师技能只有三个且需要反复刷开局的解决办法。
        这个的话解决起来也比较方便,因为PTR的代码文件没有加密,可以直接修改。
        同样,打开PTR的本体压缩包\scripts\!mods_preload\目录下的ptr_mod_character_backgrounds.nut文件。
        可以看到PTRMOD重新安排技能树(或者说天赋树)的方法是直接清空传奇MOD的技能树,然后再添加自己的定义的一些技能树分支来达到技能树丰富化的效果()
        然后这里我就拿传奇独狼开局的起源来当例子,
        在当前文本下搜索lonewolf
        就可以找到::mods_hookNewObject("skills/backgrounds/legend_lonewolf_background", function(o) {以下一系列代码,然后可以看到第一段添加自定义天赋树(技能树)的代码
        addPerkTreesToCustomPerkTree(o.m.CustomPerkTree,
        这里是添加特定的技能树分支代码,不过独狼的这里貌似只有重甲的天赋树分支。
        这里我们可以直接添加轻甲,中甲的天赋树分支
        这里也就变成了
        addPerkTreesToCustomPerkTree(o.m.CustomPerkTree,
        [
        this.Const.Perks.LargeTree,
        this.Const.Perks.ResilientTree,
        this.Const.Perks.SturdyTree,
        this.Const.Perks.UnstoppableTree,
        this.Const.Perks.ViciousTree,
        this.Const.Perks.LightArmorTree,
        this.Const.Perks.MediumArmorTree,
        this.Const.Perks.HeavyArmorTree
        ]
        );


        IP属地:云南4楼2023-03-03 13:39
        回复
          然后我们接着看下面的本地技能树分支,发现这里已经涵盖了所有的近战武器分支,那为什么在PTRMOD下独狼开局只有三个武器技能树分支呢?
          那是因为这段代码的下面有个for 添加技能树分支的循环,用来增添随机性,这里只需要将i<3改成i<7就可以成功做到把所有近战武器的技能分支都添加进去(尽管这样来说这段循环的存在不大
          然后接下来可以看到PTR独狼的技能树组成除了这些技能树分支之外
          还有一个特定的自定义插入的技能树
          addPerksToCustomPerkTree(1, o.m.CustomPerkTree, [
          this.Const.Perks.PerkDefs.BagsAndBelts,
          this.Const.Perks.PerkDefs.Pathfinder,
          this.Const.Perks.PerkDefs.Student,
          this.Const.Perks.PerkDefs.STRPhalanx,
          this.Const.Perks.PerkDefs.PTRProfessional,
          this.Const.Perks.PerkDefs.PTRMenacing
          ]
          );
          addPerksToCustomPerkTree(2, o.m.CustomPerkTree, [
          this.Const.Perks.PerkDefs.FortifiedMind,
          this.Const.Perks.PerkDefs.PTRExudeConfidence,
          this.Const.Perks.PerkDefs.Rotation,
          this.Const.Perks.PerkDefs.STRCoverAlly,
          this.Const.Perks.PerkDefs.Gifted
          ]
          );
          addPerksToCustomPerkTree(3, o.m.CustomPerkTree, [
          this.Const.Perks.PerkDefs.PTRBully,
          this.Const.Perks.PerkDefs.PTRPatternRecognition,
          this.Const.Perks.PerkDefs.PTRFormidableApproach
          ]
          );
          addPerksToCustomPerkTree(4, o.m.CustomPerkTree, [
          this.Const.Perks.PerkDefs.PTRWearsItWell,
          this.Const.Perks.PerkDefs.PTRPersonalArmor,
          this.Const.Perks.PerkDefs.PTRVigilant,
          this.Const.Perks.PerkDefs.STRLineBreaker
          ]
          );
          addPerksToCustomPerkTree(5, o.m.CustomPerkTree, [
          this.Const.Perks.PerkDefs.LegendBattleheart,
          this.Const.Perks.PerkDefs.DoubleStrike
          ]
          );
          addPerksToCustomPerkTree(6, o.m.CustomPerkTree, [
          this.Const.Perks.PerkDefs.PTRVigorousAssault,
          this.Const.Perks.PerkDefs.PTRKnowTheirWeakness,
          this.Const.Perks.PerkDefs.LegendClarity,
          this.Const.Perks.PerkDefs.PTRSweepingStrikes
          ]
          );
          addPerksToCustomPerkTree(7, o.m.CustomPerkTree, [
          this.Const.Perks.PerkDefs.Rebound,
          this.Const.Perks.PerkDefs.PerfectFocus,
          this.Const.Perks.PerkDefs.PTRManOfSteel
          ]
          );


          IP属地:云南5楼2023-03-03 13:45
          收起回复
            以上就是关于传奇以及PTR MOD正义方法的内容了,此贴完结


            IP属地:云南6楼2023-03-03 13:47
            回复
              正常来说按这样修改之后传奇+PTRMOD的独狼开局的
              技能树应是如图所示


              IP属地:云南7楼2023-03-03 13:52
              回复
                想让乞丐的树变得整齐好看应该怎么修改以及乞丐偷技能拥有的技能越多越难偷是什么原因


                IP属地:北京来自Android客户端8楼2023-03-04 01:57
                收起回复
                  o.onTargetKilled = function( _targetEntity, _skill )
                  {
                  local actor = this.getContainer().getActor();
                  if (actor.isAlliedWith(_targetEntity))
                  {
                  return;
                  }
                  actor.getBaseProperties().Hitpoints += (actor.getBaseProperties().Hitpoints < _targetEntity.getBaseProperties().Hitpoints ? 1 : 0);
                  actor.getBaseProperties().Bravery += (actor.getBaseProperties().Bravery < _targetEntity.getBaseProperties().Bravery ? 1 : 0);
                  actor.getBaseProperties().Stamina += (actor.getBaseProperties().Stamina < _targetEntity.getBaseProperties().Stamina ? 1 : 0);
                  actor.getBaseProperties().MeleeSkill += (actor.getBaseProperties().MeleeSkill < _targetEntity.getBaseProperties().MeleeSkill ? 1 : 0);
                  actor.getBaseProperties().RangedSkill += (actor.getBaseProperties().RangedSkill < _targetEntity.getBaseProperties().RangedSkill ? 1 : 0);
                  actor.getBaseProperties().MeleeDefense += (actor.getBaseProperties().MeleeDefense < _targetEntity.getBaseProperties().MeleeDefense ? 1 : 0);
                  actor.getBaseProperties().RangedDefense += (actor.getBaseProperties().RangedDefense < _targetEntity.getBaseProperties().RangedDefense ? 1 : 0);
                  actor.getBaseProperties().Initiative += (actor.getBaseProperties().Initiative < _targetEntity.getBaseProperties().Initiative ? 1 : 0);
                  local target_skills = _targetEntity.getSkills().getSkillsByFunction(@(skill) skill.isType(::Const.SkillType.Perk));
                  local potentialPerks = [];
                  foreach (perk in target_skills)
                  {
                  local id = perk.getID();
                  if (id == "perk.stalwart" || id == "perk.legend_composure" || id == "perk.battering_ram")
                  {
                  continue;
                  }
                  if (!actor.getSkills().hasSkill(id))
                  {
                  potentialPerks.push(perk);
                  }
                  }
                  if (potentialPerks.len() == 0)
                  {
                  return;
                  }
                  local perk = potentialPerks[this.Math.rand(0, potentialPerks.len() - 1)];
                  foreach( i, v in this.Const.Perks.PerkDefObjects )
                  {
                  if (perk.getID() == v.ID)
                  {
                  if (v.Script != "")
                  {
                  this.Tactical.EventLog.log("The framed beggar learned [color=" + this.Const.UI.Color.NegativeValue + "]" + perk.getName() + "[/color] from " + _targetEntity.getName());
                  actor.getSkills().add(this.new(v.Script));
                  local rowToAddPerk = 0;
                  local length = actor.getBackground().getPerkTree()[0].len();
                  foreach (i, row in actor.getBackground().getPerkTree())
                  {
                  if (row.len() < length) rowToAddPerk = i;
                  }
                  actor.getBackground().addPerk(i, rowToAddPerk);
                  break;
                  }
                  }
                  }
                  }


                  IP属地:云南9楼2023-03-04 10:42
                  收起回复
                    好铁汁,从下面顶一顶楼主


                    IP属地:江苏来自Android客户端10楼2023-11-15 02:18
                    回复
                      老哥请问剑师技能树只能学一个技能的限制能改么


                      IP属地:湖北来自Android客户端11楼2023-12-05 00:22
                      回复