Scriptname HeadPhonePlayScript extends activemagiceffect  

Message Property OsareHeadPhoneMessageBox Auto  

MusicType Property OsareHeadPhoneTracks Auto

GlobalVariable Property OsareHeadPhoneGB Auto

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

		Int ibutton = OsareHeadPhoneMessageBox.Show()

		If (ibutton == 0)
			IF (OsareHeadPhoneGB.GetValue() == 0)
				OsareHeadPhoneTracks.Add()
				OsareHeadPhoneGB.SetValue(1)
			EndIf
		ElseIf (ibutton == 1)
			IF (OsareHeadPhoneGB.GetValue() == 1)
				OsareHeadPhoneTracks.Remove()
				OsareHeadPhoneGB.SetValue(0)
			EndIf
		EndIf
	ENDIF
endEvent