Scriptname HeadPhoneSpellAddAndRemoveScript extends ObjectReference  

SPELL Property OsareHeadPhoneSpell Auto  

GlobalVariable Property OsareHeadPhoneGB Auto

MusicType Property OsareHeadPhoneTracks Auto 

Event OnEquipped(Actor akActor)
	If (akActor == Game.GetPlayer())
		akActor.AddSpell(OsareHeadPhoneSpell)
	EndIf
endEvent

Event OnUnequipped(Actor akActor)
	If (akActor == Game.GetPlayer())
		akActor.RemoveSpell(OsareHeadPhoneSpell)
		If(OsareHeadPhoneGB.GetValue() == 1)
			OsareHeadPhoneTracks.Remove()
			OsareHeadPhoneGB.SetValue(0)
		EndIf
	EndIf
EndEvent 

 
