//The different states
// 0: Drinkable
//1: Send a message that it is not drinkable
//2: Dont send a message or drink (Delay or else it will loop)

//Drink and heal the bumping character
IfBumped			
  SetTargetToWhoeverBumped	 
  IfTargetIsAPlayer	
    IfStateIs0   
      tmpargument = 0		  
      SendMessageNear
      tmpargument = 1
      SetState				 //Send message its empty now
      PlaySound	
      tmpargument = 0
      tmpdistance = targetz
      tmpy = targety
      tmpx = targetx
      SpawnExactParticle
      tmpargument = 512            //2 life blocks and mana
      HealTarget
      PumpTarget
      tmpargument = 0	       //Empty of water
      SetContent

//Is it empty? if so send a message
IfBumped
  IfTargetIsAPlayer  		
    IfStateIs1
      IfTimeOut
        tmpargument = 1
        SendMessageNear
        tmpargument = 2  //Delay sending message
        SetState

IfTimeOut
  tmpargument = 100
  SetTime

  GetContent
  tmpx = tmpargument
  tmpy = 5
  IfXIsMoreThanY              //Does it have enough water?
    tmpargument = 0	      //Drinkable again
    SetState
  Else
    GetContent				//Else start refilling water
    tmpargument = tmpargument + 1	
    SetContent
    tmpargument = 1      //Spit out message its empty
    SetState

End				// Finished with this character
