Scriptname BloodMagicCastScript_CONCEPT extends ReferenceAlias {Uses health instead of magicka to cast spells}Import MathActor Property PlayerRef Auto;INPUT THE PERK THAT APPLIES TO THE COST OF THE SPELLPerk Property AssociatedPerk AutoPerk Property BloodMagicPerk AutoKeyword Property BloodMagicRing Auto;SPELL TO CASTSpell Property MySpell AutoString Property AssociatedSkill Auto;INPUT THE FORTIY MOD example - DestructionModString Property FortSkillMod AutoInt Property BaseMagicCost AutoFloat HealthCostFloat MagicCostFloat PKReductionFloat SklRedFloat FortRedEvent OnSpellCast(Form akSpell) if PlayerRef.HasPerk(BloodMagicPerk) && akSpell == MySpell ;CALL FUNCTIONS PerkReduction(PlayerRef) SkillReduction(PlayerRef) FortifyReduction(PlayerRef) CalcMagCost(PlayerRef) DamageHealth(PlayerRef) endif EndEvent;FUNCTION TO CALCULATE PERK REDUCTION;Example for the FireBolt spell this would be DestructionApprenticeFunction PerkReduction (Actor akCaster) if PlayerRef.HasPerk(AssociatedPerk) PKReduction = 0.5 else PKReduction = 1 endif EndFunction;FORMULA TO CALCULATE MAGIC COST REDUCTION BASED ON SKILL - THIS IS THE FORMULA USED IN GAME;Example - AssociatedSkill for the FireBolt spell would be DestructionFunction SkillReduction (Actor akCaster)Float AssociatedSkillLvl = PlayerRef.GetActorValue(AssociatedSkill)SklRed = pow((AssociatedSkillLvl/400), 0.65)EndFunction;FUNCTION TO CALCULATE COST REDUCTION DUE TO FORTIFY SKILL;Example - For the Firebolt, this would be DestructionModFunction FortifyReduction (Actor akCaster)FortRed = PlayerRef.GetActorValue(FortSkillMod) EndFunction ;FUNCTION TO CALCULATE MAGIC COSTFunction CalcMagCost(Actor akCaster)MagicCost = BaseMagicCost*(1-SklRed)*(PKReduction)*(1-(FortRed/100))EndFunction;FUNCTION TO CALCULATE DAMAGE HEALTH BASED ON MAGIC COST AND IF THE PLAYER IS WEARING THE RINGFunction DamageHealth(Actor akCaster) if PlayerRef.WornHasKeyword(BloodMagicRing) HealthCost = MagicCost/3 debug.notification("Health cost = "+HealthCost) else HealthCost = MagicCost/2 debug.notification("Health cost = "+HealthCost) endif PlayerRef.DamageActorValue("Health", HealthCost)EndFunction