Exemplo n.º 1
0
        static internal void updateItemsForChannelDerivative(BlueprintAbility original_ability, BlueprintAbility derived_ability)
        {
            var config = derived_ability.GetComponent <ContextRankConfig>();

            ContextRankProgression progression = Helpers.GetField <ContextRankProgression>(config, "m_Progression");
            int step        = Helpers.GetField <int>(config, "m_StepLevel");
            int level_scale = (progression == ContextRankProgression.OnePlusDivStep || progression == ContextRankProgression.DivStep || progression == ContextRankProgression.StartPlusDivStep)
                                    ? step : 2;

            //phylacteries bonuses
            BlueprintEquipmentEnchantment[] enchants = new BlueprintEquipmentEnchantment[] { library.Get <Kingmaker.Blueprints.Items.Ecnchantments.BlueprintEquipmentEnchantment>("60f06749fa4729c49bc3eb2eb7e3b316"),
                                                                                             library.Get <Kingmaker.Blueprints.Items.Ecnchantments.BlueprintEquipmentEnchantment>("f5d0bf8c1b4574848acb8d1fbb544807"),
                                                                                             library.Get <Kingmaker.Blueprints.Items.Ecnchantments.BlueprintEquipmentEnchantment>("cb4a39044b59f5e47ad5bc08ff9d6669"),
                                                                                             library.Get <Kingmaker.Blueprints.Items.Ecnchantments.BlueprintEquipmentEnchantment>("e988cf802d403d941b2ed8b6016de68f"), };

            foreach (var e in enchants)
            {
                var boni = e.GetComponents <AddCasterLevelEquipment>().ToArray();
                foreach (var b in boni)
                {
                    if (b.Spell == original_ability)
                    {
                        var b2 = b.CreateCopy();
                        b2.Spell = derived_ability;
                        b2.Bonus = boni[0].Bonus / 2 * level_scale;
                        e.AddComponent(b2);
                    }
                }
            }


            BlueprintBuff[] buffs = new BlueprintBuff[] { library.Get <BlueprintBuff>("b5ebb94df76531c4ca4f13bfd91efd4e") };// camp dish buff

            foreach (var buff in buffs)
            {
                var boni = buff.GetComponents <AddCasterLevelForAbility>().ToArray();
                foreach (var b in boni)
                {
                    if (b.Spell == original_ability)
                    {
                        var b2 = b.CreateCopy();
                        b2.Spell = derived_ability;
                        b2.Bonus = boni[0].Bonus / 2 * level_scale;
                        buff.AddComponent(b2);
                    }
                }
            }
        }
 ContextRankConfig createClassScalingConfig(
     ContextRankProgression progression = ContextRankProgression.AsIs,
     AbilityRankType type = AbilityRankType.Default,
     int?min = null, int?max = null, int startLevel = 0, int stepLevel = 0,
     (int, int)[] customProgression = null)
 public static void SetProgression(this ContextRankConfig contextRankConfig, ContextRankProgression value)
 {
     contextRankConfig.SetFieldValue("m_Progression", value);
 }