IfSpawned
  tmpargument = 2
  PlaySound			//I love brains!
  tmpargument = 2
  SendMessage
  JoinEvilTeam

//Always target the player
tmpargument = [ELFF]
tmpdistance = 2
SetTargetToNearestBlahID
  IfTargetIsAPlayer
    DoNothing
  Else
    SetTargetToNearestEnemy
Else
  SetTargetToNearestEnemy

IfTimeOut
  tmpx = targetdistance
  tmpy = 400
  IfXIsMoreThanY
    tmpargument = 100			//Charge!
    SetTime
    tmpturn = targetturnto
    tmpdistance = 1500
    tmpx = targetx
    tmpy = targety
    Run
  Else
    tmpargument = 20			//Combat
    SetTime
    tmpdistance = 200
    tmpturn = targetturnto
    tmpx = targetx
    tmpy = targety
    Walk
  Compass
  ClearWaypoints
  AddWaypoint

  //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 = EXPSECRET
  GiveExperienceToGoodTeam

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

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