I'm working on a small personal mod for RP purposes where a character can cast a spell to consume magicka and create a custom soul gem out of it. As of right now I have the mod working perfectly. The player can cast a spell causing a menu to show up. Depending on the player's enchanting level a certain number of options show up and each option gives you the appropriate gem.
My problem is that I want to add a custom debuff to each choice. First off I want the spell to consume a certain amount of your magicka depending on what choice you pick except cancel. So picking the Petty version would consume 100 magicka while picking Grand might consume 500 magicka. Second I want a timed debuff put on the player that makes the magicka regen reduced to 0% or 10% (I haven't decided which, but want to add this just so this spell can't be abused in case I release it to the public. I am currently wanting to set it to 0% to stop all regen for the timed debuff.) This timed debuff's duration would change depending on what choice you picked. So picking Petty might make the debuff last a few minutes while picking Grand might make it last a couple of hours.
If I could get any assistance on these I would greatly appreciate it.
Here is my code.
Scriptname CreateEssenceGem extends activemagiceffectMessage Property EssenceMenu0 AutoMessage Property EssenceMenu20 AutoMessage Property EssenceMenu40 AutoMessage Property EssenceMenu60 AutoMessage Property EssenceMenu80 AutoSoulGem Property Petty_Essence_Gem AutoSoulGem Property Lesser_Essence_Gem AutoSoulGem Property Common_Essence_Gem AutoSoulGem Property Greater_Essence_Gem AutoSoulGem Property Grand_Essence_Gem AutoEvent OnEffectStart(Actor akTarget, Actor akCaster) Menu()EndEventFunction Menu(Int aiButton = 0) Float EnchantLevel = game.getPlayer().getAV("Enchanting") If EnchantLevel >= 80 aiButton = EssenceMenu80.show() If aiButton == 0 Game.GetPlayer().Additem(Petty_Essence_Gem,1,False) ElseIf aiButton == 1 Game.GetPlayer().Additem(Lesser_Essence_Gem,1,False) ElseIf aiButton == 2 Game.GetPlayer().Additem(Common_Essence_Gem,1,False) ElseIf aiButton == 3 Game.GetPlayer().Additem(Greater_Essence_Gem,1,False) ElseIf aiButton ==4 Game.GetPlayer().Additem(Grand_Essence_Gem,1,False) ElseIf aiButton == 5 EndIf ElseIf EnchantLevel >= 60 aiButton = EssenceMenu60.show() If aiButton == 0 Game.GetPlayer().Additem(Petty_Essence_Gem,1,False) ElseIf aiButton == 1 Game.GetPlayer().Additem(Lesser_Essence_Gem,1,False) ElseIf aiButton == 2 Game.GetPlayer().Additem(Common_Essence_Gem,1,False) ElseIf aiButton == 3 Game.GetPlayer().Additem(Greater_Essence_Gem,1,False) ElseIf aiButton ==4 EndIf ElseIf EnchantLevel >= 40 aiButton = EssenceMenu40.show() If aiButton == 0 Game.GetPlayer().Additem(Petty_Essence_Gem,1,False) ElseIf aiButton == 1 Game.GetPlayer().Additem(Lesser_Essence_Gem,1,False) ElseIf aiButton == 2 Game.GetPlayer().Additem(Common_Essence_Gem,1,False) ElseIf aiButton == 3 EndIf ElseIf EnchantLevel >= 20 aiButton = EssenceMenu20.show() If aiButton == 0 Game.GetPlayer().Additem(Petty_Essence_Gem,1,False) ElseIf aiButton == 1 Game.GetPlayer().Additem(Lesser_Essence_Gem,1,False) ElseIf aiButton == 2 EndIf ElseIf EnchantLevel >= 0 aiButton = EssenceMenu0.show() If aiButton == 0 Game.GetPlayer().Additem(Petty_Essence_Gem,1,False) ElseIf aiButton == 1 EndIf EndIf