static bool Prefix(SpellSpecializationParametrized __instance, RuleCalculateAbilityParams evt) { var spell = (__instance.Fact as Feature)?.Param.Blueprint as BlueprintAbility; if (SpellDuplicates.isDuplicate(spell, evt.Spell) || SpellDuplicates.isDuplicate(spell, evt.Spell?.Parent)) { evt.AddBonusCasterLevel(2); } return(false); }
public void OnEventAboutToTrigger(RuleCalculateAbilityParams evt) { var spellbook = evt.Spellbook; if (spellbook == null) { return; } int bonus = GetBonus(spellbook); Log.Write($"Increase caster level of {evt.Spell?.name} by {bonus}"); evt.AddBonusCasterLevel(bonus); }
public void OnEventAboutToTrigger(RuleCalculateAbilityParams evt) { spell_level = -1; int cost = 1 + evt.SpellLevel; if (this.resource == null || this.Owner.Resources.GetResourceAmount((BlueprintScriptableObject)this.resource) < cost) { return; } if (evt.Spell == null || evt.Spellbook == null || evt.Spell.Type != AbilityType.Spell) { return; } evt.AddBonusCasterLevel(bonus); evt.AddBonusDC(bonus); current_spell = evt.Spell; spell_level = evt.SpellLevel; }