Exemplo n.º 1
0
        static void createKiPool()
        {
            var rogue_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("299aa766dee3cbf4790da4efb8c72484");

            ki_resource = Helpers.CreateAbilityResource("NinjaKiResource", "", "", "", null);
            ki_resource.SetIncreasedByStat(0, StatType.Charisma);
            ki_resource.SetIncreasedByLevelStartPlusDivStep(0, 0, 0, 2, 1, 0, 0.0f, getRogueArray());

            var buff_extra_attack = library.Get <BlueprintBuff>("cadf8a5c42002494cabfc6c1196b514a");

            buff_extra_attack.SetNameDescription("", ""); //inherit from parent ability

            var ki_extra_attack = library.CopyAndAdd <BlueprintAbility>("ca948bb4ce1a2014fbf4d8d44b553074", "NinjaKiExtraAttackAbility", "");

            ki_extra_attack.SetDescription("By spending 1 point from his ki pool as a swift action, a ninja can make one additional attack at his highest attack bonus when making a full attack. This bonus attack stacks with haste and similar effects.");
            ki_extra_attack.ReplaceComponent <AbilityResourceLogic>(a => a.RequiredResource = ki_resource);

            var ki_speed_buff = library.CopyAndAdd <BlueprintBuff>("9ea4ec3dc30cd7940a372a4d699032e7", "NinjaKiSpeedBoostBuff", "");

            ki_speed_buff.ReplaceComponent <BuffMovementSpeed>(b => b.Value = 20);
            var ki_speed_burst = library.CopyAndAdd <BlueprintAbility>("8c98b8f3ac90fa245afe14116e48c7da", "NinjaKiSpeedBoostAbility", "");

            var new_actions = Common.changeAction <ContextActionApplyBuff>(ki_speed_burst.GetComponent <AbilityEffectRunAction>().Actions.Actions,
                                                                           c =>
            {
                c.Buff          = ki_speed_buff;
                c.DurationValue = Helpers.CreateContextDuration(1, DurationRate.Rounds);
            }
                                                                           );

            ki_speed_burst.ReplaceComponent <AbilityEffectRunAction>(Helpers.CreateRunActions(new_actions));
            ki_speed_burst.ReplaceComponent <AbilityResourceLogic>(a => a.RequiredResource = ki_resource);
            ki_speed_burst.SetNameDescription("Ki Speed Burst",
                                              "A ninja with this ki power can spend 1 point from his ki pool as a swift action to grant himself a sudden burst of speed. This increases the ninja's base land speed by 20 feet for 1 round.");


            var ki_extra_attack_feature = Common.AbilityToFeature(ki_extra_attack);

            ki_pool = Helpers.CreateFeature("KiPoolNinjaFeature",
                                            "Ki Pool",
                                            "At 2nd level, a ninja gains a pool of ki points, supernatural energy she can use to accomplish amazing feats. The number of points in the ninja’s ki pool is equal to 1/2 her ninja level + her Charisma modifier.\n"
                                            + "By spending 1 point from her ki pool, a ninja can make one additional attack at her highest attack bonus, but she can do so only when making a full attack. In addition, she can spend 1 point to increase her speed by 20 feet for 1 round. Each of these powers is activated as a swift action. A ninja can gain additional powers that consume points from her ki pool by selecting certain ninja tricks.",
                                            "",
                                            null,
                                            FeatureGroup.None,
                                            Helpers.CreateAddFacts(ki_speed_burst),
                                            Helpers.CreateAddFeatureOnClassLevel(ki_extra_attack_feature, 5, new BlueprintCharacterClass[] { archetype.GetParentClass() }, before: true),
                                            ki_resource.CreateAddAbilityResource());

            ninja_ki_extra_attack_ability = ki_extra_attack;
        }
Exemplo n.º 2
0
        static void createSolarInvocation()
        {
            solar_invocation_resource = Helpers.CreateAbilityResource("SolarInvocationResource", "", "", "", null);
            solar_invocation_resource.SetIncreasedByLevel(0, 2, getDawnflowerAcnchoriteArray());
            solar_invocation_resource.SetIncreasedByStat(0, StatType.Charisma);

            bask_in_radiance = Helpers.CreateFeature("BaskInRadianceFeature",
                                                     "Bask in Radiance",
                                                     "At 3rd level, when a Dawnflower anchorite uses his solar invocation ability, he can designate any number of allies within 30 feet to gain the bonuses granted by solar invocation for as long as he maintains the ability.",
                                                     "",
                                                     Helpers.GetIcon("0d657aa811b310e4bbd8586e60156a2d"), //cure critical wounds
                                                     FeatureGroup.None
                                                     );

            var icon = LoadIcons.Image2Sprite.Create(@"AbilityIcons/FontOfSpiritMagic.png");

            var effect_buff = Helpers.CreateBuff("SolarInvocationEffectBuff",
                                                 "Solar Invocation",
                                                 "A Dawnflower anchorite can harness the sun’s life-giving warmth to protect the innocent and smite the wicked. At 1st level, he can invoke the sun as a standard action, granting him a +1 competence bonus on attack rolls and damage rolls against evil creatures and adding 1 to the DC of his spells and spell-like abilities against evil creatures. The bonus on attack rolls and damage rolls increases to +2 at 5th level and +3 at 9th level. If a Dawnflower anchorite has an animal companion, the companion also gains the competence bonus on attack and damage rolls while this ability is active.\n"
                                                 + "A Dawnflower anchorite can invoke the sun for a number of rounds per day equal to twice his Dawnflower anchorite class level + his Charisma modifier. Maintaining this ability on subsequent rounds is a free action. These bonuses apply only when the Dawnflower anchorite is standing in an outdoor area.\n",
                                                 "",
                                                 icon,
                                                 null,
                                                 Helpers.Create <NewMechanics.AttackBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.Default); a.descriptor = ModifierDescriptor.Competence; a.alignment = AlignmentComponent.Evil; }),
                                                 Helpers.Create <NewMechanics.SpellsDCBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.StatBonus); a.descriptor = ModifierDescriptor.UntypedStackable; a.alignment = AlignmentComponent.Evil; }),
                                                 Helpers.Create <NewMechanics.DamageBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.Default); a.descriptor = ModifierDescriptor.Competence; a.alignment = AlignmentComponent.Evil; })
                                                 );

            var defense_effect_buff = Helpers.CreateBuff("SolarDefenseEffectBuff",
                                                         "Solar Defense",
                                                         "While using solar invocation, the Dawnflower anchorite adds his competence bonus on attack rolls to his Armor Class as a dodge bonus and to Reflex saving throws as a sacred bonus against evil creatures. The Dawnflower anchorite can select this credence twice—the second time he does so, the bonus to Armor Class and on Ref lex saves also applies to any companions who gain bonuses from the Dawnflower anchorite’s solar invocation.",
                                                         "",
                                                         Helpers.GetIcon("62888999171921e4dafb46de83f4d67d"), //shield of dawn
                                                         null,
                                                         Helpers.Create <NewMechanics.ArmorClassBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.Default); a.descriptor = ModifierDescriptor.Dodge; a.alignment = AlignmentComponent.Evil; }),
                                                         Helpers.Create <NewMechanics.ContextSavingThrowBonusAgainstAlignment>(a => { a.value = Helpers.CreateContextValue(AbilityRankType.Default); a.descriptor = ModifierDescriptor.Sacred; a.alignment = AlignmentComponent.Evil; a.save_type = SavingThrowType.Reflex; })
                                                         );

            solar_defense = Helpers.CreateFeature("SolarDefenseFeature",
                                                  "Solar Defense I",
                                                  defense_effect_buff.Description,
                                                  "",
                                                  defense_effect_buff.Icon,
                                                  FeatureGroup.None
                                                  );

            solar_defense2 = Helpers.CreateFeature("SolarDefense2Feature",
                                                   "Solar Defense II",
                                                   defense_effect_buff.Description,
                                                   "",
                                                   defense_effect_buff.Icon,
                                                   FeatureGroup.None,
                                                   Helpers.PrerequisiteFeature(solar_defense)
                                                   );

            var flaming            = library.Get <BlueprintWeaponEnchantment>("30f90becaaac51f41bf56641966c4121");
            var solar_weapons_buff = Helpers.CreateBuff("SolarWeaponsEffectBuff",
                                                        "Solar Weapons",
                                                        "While using solar invocation, the Dawnflower anchorite grants the flaming weapon special ability to one weapon of each creature affected by the Dawnflower anchorite’s solar invocation.",
                                                        "",
                                                        LoadIcons.Image2Sprite.Create(@"AbilityIcons/FlameBlade.png"),
                                                        null,
                                                        Common.createBuffContextEnchantPrimaryHandWeapon(1, false, true, new BlueprintWeaponEnchantment[] { flaming })
                                                        );

            solar_weapons = Helpers.CreateFeature("SolarWeaponsFeature",
                                                  solar_weapons_buff.Name,
                                                  solar_weapons_buff.Description,
                                                  "",
                                                  solar_weapons_buff.Icon,
                                                  FeatureGroup.None
                                                  );

            var apply_solar_defense = Common.createContextActionApplyBuff(defense_effect_buff, Helpers.CreateContextDuration(), false, true, true, false);
            var apply_solar_weapons = Common.createContextActionApplyBuff(solar_weapons_buff, Helpers.CreateContextDuration(), false, true, true, false);

            Common.addContextActionApplyBuffOnConditionToActivatedAbilityBuffNoRemove(effect_buff,
                                                                                      Helpers.CreateConditional(Common.createContextConditionCasterHasFact(solar_weapons),
                                                                                                                apply_solar_weapons
                                                                                                                )
                                                                                      );
            Common.addContextActionApplyBuffOnConditionToActivatedAbilityBuffNoRemove(effect_buff,
                                                                                      Helpers.CreateConditional(Common.createContextConditionCasterHasFact(solar_defense),
                                                                                                                Helpers.CreateConditional(Helpers.CreateConditionsCheckerOr(Common.createContextConditionIsCaster(),
                                                                                                                                                                            Common.createContextConditionCasterHasFact(solar_defense2)
                                                                                                                                                                            ),
                                                                                                                                          apply_solar_defense)
                                                                                                                )
                                                                                      );
            var toggle = Common.createToggleAreaEffect(effect_buff, 30.Feet(),
                                                       Helpers.CreateConditionsCheckerOr(Common.createContextConditionIsCaster(),
                                                                                         Helpers.Create <CompanionMechanics.ContextConditionIsPet>(),
                                                                                         Helpers.Create <NewMechanics.ContextConditionIsAllyAndCasterHasFact>(c => c.fact = bask_in_radiance)
                                                                                         ),
                                                       AbilityActivationType.WithUnitCommand,
                                                       UnitCommand.CommandType.Standard,
                                                       Common.createPrefabLink("dfc59904273f7ee49ab00e5278d86e16"),
                                                       Common.createPrefabLink("9353083f430e5a44a8e9d6e26faec248")
                                                       );

            toggle.AddComponents(solar_invocation_resource.CreateActivatableResourceLogic(ResourceSpendType.NewRound));
            toggle.DeactivateIfCombatEnded   = true;
            toggle.DeactivateIfOwnerDisabled = true;
            toggle.Buff.SetBuffFlags(BuffFlags.HiddenInUi);
            toggle.Group     = ActivatableAbilityGroupExtension.SolarInvocation.ToActivatableAbilityGroup();
            solar_invocation = Common.ActivatableAbilityToFeature(toggle, false);
            solar_invocation.AddComponents(solar_invocation_resource.CreateAddAbilityResource());

            solar_invocation2 = SaveGameFix.createDummyFeature("SolarInvocation2Feature", "");
            solar_invocation3 = SaveGameFix.createDummyFeature("SolarInvocation3Feature", "");
            var solar_invocation4 = SaveGameFix.createDummyFeature("SolarInvocation4Feature", "");

            solar_invocation2.HideInCharacterSheetAndLevelUp = true;
            solar_invocation2.HideInUI = true;
            solar_invocation3.HideInCharacterSheetAndLevelUp = true;
            solar_invocation3.HideInUI = true;
            solar_invocation4.HideInCharacterSheetAndLevelUp = true;
            solar_invocation4.HideInUI = true;
            solar_invocation.AddComponents(Helpers.CreateAddFeatureOnClassLevel(solar_invocation2, 5, getDawnflowerAcnchoriteArray()),
                                           Helpers.CreateAddFeatureOnClassLevel(solar_invocation3, 9, getDawnflowerAcnchoriteArray()));

            //add scaling to buffs and dawnflower invocation

            var dawnflower_invocation_buff = Helpers.CreateBuff("DawnflowerInvocationBuff",
                                                                "Dawnflower Invocation",
                                                                "At 10th level, a Dawnflower anchorite is able to, once per day, use his solar invocation ability for 1 minute. The Dawnflower anchorite can also use this ability indoors or underground. While using Dawnflower invocation, all bonuses gained from solar invocation increase by 1. Using this ability doesn’t cost rounds per day of solar invocation.",
                                                                "",
                                                                Helpers.GetIcon("e67efd8c84f69d24ab472c9f546fff7e"),
                                                                null,
                                                                Helpers.CreateAddFactContextActions(activated: Common.createContextActionApplyBuff(toggle.Buff, Helpers.CreateContextDuration(), false, true, true, false)),
                                                                Helpers.CreateAddFact(solar_invocation4)
                                                                );

            var dawnflower_invocation_resource = Helpers.CreateAbilityResource("DawnflowerInvocationResource", "", "", "", null);

            dawnflower_invocation_resource.SetFixedResource(1);
            var dawnflower_invocation_ability = Helpers.CreateAbility("DawnflowerInvocationAbility",
                                                                      dawnflower_invocation_buff.Name,
                                                                      dawnflower_invocation_buff.Description,
                                                                      "",
                                                                      dawnflower_invocation_buff.Icon,
                                                                      AbilityType.Supernatural,
                                                                      CommandType.Swift,
                                                                      AbilityRange.Personal,
                                                                      Helpers.oneMinuteDuration,
                                                                      "",
                                                                      Helpers.CreateRunActions(Common.createContextActionApplyBuff(dawnflower_invocation_buff, Helpers.CreateContextDuration(1, DurationRate.Minutes), dispellable: false)),
                                                                      Common.createAbilitySpawnFx("52d413df527f9fa4a8cf5391fd593edd", anchor: AbilitySpawnFxAnchor.SelectedTarget, position_anchor: AbilitySpawnFxAnchor.None, orientation_anchor: AbilitySpawnFxAnchor.None),
                                                                      dawnflower_invocation_resource.CreateResourceLogic()
                                                                      );

            dawnflower_invocation_ability.setMiscAbilityParametersSelfOnly();
            dawnflower_invocation = Common.AbilityToFeature(dawnflower_invocation_ability, false);
            dawnflower_invocation.AddComponent(dawnflower_invocation_resource.CreateAddAbilityResource());

            toggle.AddComponent(Common.createActivatableAbilityRestrictionHasFact(dawnflower_invocation_buff, not: true));
            var config = Helpers.CreateContextRankConfig(ContextRankBaseValueType.FeatureList,
                                                         featureList: new BlueprintFeature[] { solar_invocation, solar_invocation2, solar_invocation3, solar_invocation4 }
                                                         );
            var config2 = Helpers.CreateContextRankConfig(ContextRankBaseValueType.FeatureList, type: AbilityRankType.StatBonus,
                                                          featureList: new BlueprintFeature[] { solar_invocation, solar_invocation4 }
                                                          );

            effect_buff.AddComponents(config, config2);
            defense_effect_buff.AddComponent(config);

            solar_invocation_move_action = Helpers.CreateFeature("SolarInvocationMoveActionFeature",
                                                                 "Solar Invocation: Move Action",
                                                                 "At 5th level, a Dawnflower anchorite can invoke the sun as a move action instead of a standard action. At 10th level, he can invoke the sun as a swift action.",
                                                                 "",
                                                                 Helpers.GetIcon("03a9630394d10164a9410882d31572f0"), //aid
                                                                 FeatureGroup.None,
                                                                 Helpers.Create <ActivatableAbilityActionTypeModierMechanics.ModifyActivatableAbilityGroupActionType>(m =>
            {
                m.group  = ActivatableAbilityGroupExtension.SolarInvocation.ToActivatableAbilityGroup();
                m.action = CommandType.Move;
            }
                                                                                                                                                                      )
                                                                 );
            solar_invocation_swift_action = library.CopyAndAdd(solar_invocation_move_action, "SolarInvocationSwiftActionFeature", "");
            solar_invocation_swift_action.SetName("Solar Invocation: Swift Action");
            solar_invocation_swift_action.ReplaceComponent <ActivatableAbilityActionTypeModierMechanics.ModifyActivatableAbilityGroupActionType>(m => m.action = CommandType.Swift);

            divine_light = Helpers.CreateFeature("DivineLightFeature",
                                                 "Divine Light",
                                                 "The Dawnflower anchorite can use solar invocation indoors or underground. He can use solar invocation 2 additional rounds per day.",
                                                 "",
                                                 Helpers.GetIcon("be2062d6d85f4634ea4f26e9e858c3b8"), //cleanse
                                                 FeatureGroup.None,
                                                 Helpers.Create <IncreaseResourceAmount>(i => { i.Resource = solar_invocation_resource; i.Value = 2; })
                                                 );

            toggle.AddComponent(Helpers.Create <NewMechanics.OutdoorsUnlessHasFact>(o => o.fact = divine_light));
        }
Exemplo n.º 3
0
        static BlueprintFeature createTwinnedSpellLikeAbility(string display_name, string description, UnityEngine.Sprite icon,
                                                              int spell_level, BlueprintAbilityResource resource, bool hide = true)
        {
            var spells = Summoner.summoner_class.Spellbook.SpellList.SpellsByLevel[spell_level].Spells;

            var abilities = new List <BlueprintAbility>();

            foreach (var s in spells)
            {
                if (!s.HasVariants)
                {
                    var spell_like = Common.convertToSpellLike(s, "TwinnedEidolon", new BlueprintCharacterClass[] { eidolon_class }, StatType.Charisma, resource, no_scaling: true,
                                                               guid: Helpers.MergeIds("cff70e146d58443e82072d759e61e7ef", s.AssetGuid));
                    spell_like.AddComponent(Helpers.Create <CompanionMechanics.AbilityShowIfMasterKnowsSpellAndPetHAsSufficientStat>(a =>
                    {
                        a.master_class = Summoner.summoner_class;
                        a.stat         = StatType.Charisma;
                        a.min_stat     = 10 + spell_level;
                        a.spell        = s;
                    }));
                    abilities.Add(spell_like);
                }
                else
                {
                    List <BlueprintAbility> spell_likes = new List <BlueprintAbility>();
                    foreach (var v in s.Variants)
                    {
                        var spell_like = Common.convertToSpellLike(v, "TwinnedEidolon", new BlueprintCharacterClass[] { eidolon_class }, StatType.Charisma, resource, no_scaling: true,
                                                                   guid: Helpers.MergeIds("cff70e146d58443e82072d759e61e7ef", v.AssetGuid));
                        spell_like.AddComponent(Helpers.Create <CompanionMechanics.AbilityShowIfMasterKnowsSpellAndPetHAsSufficientStat>(a =>
                        {
                            a.master_class = Summoner.summoner_class;
                            a.stat         = StatType.Charisma;
                            a.min_stat     = 10 + spell_level;
                            a.spell        = s;
                        }));
                        abilities.Add(spell_like);
                    }
                }
            }

            var wrapper = Common.createVariantWrapper($"TwinnedSpellLike{spell_level}Ability", "", abilities.ToArray());

            wrapper.SetNameDescriptionIcon(display_name + " " + Common.roman_id[spell_level], description, icon);
            var feature = Common.AbilityToFeature(wrapper, hide);

            feature.SetName(display_name);

            if (spell_level == 1)
            {
                feature.AddComponent(resource.CreateAddAbilityResource());
            }
            var ac_feature = Common.createAddFeatToAnimalCompanion(feature, "");

            if (hide)
            {
                ac_feature.HideInUI = true;
                ac_feature.HideInCharacterSheetAndLevelUp = true;
            }
            return(ac_feature);
        }
Exemplo n.º 4
0
        static void createBombs()
        {
            var smoke_bomb_ability = library.CopyAndAdd(NewSpells.obscuring_mist, "NinjaSmokeBombAbility", "");

            smoke_bomb_ability.RemoveComponents <SpellListComponent>();
            smoke_bomb_ability.RemoveComponents <ContextRankConfig>();
            smoke_bomb_ability.Type = AbilityType.Extraordinary;
            smoke_bomb_ability.AvailableMetamagic = 0;
            smoke_bomb_ability.Animation          = Kingmaker.Visual.Animation.Kingmaker.Actions.UnitAnimationActionCastSpell.CastAnimationStyle.Thrown;
            smoke_bomb_ability.AnimationStyle     = Kingmaker.View.Animation.CastAnimationStyle.CastActionThrown;
            smoke_bomb_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(Common.changeAction <ContextActionSpawnAreaEffect>(a.Actions.Actions, s => { s.AreaEffect = NewSpells.obscuring_mist_area; s.DurationValue = Helpers.CreateContextDuration(1, DurationRate.Minutes); })));
            smoke_bomb_ability.LocalizedDuration = Helpers.oneMinuteDuration;
            smoke_bomb_ability.Range             = AbilityRange.Close;
            smoke_bomb_ability.AddComponent(Common.createContextCalculateAbilityParamsBasedOnClass(getRogueArray()[0], StatType.Charisma));
            smoke_bomb_ability.AddComponent(ki_resource.CreateResourceLogic());
            smoke_bomb_ability.SetNameDescription("Smoke Bomb",
                                                  "This ability allows a ninja to throw a smoke bomb that creates a cloud of smoke with a 20 - foot radius. This acts like a fog cloud spell with duration of 1 minute. Using this ability is a standard action. Each use of this ability uses up 1 ki point.");
            smoke_bomb_ability.AddComponent(ki_resource.CreateAddAbilityResource());
            smoke_bomb = Common.AbilityToFeature(smoke_bomb_ability, false);


            var chocking_bomb_ability = library.CopyAndAdd(smoke_bomb_ability, "NinjaNausetingBombAbility", "");
            var chocking_bomb_area    = library.CopyAndAdd <BlueprintAbilityAreaEffect>(NewSpells.obscuring_mist_area, "ChockingBombArea", "");
            var staggered_buff        = library.Get <BlueprintBuff>("df3950af5a783bd4d91ab73eb8fa0fd3");
            var apply_buff            = Helpers.CreateConditionalSaved(null, Common.createContextActionApplyBuff(staggered_buff, Helpers.CreateContextDuration(0, DurationRate.Rounds, DiceType.D4, 1), dispellable: false));

            var apply_buff_saved = Helpers.CreateConditional(Common.createContextConditionHasFact(staggered_buff), null,
                                                             Common.createContextActionSavingThrow(SavingThrowType.Fortitude, Helpers.CreateActionList(apply_buff)));
            var chocking_bomb_action = Helpers.Create <NewMechanics.AbilityAreaEffectRunActionWithFirstRound>(a =>
            {
                a.UnitEnter  = Helpers.CreateActionList(apply_buff_saved);
                a.Round      = Helpers.CreateActionList(apply_buff_saved);
                a.FirstRound = Helpers.CreateActionList(apply_buff_saved);
            });

            chocking_bomb_area.AddComponent(chocking_bomb_action);
            chocking_bomb_area.Fx = library.Get <BlueprintAbilityAreaEffect>("aa2e0a0fe89693f4e9205fd52c5ba3e5").Fx;  //stinking cloud
            chocking_bomb_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(Common.changeAction <ContextActionSpawnAreaEffect>(a.Actions.Actions, s => { s.AreaEffect = chocking_bomb_area; s.DurationValue = Helpers.CreateContextDuration(1, DurationRate.Minutes); })));
            chocking_bomb_ability.SetNameDescriptionIcon("Chocking Bomb",
                                                         "Whenever a ninja throws a smoke bomb, all living creatures in the resulting cloud must make a Fortitude save or become staggered by the choking black smoke for 1d4 rounds. The DC of this saving throw is equal to 10 + 1/2 the ninja’s level + the ninja’s Charisma modifier.",
                                                         staggered_buff.Icon);
            chocking_bomb = Common.AbilityToFeature(chocking_bomb_ability, false);
            chocking_bomb.AddComponent(Helpers.PrerequisiteFeature(smoke_bomb));


            var blinding_bomb_ability = library.CopyAndAdd(smoke_bomb_ability, "NinjaBlindingBombAbility", "");
            var blinding_bomb_area    = library.CopyAndAdd <BlueprintAbilityAreaEffect>(NewSpells.obscuring_mist_area, "BlindingBombArea", "");
            var blind_buff            = library.Get <BlueprintBuff>("187f88d96a0ef464280706b63635f2af");
            var apply_buff2           = Helpers.CreateConditionalSaved(null, Common.createContextActionApplyBuff(blind_buff, Helpers.CreateContextDuration(0, DurationRate.Rounds, DiceType.D4, 1), dispellable: false));

            var apply_buff_saved2 = Helpers.CreateConditional(Common.createContextConditionHasFact(blind_buff), null,
                                                              Common.createContextActionSavingThrow(SavingThrowType.Fortitude, Helpers.CreateActionList(apply_buff2)));
            var blinding_bomb_action = Helpers.Create <NewMechanics.AbilityAreaEffectRunActionWithFirstRound>(a =>
            {
                a.UnitEnter  = Helpers.CreateActionList(apply_buff_saved2);
                a.Round      = Helpers.CreateActionList(apply_buff_saved2);
                a.FirstRound = Helpers.CreateActionList(apply_buff_saved2);
            });

            blinding_bomb_area.AddComponent(blinding_bomb_action);
            blinding_bomb_area.Fx = library.Get <BlueprintAbilityAreaEffect>("aa2e0a0fe89693f4e9205fd52c5ba3e5").Fx;  //stinking cloud
            blinding_bomb_ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions = Helpers.CreateActionList(Common.changeAction <ContextActionSpawnAreaEffect>(a.Actions.Actions, s => { s.AreaEffect = blinding_bomb_area; s.DurationValue = Helpers.CreateContextDuration(1, DurationRate.Minutes); })));
            blinding_bomb_ability.SetNameDescriptionIcon("Blinding Bomb",
                                                         "Whenever the ninja throws a smoke bomb, all living creatures in the cloud must make a Fortitude save or be blinded by the black smoke for 1d4 rounds. The DC of this saving throw is equal to 10 + 1/2 the ninja’s level + the ninja’s Charisma modifier.",
                                                         Helpers.GetIcon("bd05918a568c41e49aed7b9526ba596b") //blinding bomb
                                                         );
            blinding_bomb = Common.AbilityToFeature(blinding_bomb_ability, false);
            blinding_bomb.AddComponents(Helpers.PrerequisiteFeature(smoke_bomb), Helpers.PrerequisiteFeature(chocking_bomb));
        }
        private static List <BlueprintFeature> AddWarriorSpirit()
        {
            BlueprintItemEnchantment[] defaultEnchantments = new BlueprintItemEnchantment[]
            {
                library.Get <BlueprintItemEnchantment>("d704f90f54f813043a525f304f6c0050"),
                library.Get <BlueprintItemEnchantment>("9e9bab3020ec5f64499e007880b37e52"),
                library.Get <BlueprintItemEnchantment>("d072b841ba0668846adeb007f623bd6c"),
                library.Get <BlueprintItemEnchantment>("6a6a0901d799ceb49b33d4851ff72132"),
                library.Get <BlueprintItemEnchantment>("746ee366e50611146821d61e391edf16")
            };

            BlueprintActivatableAbility[] MagusFacts = new BlueprintActivatableAbility[]
            {
                library.Get <BlueprintActivatableAbility>("05b7cbe45b1444a4f8bf4570fb2c0208"),
                library.Get <BlueprintActivatableAbility>("b338e43a8f81a2f43a73a4ae676353a5"),
                library.Get <BlueprintActivatableAbility>("a3a9e9a2f909cd74e9aee7788a7ec0c6"),
                library.Get <BlueprintActivatableAbility>("24fe1f546e07987418557837b0e0f8f5"),
                library.Get <BlueprintActivatableAbility>("85742dd6788c6914f96ddc4628b23932")
            };
            BlueprintActivatableAbility[] facts = new BlueprintActivatableAbility[MagusFacts.Length];

            for (int i = 0; i < MagusFacts.Length; i++)
            {
                BlueprintActivatableAbility magusAbility = MagusFacts[i];
                BlueprintActivatableAbility temp         = library.CopyAndAdd(magusAbility, magusAbility.Name, Helpers.getGuid(magusAbility.AssetGuid + "WarriorSpirit"));
                temp.AddComponent(Helpers.Create <ActivatableAbilityGroupSizeRestriction>(x =>
                {
                    x.EnchantPool        = EnchantPoolType.ArcanePool;
                    x.ActivatableAbility = temp;
                }));
                facts[i] = temp;
            }

            ContextDurationValue contextDurationValue = Helpers.CreateContextDuration(rate: DurationRate.Minutes, bonus: 1);

            BlueprintAbility         arcaneWeaponSwitchAbility = library.Get <BlueprintAbility>("3c89dfc82c2a3f646808ea250eb91b91");
            BlueprintAbilityResource arcanePoolResourse        = library.Get <BlueprintAbilityResource>("effc3e386331f864e9e06d19dc218b37");


            var divineFavor = library.Get <BlueprintAbility>("9d5d2d3ffdd73c648af3eb3e585b1113");

            List <BlueprintFeature> features = new List <BlueprintFeature>();

            foreach (var weaponTraining in _weaponTrainingBluePrints)
            {
                string weaponTrainingName        = getWeaponTrainingName(weaponTraining, true);
                string weaponTrainingDisplayName = getWeaponTrainingName(weaponTraining);

                BlueprintAbilityResource resource = Helpers.Create <WarriorSpiritPoolLogic>(x => x.WeaponTraining = weaponTraining);
                resource.name                 = "WarriorSpiritResource" + weaponTrainingName;
                resource.LocalizedName        = Helpers.CreateString("WarriorSpiritResource.Name", "Warrior Spirit Resource (" + weaponTrainingDisplayName + ")");
                resource.LocalizedDescription = Helpers.CreateString("WarriorSpiritResource.Name", "Each day, he designates one such weapon and gains a number of points of spiritual energy equal to 1 + his weapon training bonus.");
                resource.SetIcon(arcaneWeaponSwitchAbility.Icon);

                Traverse traverseOne = Traverse.Create(arcanePoolResourse);
                Traverse traverseTwo = Traverse.Create(resource);
                traverseTwo.Field("m_MaxAmount").SetValue(traverseOne.Field("m_MaxAmount").GetValue());

                Main.library.AddAsset(resource, Helpers.getGuid("WarriorSpiritResource" + weaponTrainingName));

                ContextActionWeaponEnchantPoolWarriorSpirit contextActionWeaponEnchantPool = Helpers.Create <ContextActionWeaponEnchantPoolWarriorSpirit>();
                contextActionWeaponEnchantPool.DurationValue       = contextDurationValue;
                contextActionWeaponEnchantPool.EnchantPool         = EnchantPoolType.ArcanePool;
                contextActionWeaponEnchantPool.Group               = ActivatableAbilityGroup.ArcaneWeaponProperty;
                contextActionWeaponEnchantPool.DefaultEnchantments = defaultEnchantments;
                contextActionWeaponEnchantPool.Feature             = weaponTraining;


                BlueprintAbility warriorSpiritSwitchAbility = Helpers.CreateAbility(
                    "WarriorSpiritSwitchAbility" + weaponTrainingName,
                    "Warrior Spirit " + getWeaponTrainingName(weaponTraining),
                    "The fighter can forge a spiritual bond with a weapon that belongs to the associated weapon group, allowing him to unlock the weapon’s potential. Each day, he designates one such weapon and gains a number of points of spiritual energy equal to 1 + his weapon training bonus. While wielding this weapon, he can spend 1 point of spiritual energy to grant the weapon an enhancement bonus equal to his weapon training bonus. Enhancement bonuses gained by this advanced weapon training option stack with those of the weapon, to a maximum of +5. The fighter can also imbue the weapon with any one weapon special ability with an equivalent enhancement bonus less than or equal to his maximum bonus by reducing the granted enhancement bonus by the amount of the equivalent enhancement bonus. The item must have an enhancement bonus of at least +1 (from the item itself or from warrior spirit) to gain a weapon special ability. In either case, these bonuses last for 1 minute.",
                    Helpers.getGuid("WarriorSpiritSwitchAbility" + weaponTrainingName),
                    arcaneWeaponSwitchAbility.Icon,
                    AbilityType.Supernatural,
                    arcaneWeaponSwitchAbility.ActionType,
                    arcaneWeaponSwitchAbility.Range,
                    "1 min",
                    arcaneWeaponSwitchAbility.LocalizedSavingThrow,
                    divineFavor.GetComponent <AbilitySpawnFx>(), // TODO!!!!!
                    Helpers.CreateContextRankConfig(
                        ContextRankBaseValueType.FeatureRank,
                        ContextRankProgression.AsIs,
                        AbilityRankType.Default,
                        feature: weaponTraining),
                    Helpers.CreateRunActions(contextActionWeaponEnchantPool),
                    Helpers.Create <AbilityResourceLogic>(x =>
                {
                    x.Amount           = 1;
                    x.RequiredResource = resource;
                    x.IsSpendResource  = true;
                    x.CostIsCustom     = false;
                })
                    );

                features.Add(Helpers.CreateFeature(
                                 "WarriorSpiritFeature" + weaponTrainingName,
                                 "Warrior Spirit (" + weaponTrainingDisplayName + ")",
                                 "The fighter can forge a spiritual bond with a weapon that belongs to the associated weapon group, allowing him to unlock the weapon’s potential. Each day, he designates one such weapon and gains a number of points of spiritual energy equal to 1 + his weapon training bonus. While wielding this weapon, he can spend 1 point of spiritual energy to grant the weapon an enhancement bonus equal to his weapon training bonus. Enhancement bonuses gained by this advanced weapon training option stack with those of the weapon, to a maximum of +5. The fighter can also imbue the weapon with any one weapon special ability with an equivalent enhancement bonus less than or equal to his maximum bonus by reducing the granted enhancement bonus by the amount of the equivalent enhancement bonus. The item must have an enhancement bonus of at least +1 (from the item itself or from warrior spirit) to gain a weapon special ability. In either case, these bonuses last for 1 minute.",
                                 Helpers.getGuid("WarriorSpiritFeature" + weaponTrainingName),
                                 arcaneWeaponSwitchAbility.Icon,
                                 FeatureGroup.CombatFeat,
                                 warriorSpiritSwitchAbility.CreateAddFact(),
                                 resource.CreateAddAbilityResource(),
                                 Helpers.CreateAddFacts(facts),
                                 weaponTraining.PrerequisiteFeature(),
                                 Helpers.Create <IncreaseActivatableAbilityGroupSizeBaseOnFeatureRanks>(x =>
                {
                    x.Group   = ActivatableAbilityGroup.ArcaneWeaponProperty;
                    x.Feature = weaponTraining;
                })
                                 ));
            }

            return(features);
        }
        public static void Load()
        {
            BlueprintCharacterClass inquisitor            = library.Get <BlueprintCharacterClass>("f1a70d9e1b0b41e49874e1fa9052a1ce"); // Inquisitor
            BlueprintProgression    inquisitorProgression = library.Get <BlueprintProgression>("4e945c2fe5e252f4ea61eee7fb560017");    // InquisitorProgression

            livingGrimoire = Helpers.Create <BlueprintArchetype>(l =>
            {
                l.name                 = "LivingGrimoireArchetype";
                l.LocalizedName        = Helpers.CreateString("LivingGrimoire.Name", "Living Grimoire");
                l.LocalizedDescription = Helpers.CreateString("LivingGrimoire.Description", "The living grimoire literally wields the sacred word of his deity, using his holy tome to smite the foes of his god with divine might. Unlike most inquisitors, a living grimoire focuses on careful study of divine scripture, valuing knowledge over intuition.");
            });

            livingGrimoireArray = new BlueprintArchetype[] { livingGrimoire };
            library.AddAsset(livingGrimoire, Helpers.getGuid("LivingGrimoireArchetype"));
            livingGrimoire.SetIcon(inquisitor.Icon);
            livingGrimoire.BaseAttackBonus = inquisitor.BaseAttackBonus;
            livingGrimoire.FortitudeSave   = inquisitor.FortitudeSave;
            livingGrimoire.ReflexSave      = inquisitor.ReflexSave;
            livingGrimoire.WillSave        = inquisitor.WillSave;

            Helpers.SetField(livingGrimoire, "m_ParentClass", inquisitor);

            livingGrimoire.LocalizedName = Helpers.CreateString("LivingGrimoire.Name", "Living Grimoire");

            BlueprintSpellbook MagusSpellbook      = library.Get <BlueprintSpellbook>("5d8d04e76dff6c5439de99af0d57be63"); // MagusSpellbook
            BlueprintSpellbook InquisitorSpellbook = library.Get <BlueprintSpellbook>("57fab75111f377248810ece84193a5a5"); // InquisitorSpellbook
            BlueprintSpellbook spellbook           = Helpers.Create <BlueprintSpellbook>();

            spellbook.name = "LivingGrimoireSpellbook";
            library.AddAsset(spellbook, Helpers.getGuid("LivingGrimoireSpellbook"));
            spellbook.Name             = livingGrimoire.LocalizedName;
            spellbook.SpellsPerDay     = MagusSpellbook.SpellsPerDay;
            spellbook.SpellList        = InquisitorSpellbook.SpellList;
            spellbook.CharacterClass   = inquisitor;
            spellbook.CastingAttribute = StatType.Intelligence;
            spellbook.Spontaneous      = false;
            spellbook.SpellsPerLevel   = 2;
            spellbook.AllSpellsKnown   = false;
            spellbook.CanCopyScrolls   = true;
            spellbook.IsArcane         = false;
            spellbook.CantripsType     = CantripsType.Orisions;


            livingGrimoire.ReplaceSpellbook = spellbook;

            BlueprintItem[] items = new BlueprintItem[]
            {
                (BlueprintItem)((IList <BlueprintCategoryDefaults.CategoryDefaultEntry>)Game.Instance.BlueprintRoot.Progression.CategoryDefaults.Entries).FirstOrDefault <BlueprintCategoryDefaults.CategoryDefaultEntry>((Func <BlueprintCategoryDefaults.CategoryDefaultEntry, bool>)(p => p.Key == WeaponCategory.LightMace))?.DefaultWeapon,
                library.Get <BlueprintItem>("f4cef3ba1a15b0f4fa7fd66b602ff32b"),
                library.Get <BlueprintItem>("d7963e1fcf260c148877afd3252dbc91"),
                library.Get <BlueprintItem>("ec619484fb1a13441b30f6d08e1c5b6f")
            };

            livingGrimoire.StartingItems = items;


            BlueprintFeature HolyBookFeature = Helpers.CreateFeature(
                "HolyBook",
                "Holy Book",
                "At 1st level, a living grimoire forms a supernatural bond with a large ironbound tome containing the holy text of his deity and learns to use it as a weapon.\n When wielding the holy book as a weapon, he deals base damage as if it were a cold iron light mace(but see Sacred Word below), is considered proficient with the book, takes no improvised weapon penalty, and gains a + 1 bonus on attack rolls with the book.The tome serves as his holy symbol and divine focus, and can be enchanted as a magic weapon. \nHe can replace his bonded tome with another book at any time, though he must perform a 24 - hour binding ritual to attune himself to the new book. \n Dev note: This ability works with all light maces.",
                Helpers.getGuid("HolyBook"),
                null,
                FeatureGroup.None,
                Helpers.Create <HolyBookLogic>()
                );

            BlueprintFeature SacredWordFeature = Helpers.CreateFeature(
                "SacredWord",
                "Sacred Word",
                "At 1st (level, a living grimoire learns to charge his holy book with the power of his faith. The inquisitor gains the benefits of the warpriest’s sacred weapon class ability, but the benefits apply only to his bonded holy book. Like a warpriest’s sacred weapon, the living grimoire’s book deals damage based on the inquisitor’s level, not the book’s base damage (unless the inquisitor chooses to use the book’s base damage).\nAt 4th level, the living grimoire gains the ability to enhance his holy book with divine power as a swift action.This ability grants the holy book a + 1 enhancement bonus.For every 4 inquisitor levels the living grimoire has beyond 4th, this bonus increases by 1(to a maximum of + 5 at 20th level).\nThese bonuses stack with any existing bonuses the holy book might have, to a maximum of + 5.The living grimoire can enhance his holy book to have any of the special abilities listed in the warpriest’s sacred weapon ability, subject to the same alignment restrictions, but adds bane to the general special ability list.Adding any of these special abilities to the holy book consumes an amount of enhancement bonus equal to the special ability’s base price modifier.The holy book must have at least a + 1 enhancement bonus before the living grimoire can add any special abilities to it.The living grimoire can use this ability a number of rounds per day equal to his inquisitor level, but these rounds don’t need to be consecutive.As with the warpriest sacred weapon ability, he determines the enhancement bonus and special abilities the first time he uses the ability each day, and they cannot be changed until the next day. \nThis ability replaces judgment.\n Dev note: This ability works with all light maces.",
                Helpers.getGuid("SacredWordFeature"),
                null,
                FeatureGroup.None,
                Helpers.Create <FocusedWeaponLogic>(x =>
            {
                x.Category = WeaponCategory.LightMace;
                x.Class    = inquisitor;
            })
                );

            BlueprintFeature SacredWordFeature1d8 = Helpers.CreateFeature(
                "SacredWord_1d8",
                "Sacred Word 1d8",
                "The damage of your holy book (light maces) increases to 1d8.",
                Helpers.getGuid("SacredWord_1d8"),
                null,
                FeatureGroup.None
                );

            BlueprintFeature SacredWordFeature1d10 = Helpers.CreateFeature(
                "SacredWord_1d10",
                "Sacred Word 1d10",
                "The damage of your holy book (light maces) increases to 1d10.",
                Helpers.getGuid("SacredWord_1d10"),
                null,
                FeatureGroup.None
                );

            BlueprintFeature SacredWordFeature2d6 = Helpers.CreateFeature(
                "SacredWord_2d6",
                "Sacred Word 2d6",
                "The damage of your holy book (light maces) increases to 2d6.",
                Helpers.getGuid("SacredWord_2d6"),
                null,
                FeatureGroup.None
                );

            BlueprintFeature SacredWordFeature2d8 = Helpers.CreateFeature(
                "SacredWord_2d8",
                "Sacred Word 2d8",
                "The damage of your holy book (light maces) increases to 2d8.",
                Helpers.getGuid("SacredWord_2d8"),
                null,
                FeatureGroup.None
                );


            BlueprintBuff InspireCourageBuff = library.Get <BlueprintBuff>("b4027a834204042409248889cc8abf67");
            BlueprintActivatableAbility InspireCourageToggleAbility = library.Get <BlueprintActivatableAbility>("5250fe10c377fdb49be449dfe050ba70"); // InspireCourageToggleAbility

            BlueprintItemEnchantment[] defaultEnchantments = new BlueprintItemEnchantment[]
            {
                library.Get <BlueprintItemEnchantment>("d704f90f54f813043a525f304f6c0050"),
                library.Get <BlueprintItemEnchantment>("9e9bab3020ec5f64499e007880b37e52"),
                library.Get <BlueprintItemEnchantment>("d072b841ba0668846adeb007f623bd6c"),
                library.Get <BlueprintItemEnchantment>("6a6a0901d799ceb49b33d4851ff72132"),
                library.Get <BlueprintItemEnchantment>("746ee366e50611146821d61e391edf16")
            };

            BlueprintBuff SacredWordBuff = Helpers.CreateBuff(
                "SacredWordBuff",
                "Sacred Word",
                "",
                Helpers.getGuid("SacredWordBuff"),
                null,
                InspireCourageBuff.FxOnStart,
                Helpers.Create <AddSacredWordBonus>(x =>
            {
                x.DefaultEnchantments = defaultEnchantments;
                x.DurationValue       = Helpers.CreateContextDuration(rate: DurationRate.Rounds, bonus: 1);
                x.Group       = ActivatableAbilityGroup.DivineWeaponProperty;
                x.EnchantPool = EnchantPoolType.DivineWeaponBond;
            })
                );

            BlueprintAbilityResource abilityResource = Helpers.CreateAbilityResource(
                "SacredWordResource",
                "Sacred Word Resource",
                "",
                Helpers.getGuid("SacredWordResource"),
                null
                );

            abilityResource.SetIncreasedByLevel(1, 1, new BlueprintCharacterClass[] { inquisitor });

            BlueprintAbility            WeaponBondSwitchAbility = library.Get <BlueprintAbility>("7ff088ab58c69854b82ea95c2b0e35b4"); //WeaponBondSwitchAbility
            BlueprintActivatableAbility SacredWordToggleAbility = Helpers.CreateActivatableAbility(
                "SacredWordSwitchAbility",
                "Sacred Word",
                "",
                Helpers.getGuid("SacredWordSwitchAbility"),
                WeaponBondSwitchAbility.Icon,
                SacredWordBuff,
                AbilityActivationType.WithUnitCommand,
                UnitCommand.CommandType.Swift,
                InspireCourageToggleAbility.ActivateWithUnitAnimation,
                abilityResource.CreateActivatableResourceLogic(ActivatableAbilityResourceLogic.ResourceSpendType.NewRound)
                );

            SacredWordToggleAbility.DeactivateIfCombatEnded   = true;
            SacredWordToggleAbility.DeactivateIfOwnerDisabled = true;


            BlueprintActivatableAbility SacredWordFrost      = library.CopyAndAdd <BlueprintActivatableAbility>("b338e43a8f81a2f43a73a4ae676353a5", "SacredWordFrost", Helpers.getGuid("SacredWordFrost"));           // ArcaneWeaponFrostChoice
            BlueprintActivatableAbility SacredWordShock      = library.CopyAndAdd <BlueprintActivatableAbility>("a3a9e9a2f909cd74e9aee7788a7ec0c6", "SacredWordShock", Helpers.getGuid("SacredWordShock"));           // ArcaneWeaponShockChoice
            BlueprintActivatableAbility SacredWordAnarchic   = library.CopyAndAdd <BlueprintActivatableAbility>("8ed07b0cc56223c46953348f849f3309", "SacredWordAnarchic", Helpers.getGuid("SacredWordAnarchic"));     // ArcaneWeaponAnarchicChoice
            BlueprintActivatableAbility SacredWordGhostTouch = library.CopyAndAdd <BlueprintActivatableAbility>("688d42200cbb2334c8e27191c123d18f", "SacredWordGhostTouch", Helpers.getGuid("SacredWordGhostTouch")); // ArcaneWeaponGhostTouchChoice
            BlueprintActivatableAbility SacredWordUnholy     = library.CopyAndAdd <BlueprintActivatableAbility>("561803a819460f34ea1fe079edabecce", "SacredWordUnholy", Helpers.getGuid("SacredWordUnholy"));         // ArcaneWeaponUnholyChoice
            BlueprintActivatableAbility SacredWordBane       = library.CopyAndAdd <BlueprintActivatableAbility>("3a909d1effa3bbc4084f2b5ac95f5306", "SacredWordBane", Helpers.getGuid("SacredWordBane"));             // ArcaneWeaponUnholyChoice

            SacredWordFrost.Group        = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordShock.Group        = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordAnarchic.Group     = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordGhostTouch.Group   = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordUnholy.Group       = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordBane.Group         = ActivatableAbilityGroup.DivineWeaponProperty;
            SacredWordBane.WeightInGroup = 1;



            BlueprintFeature SacredWordFeatureLevel4 = Helpers.CreateFeature(
                "SacredWord_FeatureLevel4",
                "Sacred Word",
                "At 4th level, the living grimoire gains the ability to enhance his holy book with divine power as a swift action.This ability grants the holy book a + 1 enhancement bonus.For every 4 inquisitor levels the living grimoire has beyond 4th, this bonus increases by 1(to a maximum of + 5 at 20th level).\nThese bonuses stack with any existing bonuses the holy book might have, to a maximum of + 5.The living grimoire can enhance his holy book to have any of the special abilities listed in the warpriest’s sacred weapon ability, subject to the same alignment restrictions, but adds bane to the general special ability list.Adding any of these special abilities to the holy book consumes an amount of enhancement bonus equal to the special ability’s base price modifier.The holy book must have at least a + 1 enhancement bonus before the living grimoire can add any special abilities to it.The living grimoire can use this ability a number of rounds per day equal to his inquisitor level, but these rounds don’t need to be consecutive.As with the warpriest sacred weapon ability, he determines the enhancement bonus and special abilities the first time he uses the ability each day, and they cannot be changed until the next day. \nThis ability replaces judgment.\n Dev note: This ability works with all light maces.",
                Helpers.getGuid("SacredWord_FeatureLevel4"),
                null,
                FeatureGroup.None,
                Helpers.CreateAddFacts(new BlueprintUnitFact[]
            {
                SacredWordToggleAbility,
                library.Get <BlueprintActivatableAbility>("7902941ef70a0dc44bcfc174d6193386"),    //WeaponBondFlamingChoice
                library.Get <BlueprintActivatableAbility>("27d76f1afda08a64d897cc81201b5218"),    //WeaponBondKeenChoice
                SacredWordFrost,
                SacredWordShock,
                SacredWordGhostTouch,
            }),
                Helpers.Create <AddAbilityResources>(x =>
            {
                x.UseThisAsResource = false;
                x.Resource          = library.Get <BlueprintAbilityResource>("3683d1af071c1744185ff93cba9db10b"); // WeaponBondResourse
                x.Amount            = 0;
                x.RestoreAmount     = true;
                x.RestoreOnLevelUp  = false;
            }),
                abilityResource.CreateAddAbilityResource(),
                Helpers.Create <IncreaseResourcesByClass>(x =>
            {
                x.CharacterClass = inquisitor;
                x.Resource       = abilityResource;
                x.BaseValue      = 1;
            })

                );

            BlueprintFeature SacredWordPlus2 = Helpers.CreateFeature(
                "SacredWord_Plus2",
                "Sacred Word",
                "Increases the enchantment bonus from Sacred Word by 1. Adds the enchantments Anarchic, Axiomatic, Disruption, Holy, Unholy",
                Helpers.getGuid("SacredWord_Plus2"),
                null,
                FeatureGroup.None,
                Helpers.Create <IncreaseActivatableAbilityGroupSize>(x => x.Group = ActivatableAbilityGroup.DivineWeaponProperty),
                Helpers.CreateAddFacts(new BlueprintUnitFact[]
            {
                library.Get <BlueprintActivatableAbility>("d76e8a80ab14ac942b6a9b8aaa5860b1"),    //WeaponBondAxiomaticChoice
                library.Get <BlueprintActivatableAbility>("ce0ece459ebed9941bb096f559f36fa8"),    //WeaponBondHolyChoice
                library.Get <BlueprintActivatableAbility>("8c714fbd564461e4588330aeed2fbe1d"),    //WeaponBondDisruptionChoice
                SacredWordAnarchic,
                SacredWordUnholy,
                SacredWordBane
            }));

            BlueprintFeature SacredWordPlus3 = Helpers.CreateFeature(
                "SacredWord_Plus3",
                "Sacred Word",
                "Increases the enchantment bonus from Sacred Word by 1.",
                Helpers.getGuid("SacredWord_Plus3"),
                null,
                FeatureGroup.None,
                Helpers.Create <IncreaseActivatableAbilityGroupSize>(x => x.Group = ActivatableAbilityGroup.DivineWeaponProperty)
                );

            BlueprintFeature SacredWordPlus4 = Helpers.CreateFeature(
                "SacredWord_Plus4",
                "Sacred Word",
                "Increases the enchantment bonus from Sacred Word by 1. Adds the enchantment Brilliant Energy",
                Helpers.getGuid("SacredWord_Plus4"),
                null,
                FeatureGroup.None,
                Helpers.Create <IncreaseActivatableAbilityGroupSize>(x => x.Group = ActivatableAbilityGroup.DivineWeaponProperty),
                Helpers.CreateAddFacts(new BlueprintUnitFact[]
            {
                library.Get <BlueprintActivatableAbility>("f1eec5cc68099384cbfc6964049b24fa"),    //WeaponBondBrilliantEnergyChoice
            }));

            BlueprintFeature SacredWordPlus5 = Helpers.CreateFeature(
                "SacredWord_Plus5",
                "Sacred Word",
                "Increases the enchantment bonus from Sacred Word by 1.",
                Helpers.getGuid("SacredWord_Plus5"),
                null,
                FeatureGroup.None,
                Helpers.Create <IncreaseActivatableAbilityGroupSize>(x => x.Group = ActivatableAbilityGroup.DivineWeaponProperty)
                );

            BlueprintFeatureSelection BlessedScriptSelection = Helpers.CreateFeatureSelection(
                "BlessedScript",
                "Blessed Script",
                "At 5th level, a living grimoire can permanently tattoo one spell of 2nd level or lower from his holy book onto his body. The tattooed spell cannot have an expensive material component or focus. The living grimoire can cast his tattooed spells as a spell-like ability once per day.",
                Helpers.getGuid("BlessedScript"),
                null,
                FeatureGroup.None
                );

            List <BlueprintFeatureSelection> BlessedScriptSpellLevelSelection = new List <BlueprintFeatureSelection>();

            for (int i = 1; i < 7; i++)
            {
                BlueprintFeatureSelection BlessedScriptSpellSelection = Helpers.CreateFeatureSelection(
                    "BlessedScriptLevel" + (i),
                    "Blessed Script Level " + (i),
                    "At 5th level, a living grimoire can permanently tattoo one spell of 2nd level or lower from his holy book onto his body. The tattooed spell cannot have an expensive material component or focus. The living grimoire can cast his tattooed spells as a spell-like ability once per day.",
                    Helpers.getGuid("BlessedScriptLevel" + (i)),
                    null,
                    FeatureGroup.None,
                    inquisitor.PrerequisiteClassLevel((i - 1) * 4)
                    );
                List <BlueprintFeature> SpellSelection = new List <BlueprintFeature>();
                foreach (BlueprintAbility Spell in InquisitorSpellbook.SpellList.GetSpells(i))
                {
                    if (Spell.MaterialComponent.Item != null)
                    {
                        continue;
                    }

                    BlueprintAbilityResource BlessedScriptAbilityResource = Helpers.CreateAbilityResource(
                        "BlessedScriptAbilityResource" + Spell.name,
                        "",
                        "",
                        Helpers.getGuid("BlessedScriptAbilityResource" + Spell.name),
                        null);
                    BlessedScriptAbilityResource.SetFixedResource(1);


                    BlueprintAbility ability        = library.CopyAndAdd(Spell, "BlessedScriptAbility" + Spell.name, Helpers.getGuid("BlessedScriptAbility" + Spell.name));
                    SpellComponent   spellComponent = ability.GetComponent <SpellComponent>();
                    if (spellComponent != null)
                    {
                        ability.RemoveComponent(spellComponent);
                    }
                    ability.AddComponent(Helpers.Create <AbilityResourceLogic>(x =>
                    {
                        x.Amount           = 1;
                        x.IsSpendResource  = true;
                        x.CostIsCustom     = false;
                        x.RequiredResource = BlessedScriptAbilityResource;
                    }));

                    BlueprintFeature BlessedScriptSpell = Helpers.CreateFeature(
                        "BlessedScript" + Spell.name,
                        "Blessed Script (" + Spell.Name + ")",
                        "You have tattooed the spell \"" + Spell.Name + "\" onto your body. You can  can cast his tattooed spells as a spell-like ability once per day.",
                        Helpers.getGuid("BlessedScript" + Spell.name),
                        null,
                        FeatureGroup.None,
                        Helpers.Create <PrerequisiteKnowsSpell>(x =>
                    {
                        x.Ability        = Spell;
                        x.CharacterClass = inquisitor;
                    }),
                        Helpers.CreateAddFacts(ability),
                        Helpers.CreateAddAbilityResource(BlessedScriptAbilityResource)
                        );
                    BlessedScriptSpell.AddComponent(BlessedScriptSpell.PrerequisiteNoFeature());
                    SpellSelection.Add(BlessedScriptSpell);
                }
                BlessedScriptSpellSelection.SetFeatures(SpellSelection);
                BlessedScriptSpellLevelSelection.Add(BlessedScriptSpellSelection);
            }
            BlessedScriptSelection.SetFeatures(BlessedScriptSpellLevelSelection);


            BlueprintBuff TrueJudgmentCooldownBuff = library.Get <BlueprintBuff>("65058aafc91a12042b158527f9d0506a");

            ContextValue CooldownBuff = new ContextValue();

            CooldownBuff.Value = 24;

            BlueprintAbilityResource WordOfGodAbilityResource = Helpers.CreateAbilityResource(
                "WordOfGodAbilityResource",
                "",
                "",
                Helpers.getGuid("WordOfGodAbilityResource"),
                null);

            WordOfGodAbilityResource.SetFixedResource(7);

            AbilityEffectRunAction   abilityEffectRunAction = Helpers.Create <AbilityEffectRunAction>();
            ContextActionSavingThrow savingThrow            = Helpers.Create <ContextActionSavingThrow>();

            savingThrow.Type = SavingThrowType.Fortitude;

            ContextActionConditionalSaved saved = Helpers.Create <ContextActionConditionalSaved>();

            saved.Succeed = new ActionList
            {
                Actions = new GameAction[]
                {
                    Helpers.Create <ContextActionApplyBuff>(ap =>
                    {
                        ap.Buff          = TrueJudgmentCooldownBuff;
                        ap.DurationValue = Helpers.CreateContextDuration(CooldownBuff, DurationRate.Hours);
                    })
                }
            };
            saved.Failed = new ActionList {
                Actions = new GameAction[] { Helpers.Create <ContextActionKillTarget>() }
            };
            savingThrow.Actions = new ActionList {
                Actions = new GameAction[] { saved }
            };


            Conditional conditional = Helpers.Create <Conditional>();

            conditional.ConditionsChecker = new ConditionsChecker();

            ContextConditionHasBuffFromCaster condition = Helpers.Create <ContextConditionHasBuffFromCaster>();

            condition.Buff = TrueJudgmentCooldownBuff;

            conditional.ConditionsChecker.Conditions = new Condition[] { condition };
            conditional.IfFalse = new ActionList {
                Actions = new GameAction[] { savingThrow }
            };

            abilityEffectRunAction.Actions = new ActionList {
                Actions = new GameAction[] { conditional }
            };

            BlueprintAbility TrueJudgmentAbility = library.Get <BlueprintAbility>("d69715dc0de8f8b44ac9f20188c7c22e");

            BlueprintAbility WordOfGodAbility = Helpers.CreateAbility(
                "WordOfGodAbility",
                "Word of God",
                "At 20th level, a living grimoire can smite his foes with the holy word of his deity. Up to seven times per day, the inquisitor can make a single melee attack with his holy book against a target. If the attack hits, it deals damage normally and the target must succeed at a Fortitude save or die (DC = 10 + 1/2 the living grimoire’s inquisitor level + his Intelligence modifier). Regardless of whether the save is successful, the target creature is immune to the living grimoire’s word of god ability for 24 hours. Once the living grimoire uses this ability, he can’t use it again for 1d4 rounds.\nThis ability replaces true judgment.",
                Helpers.getGuid("WordOfGodAbility"),
                TrueJudgmentAbility.Icon,
                AbilityType.Supernatural,
                UnitCommand.CommandType.Standard,
                AbilityRange.Weapon,
                "Instant",
                "Fortitude",
                abilityEffectRunAction
                ,
                Helpers.Create <AbilityResourceLogic>(x =>
            {
                x.Amount           = 1;
                x.IsSpendResource  = true;
                x.CostIsCustom     = false;
                x.RequiredResource = WordOfGodAbilityResource;
            })
                );

            WordOfGodAbility.CanTargetEnemies = true;
            WordOfGodAbility.CanTargetSelf    = false;

            BlueprintFeature TrueJudgmentFeature = library.Get <BlueprintFeature>("f069b6557a2013544ac3636219186632"); // TrueJudgmentFeature

            BlueprintFeature WordOfGod = Helpers.CreateFeature("WordOfGod",
                                                               "Word of God",
                                                               "At 20th level, a living grimoire can smite his foes with the holy word of his deity. Up to seven times per day, the inquisitor can make a single melee attack with his holy book against a target. If the attack hits, it deals damage normally and the target must succeed at a Fortitude save or die (DC = 10 + 1/2 the living grimoire’s inquisitor level + his Intelligence modifier). Regardless of whether the save is successful, the target creature is immune to the living grimoire’s word of god ability for 24 hours. Once the living grimoire uses this ability, he can’t use it again for 1d4 rounds.\nThis ability replaces true judgment.",
                                                               Helpers.getGuid("WordOfGod"),
                                                               TrueJudgmentFeature.Icon,
                                                               FeatureGroup.None,
                                                               Helpers.CreateAddFacts(WordOfGodAbility),
                                                               Helpers.Create <ReplaceAbilitiesStat>(x =>
            {
                x.Stat    = StatType.Intelligence;
                x.Ability = new BlueprintAbility[] { WordOfGodAbility };
            }),
                                                               Helpers.Create <ReplaceCasterLevelOfAbility>(x =>
            {
                x.Spell = WordOfGodAbility;
                x.Class = inquisitor;
            }),
                                                               WordOfGodAbilityResource.CreateAddAbilityResource()
                                                               );

            List <LevelEntry> addFeatures = new List <LevelEntry>();

            addFeatures.Add(Helpers.LevelEntry(1, HolyBookFeature, SacredWordFeature));
            addFeatures.Add(Helpers.LevelEntry(4, SacredWordFeatureLevel4));
            addFeatures.Add(Helpers.LevelEntry(5, BlessedScriptSelection, SacredWordFeature1d8));
            addFeatures.Add(Helpers.LevelEntry(8, SacredWordPlus2, BlessedScriptSelection));
            addFeatures.Add(Helpers.LevelEntry(10, SacredWordFeature1d10));
            addFeatures.Add(Helpers.LevelEntry(12, SacredWordPlus3, BlessedScriptSelection));
            addFeatures.Add(Helpers.LevelEntry(15, SacredWordFeature2d6));
            addFeatures.Add(Helpers.LevelEntry(16, SacredWordPlus4, BlessedScriptSelection));
            addFeatures.Add(Helpers.LevelEntry(20, SacredWordPlus5, WordOfGod, SacredWordFeature2d8));


            BlueprintFeature JudgmentAdditionalUse = library.Get <BlueprintFeature>("ee50875819478774b8968701893b52f5"); //JudgmentAdditionalUse
            BlueprintFeature SecondJudgment        = library.Get <BlueprintFeature>("33bf0404b70d65f42acac989ec5295b2"); // SecondJudgment
            BlueprintFeature ThirdJudgment         = library.Get <BlueprintFeature>("490c7e92b22cc8a4bb4885a027b355db"); // ThirdJudgment

            List <LevelEntry> removeFeatures = new List <LevelEntry>();

            removeFeatures.Add(Helpers.LevelEntry(1, library.Get <BlueprintFeature>("981def910b98200499c0c8f85a78bde8"))); //JudgmentFeature
            removeFeatures.Add(Helpers.LevelEntry(2, library.Get <BlueprintFeature>("6be8b4031d8b9fc4f879b72b5428f1e0"))); //CunningInitiative
            removeFeatures.Add(Helpers.LevelEntry(4, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(5, library.Get <BlueprintFeature>("7ddf7fbeecbe78342b83171d888028cf"))); //InquisitorBaneNormalFeatureAdd
            removeFeatures.Add(Helpers.LevelEntry(7, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(8, SecondJudgment));
            removeFeatures.Add(Helpers.LevelEntry(10, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(12, library.Get <BlueprintFeature>("6e694114b2f9e0e40a6da5d13736ff33")));//InquisitorBaneGreaterFeature
            removeFeatures.Add(Helpers.LevelEntry(13, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(16, JudgmentAdditionalUse, ThirdJudgment));
            removeFeatures.Add(Helpers.LevelEntry(19, JudgmentAdditionalUse));
            removeFeatures.Add(Helpers.LevelEntry(20, TrueJudgmentFeature));

            livingGrimoire.AddFeatures    = addFeatures.ToArray();
            livingGrimoire.RemoveFeatures = removeFeatures.ToArray();

            UIGroup SacredWordGroup = new UIGroup();

            SacredWordGroup.Features.Add(SacredWordFeature);
            SacredWordGroup.Features.Add(SacredWordFeatureLevel4);
            SacredWordGroup.Features.Add(SacredWordPlus2);
            SacredWordGroup.Features.Add(SacredWordPlus3);
            SacredWordGroup.Features.Add(SacredWordPlus4);
            SacredWordGroup.Features.Add(SacredWordPlus5);
            SacredWordGroup.Features.Add(SacredWordFeature1d8);
            SacredWordGroup.Features.Add(SacredWordFeature1d10);
            SacredWordGroup.Features.Add(SacredWordFeature2d6);
            SacredWordGroup.Features.Add(SacredWordFeature2d8);
            inquisitorProgression.UIGroups = inquisitorProgression.UIGroups.AddToArray(SacredWordGroup);
            UIGroup BlessedScriptGroup = new UIGroup();

            BlessedScriptGroup.Features.Add(BlessedScriptSelection);
            inquisitorProgression.UIGroups = inquisitorProgression.UIGroups.AddToArray(BlessedScriptGroup);

            List <BlueprintArchetype> archetypes = inquisitor.Archetypes.ToList();

            archetypes.Insert(0, livingGrimoire);
            inquisitor.Archetypes = archetypes.ToArray();
        }