public override void Apply(AbilityExecutionContext context, TargetWrapper target) { UnitDescriptor unit = context.MaybeOwner.Descriptor; AbilityData spell = context.Ability.ParamSpellSlot.Spell; Spellbook spellbook = context.Ability.ParamSpellbook; int spellLevel = context.Ability.ParamSpellLevel.Value; if (spellLevel < 1 || spellLevel > spellbook.MaxSpellLevel) { return; } foreach (var slot in spellbook.GetMemorizedSpells(spellLevel)) { if (slot.Spell == spell) { spellbook.ForgetMemorized(slot); } } unit.AddBuff(flagBuff, unit.Unit); UnityModManager.Logger.Log("Rua1?"); FastStudy.RefreshSubAbls(spellbook, spellLevel); UnityModManager.Logger.Log("Rua1?>"); FastStudy.AddMasterAbls(unit); }