// Get mean if characters wanna be bad
IfAttacked
  SetTargetToWhoeverAttacked
  CallForHelp
  tmpargument = 5       //Team EVIL
  TargetJoinTeam
  
//------------------------------------------------------------------------------
// ZZ> Move around...  Start at state 0
IfTimeOut
  tmpx=rand&63
  tmpy=0
  IfXIsEqualToY
    tmpargument = 0
    PlaySound
  IfStateIs0
    // Find shepherd
    tmpargument = [SHEP]
    tmpdistance = BLAHFRIENDS
    SetTargetToNearestBlahID
      SetOwnerToTarget
      tmpargument = 1
      SetState
    tmpargument = 5
    SetTime
  IfStateIs1
    SetTargetToOwner
    tmpx = ownerx
    tmpy = ownery
    tmpdistance = 100
    tmpturn = selfturn
    Compass
    tmpturn = targetturnto + 32768
    tmpdistance = 120
    Compass
    SetTargetToNearestFriend
    tmpturn = targetturnto + 32768
    tmpdistance = 70
    Compass
    tmpx = rand & 31 - 16 + tmpx
    tmpy = rand & 31 - 16 + tmpy
    ClearWaypoints
    AddWaypoint
    tmpargument = rand & 31 + 15
    SetTime

//------------------------------------------------------------------------------
// ZZ> Handle death by sending a message and other stuff
IfKilled
  SetTargetToWhoeverAttacked
  IfTargetIsSelf
    tmpargument = 1
  Else
    tmpargument = 0
  SendMessage

  // Make the character body
  tmpargument = 45
  SetBumpHeight

  tmpargument = [SHEP]
  IssueOrder
  
//Secret easter egg (summon black sheep if all sheep are killed)
IfOrdered
  tmpx = [SHEP]
  tmpy = selforder
  IfXIsEqualToY
    GetContent
    tmpargument = tmpargument + 1
    SetContent
    tmpx = tmpargument
    tmpy = 8            //How many to kill
    IfXIsEqualToY
      tmpargument = 78
      tmpx = selfx
      tmpy = selfy
      tmpdistance = 750 + selfz
      tmpturn = rand
      SpawnExactCharacterXYZ
//------------------------------------------------------------------------------
End
//------------------------------------------------------------------------------
