Scriptname aaaKimachuuRespawnItem Extends ActiveMagicEffect

Actor Property PlayerRef Auto
Location Property LocCheak Auto
Message Property mesMenu Auto
ObjectReference Property MRef Auto
ObjectReference Property RiverwoodStartMarker Auto
Quest Property aQuest Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Int intIndex
	intIndex = mesMenu.Show()

	If intIndex == 0 ;復活視点指定
		MRef.Moveto(PlayerRef, 0.000000, 0.000000, 0.000000, true)
		Debug.Notification("Set respawn point.")
	ElseIf intIndex == 1 ;無効化
		aQuest.Stop()
		Debug.Notification("Respawn system stop.")
    ElseIf intIndex == 2 ;有効化
		aQuest.Start()
		Debug.Notification("Respawn system start.")
    ElseIf intIndex == 3 ;復活地点に戻る
    	if MRef.IsInLocation(LocCheak)
			PlayerRef.Moveto(RiverwoodStartMarker, 0.000000, 0.000000, 30.000000, true)
		Else
			PlayerRef.Moveto(MRef, 0.000000, 0.000000, 30.000000, true)
		EndIf
    Else ;キャンセル
    	;empty
	EndIf

EndEvent