static void createSpellbook() { var bard_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f"); var wizard_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("ba34257984f4c41408ce1dc2004e342e"); spellbook = Helpers.Create <BlueprintSpellbook>(); spellbook.name = "ArrowsongMinstrelSpellbook"; library.AddAsset(spellbook, ""); spellbook.Name = Helpers.CreateString("ArrowsongMinstrelSpellbook.Name", "Arrowsong Minstrel"); spellbook.SpellsPerDay = Common.increaseNumSpellsCast("ArrowsongMinstrellSpellPerDay", "", bard_class.Spellbook.SpellsPerDay, -1); spellbook.SpellsKnown = bard_class.Spellbook.SpellsKnown; spellbook.Spontaneous = true; spellbook.IsArcane = true; spellbook.AllSpellsKnown = false; spellbook.CanCopyScrolls = false; spellbook.CastingAttribute = StatType.Charisma; spellbook.CharacterClass = bard_class; spellbook.CasterLevelModifier = 0; spellbook.CantripsType = bard_class.Spellbook.CantripsType; spellbook.SpellList = Helpers.Create <BlueprintSpellList>(); spellbook.SpellList.name = "ArrowsongMinstrelSpellList"; library.AddAsset(spellbook.SpellList, ""); spellbook.SpellList.SpellsByLevel = new SpellLevelList[10]; for (int i = 0; i < spellbook.SpellList.SpellsByLevel.Length; i++) { spellbook.SpellList.SpellsByLevel[i] = new SpellLevelList(i); } spellbook.SpellList.SpellsByLevel[0].SpellLevel = 0; BlueprintAbility[] extra_spells = new BlueprintAbility[] { library.Get <BlueprintAbility>("9f10909f0be1f5141bf1c102041f93d9"), //snow ball library.Get <BlueprintAbility>("3e9d1119d43d07c4c8ba9ebfd1671952"), //gravity bow library.Get <BlueprintAbility>("2c38da66e5a599347ac95b3294acbe00"), //true strike NewSpells.magic_weapon, NewSpells.magic_weapon_greater, library.Get <BlueprintAbility>("c28de1f98a3f432448e52e5d47c73208"), //protection from arrows library.Get <BlueprintAbility>("9a46dfd390f943647ab4395fc997936d"), //acid arrow NewSpells.flame_arrow }; //add ranger spells foreach (var spell_level_list in bard_class.Spellbook.SpellList.SpellsByLevel) { int sp_level = spell_level_list.SpellLevel; foreach (var spell in spell_level_list.Spells) { if (!spell.IsInSpellList(spellbook.SpellList)) { ExtensionMethods.AddToSpellList(spell, spellbook.SpellList, sp_level); } } } //add wizard spells foreach (var spell_level_list in wizard_class.Spellbook.SpellList.SpellsByLevel) { int sp_level = spell_level_list.SpellLevel; if (sp_level > 6) { continue; } foreach (var spell in spell_level_list.Spells) { if (spell.School != SpellSchool.Evocation && !extra_spells.Contains(spell)) { continue; } if (!spell.IsInSpellList(spellbook.SpellList)) { ExtensionMethods.AddToSpellList(spell, spellbook.SpellList, sp_level); } } } }