Scriptname aaaUDMCMScript extends SKI_ConfigBase  


GlobalVariable Property aaaUDDragonHPMult auto
GlobalVariable property aaaUDDiminishReturns auto
GlobalVariable property aaaUDKillMove auto
Quest Property aaaUDInitQuest auto

int ActivateModID
int HPMultID
int DiminishID
int KillMoveID
int		_KillMove			= 100
float	_HPMult				= 3.0
bool	_ActivateMod		= true
bool	_Diminish			= true

Event OnPageReset(string page)

	SetCursorFillMode(TOP_TO_BOTTOM)

	DiminishID		= AddToggleOption("Stagger resist", _Diminish)
	HPMultID		= AddSliderOption("Dragon HPMult", _HPMult, "Health *{1}")
	KillMoveID		= AddSliderOption("KillMove Rate", _KillMove, "{0}%")
	ActivateModID	= AddToggleOption("Active Mod", _ActivateMod)

EndEvent


Event OnOptionSliderOpen(int option)
	if (option == HPMultID)
		SetSliderDialogStartValue(_HPMult)
		SetSliderDialogDefaultValue(3.0)
		SetSliderDialogRange(1.0, 6.0)
		SetSliderDialogInterval(0.1)
	elseif (option == KillMoveID)
		SetSliderDialogStartValue(_KillMove)
		SetSliderDialogDefaultValue(100)
		SetSliderDialogRange(0, 100)
		SetSliderDialogInterval(1)
	endif
endEvent


event OnOptionSliderAccept(int option, float value)
	if (option == HPMultID)
		_HPMult = value
		SetSliderOptionValue(HPMultID, _HPMult, "Health*: {1}")
		aaaUDDragonHPMult.SetValue(_HPMult)
	elseif (option == KillMoveID)
		_KillMove = value as int
		SetSliderOptionValue(KillMoveID, _KillMove, "{0}%")
		aaaUDKillMove.SetValue(_KillMove)
	endIf
endEvent


Event OnOptionSelect(int option)
	if (option == DiminishID)
	       _Diminish = !_Diminish
	       SetToggleOptionValue(DiminishID, _Diminish)
	       If(_Diminish)
			aaaUDDiminishReturns.SetValueInt(1)
	       Else
			aaaUDDiminishReturns.SetValueInt(0)
	       EndIf
	elseif (option == ActivateModID)
       	_ActivateMod = !_ActivateMod
       	SetToggleOptionValue(ActivateModID, _ActivateMod)
       	If(_ActivateMod)
			aaaUDInitQuest.Start()
       	Else
			aaaUDInitQuest.Stop()
       	EndIf
	endIf
EndEvent


Event OnOptionDefault(int option)
	If(option == DiminishID)
		if (!_Diminish)
			_Diminish = true
			SetToggleOptionValue(DiminishID, _Diminish)
			aaaUDDiminishReturns.SetValueInt(1)
		endif
	ElseIf(option == ActivateModID)
		if (!_ActivateMod)
			_ActivateMod = true
			SetToggleOptionValue(ActivateModID, _ActivateMod)
			aaaUDInitQuest.Start()
		endif
	Elseif (option == HPMultID)
		_HPMult = 3.0
		SetSliderOptionValue(HPMultID, _HPMult, "Second: {1}")
		aaaUDDragonHPMult.SetValue(_HPMult)
	Elseif (option == KillmoveID)
		_KillMove = 100
		SetSliderOptionValue(KillmoveID, _KillMove, "Second: {1}")
		aaaUDKillMove.SetValue(_KillMove)
	EndIf
EndEvent


Event OnOptionHighlight(int option)
	If(option == DiminishID)
		SetInfoText("Toggle option on to Dragon has stagger resist. Whenever stagger attack hits dragon, dragon have stagger time decreases gradually.")
	ElseIf(option == ActivateModID)
	       if (!_ActivateMod)
	           SetInfoText("Activate this mod.")
	       else
	           SetInfoText("Deactivate this mod.")
	       endif
	Elseif (option == HPMultID)
		SetInfoText("Dragon multiply by health. If you use other dragon mod, recommend 1.0.")
	Elseif (option == KillMoveID)
		SetInfoText("Rate of dragon kill move player or NPC. 100 = vanilla rate, 0 = no killmove.")
	EndIf
EndEvent