IfSpawned
  tmpargument = 2
  PlaySound		//I love brains!
  SetTargetToNearestEnemy	//Should be the player
  tmpargument = 2
  SendMessage
  JoinEvilTeam



IfTimeOut
  SetTargetToNearestEnemy
  tmpx = targetdistance
  tmpy = 400
  IfXIsMoreThanY
    tmpargument = 100			//Charge!
    SetTime
    tmpdistance = MOVECHARGE
  Else
    tmpargument = 20			//Combat
    SetTime
    tmpdistance = MOVEMELEE
    Walk
  ClearWaypoints
  FindPath

  //Growl
  tmpx = rand & 255
  tmpy = 0
  IfXIsEqualToY
    tmpargument = 1	//braaains....
    PlaySound
    tmpargument = 3
    SendMessageNear

  //Attack
  IfFacingTarget
    tmpx = targetdistance
    tmpy = 120
    IfXIsLessThanY
      tmpargument = rand & 1 + LATCHLEFT	//Randomize hand
      PressLatchButton

  //We killed the player already
  IfTargetKilled
    tmpargument = 4
    SendMessage
    tmpargument = 0
    PlaySound
    GoPoof
    SpawnPoof

//------------------------------------------------------------------------------
//Attack sound
IfUsed
  tmpargument = rand & 2 + 3
  PlaySound

  //Slow attacks
  tmpargument = 15
  SetReloadTime

//------------------------------------------------------------------------------
//Victory! .... For the player :'-(
IfKilled
  tmpargument = 4
  PlaySound
  tmpargument = 0		//He dies
  SendMessage

  //Unlock the module
  tmpargument = 1
  SendMessage
  tmpargument = [ZOMB]
  AddIDSZ

  // Make the character body
  tmpargument = 45
  SetBumpHeight

  //Award some bonus exp
  tmpargument = 100
  tmpdistance = EXPQUEST
  GiveExperienceToGoodTeam

//------------------------------------------------------------------------------
//Say ouch
IfAttacked
  SetTargetToWhoeverAttacked
  IfTargetIsOnSameTeam
    tmpargument = 3
    PlaySound
    tmpargument = 2
    SendMessageNear
  Else
    tmpargument = rand & 1 + 3
    PlaySound

//------------------------------------------------------------------------------
End
//------------------------------------------------------------------------------
