Scriptname aaUCPoitionMixerScript extends ObjectReference  
{script for the 6 potion mixers}

Message property MixAskMsg auto
{points to the first ask message}

Message property MixSuccessMsg auto
{message shown on success}

int property HasPotions auto
{check to see if player has items}

Sound property PotionSplash auto
{Potion mixed sound}

Potion property RequiredPotion1 auto
{The first potion required}

Potion property RequiredPotion2 auto
{The second potion required}

Potion property MixedPotion auto
{The potion given}



Event OnActivate(ObjectReference activateRef)
  
	Int iButton = MixAskMsg.Show()

       If (iButton == 0)
		if activateRef == Game.GetPlayer()
			if HasPotions == 0
				if Game.GetPlayer().GetItemCount(RequiredPotion1) >= 1 && Game.GetPlayer().GetItemCount(RequiredPotion2) >= 1
					HasPotions = 1
				endif
			endif
		endif

		if activateRef == Game.GetPlayer()
			if HasPotions == 1
				MixSuccessMsg.Show()
				PotionSplash.Play(self)
				Game.GetPlayer().RemoveItem(RequiredPotion1,1)
				Game.GetPlayer().RemoveItem(RequiredPotion2,1)
				Game.GetPlayer().AddItem(MixedPotion,1)
			endif
		endif
      
       ElseIf (iButton == 1)
   		Return
			
       EndIf

endEvent