Scriptname aaaTKCMenuScript extends activemagiceffect  

Message Property aaaTKCMainMenu auto
Message Property aaaTKCDmgMultMenu auto
Message Property aaaTKCCostMultMenu auto
Message Property aaaTKCScriptMenu auto

Quest Property aaaTKCInitQuest auto
Quest Property KeySetQuest auto
aaaTKCInitQuestScript Property QuestScript Auto
aaaTKCKeySetQuest Property KeysetScript Auto

GlobalVariable Property Magnitude auto
GlobalVariable Property CostMult auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
If(akCaster== Game.GetPlayer())	

	int chosenOption = aaaTKCMainMenu.Show()

	If(chosenOption==0)			;DamageMult
		chosenOption=-1
		chosenOption = aaaTKCDmgMultMenu.Show()
		If(chosenOption==0)
			Magnitude.SetValue(0.5)
		ElseIf(chosenOption==1)
			Magnitude.SetValue(0.8)
		ElseIf(chosenOption==2)		
			Magnitude.SetValue(1.0)
		ElseIf(chosenOption==3)		
			Magnitude.SetValue(1.2)
		ElseIf(chosenOption==4)		
			Magnitude.SetValue(1.5)
		ElseIf(chosenOption==5)		
			Magnitude.SetValue(1.8)
		ElseIf(chosenOption==6)		
			Magnitude.SetValue(2.0)
		ElseIf(chosenOption==7)		
			Magnitude.SetValue(2.5)
		ElseIf(chosenOption==8)		
			Magnitude.SetValue(3.0)
		EndIf

	ElseIf (chosenOption==1)		;CostMult
		chosenOption = aaaTKCCostMultMenu.Show()
		If (chosenOption==0)
			CostMult.SetValue(0.5)
		ElseIf(chosenOption==1)
			CostMult.SetValue(0.8)
		ElseIf(chosenOption==2)		
			CostMult.SetValue(1.0)
		ElseIf(chosenOption==3)		
			CostMult.SetValue(1.2)
		ElseIf(chosenOption==4)		
			CostMult.SetValue(1.5)
		ElseIf(chosenOption==5)
			CostMult.SetValue(1.8)
		ElseIf(chosenOption==6)
			CostMult.SetValue(2.0)
		ElseIf(chosenOption==7)
			CostMult.SetValue(2.5)
		ElseIf(chosenOption==8)
			CostMult.SetValue(3.0)
		EndIf

	ElseIf (chosenOption==2)		;keyset
		KeySetQuest.Start()
		KeySetScript.SetUp()

	ElseIf (chosenOption==3)		;Script
		chosenOption = aaaTKCScriptMenu.Show()
		If (chosenOption==0)
			aaaTKCInitQuest.Start()
			QuestScript.RegistKey()
		ElseIf(chosenOption==1)
			aaaTKCInitQuest.Stop()
		ElseIf(chosenOption==2)
			aaaTKCInitQuest.Stop()
			Utility.Wait(0.5)
			aaaTKCInitQuest.Start()
			Utility.Wait(0.5)
			QuestScript.RegistKey()
		EndIf
	EndIf
EndIf

EndEvent


