Scriptname aaUCRingScript extends ObjectReference  
{Script for the ring of perception}

Message property aaUCPerceptionMsg auto
{Points to the message box that is shown on the first activation.}

Spell property aaUCNighteyeAb auto
Spell property aaUCLightWispAb auto
Spell property aaUCClairvoyanceAb auto
{Points to the spell abilities}

Event OnEquipped(Actor akActor)
  	if akActor == Game.GetPlayer()
    		
  	endIf

  	int ibutton = aaUCPerceptionMsg.Show()

	If ibutton == 0
		Game.GetPlayer().AddSpell(aaUCNighteyeAb)

    		ElseIf ibutton == 1
			Game.GetPlayer().AddSpell(aaUCLightWispAb)
  				
    		ElseIf ibutton == 2
			Game.GetPlayer().AddSpell(aaUCClairvoyanceAb)
  			
		ElseIf ibutton == 3
			Return

	EndIf

endEvent

Event OnUnequipped(Actor akActor)

	if akActor == Game.GetPlayer()
    		
  	endIf

	Game.GetPlayer().RemoveSpell(aaUCNighteyeAb)
  	
	Game.GetPlayer().RemoveSpell(aaUCLightWispAb)
  		
	Game.GetPlayer().RemoveSpell(aaUCClairvoyanceAb)
  	
endEvent