// ZZ> This function makes the character wanders around its enemy
IfSpawned				// Make it able to be crushed
  MakeCrushValid			  //
  
IfCrushed
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 0
  SpawnExactParticle	
  GoPoof
  tmpargument = 1
  SendMessageNear

IfKilled				// This reduces the height of the char
  tmpargument = 0			    //
  SendMessageNear			    //
  tmpargument = 20			  //
  SetBumpSize				  //
  tmpargument = 23			  //
  SetBumpHeight				  //
  tmpargument = selfmoney
  DropMoney				  //
  tmpargument = 1			  //
  PlaySound				  //
  tmpx = selfx                          // Bam!
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 0
  SpawnExactParticle	
  GoPoof
  
IfAttacked				// Don't take kindly to attackers
  SetTargetToWhoeverAttacked		  //
    tmpargument = 0			    // Sound
    PlaySound				    //
    
IfBumped				// Blast whoever it bumped
  SetTargetToWhoeverBumped		  //
  IfTargetIsOnHatedTeam			  // Make sure it's an enemy
    tmpx = selfx                          // Bam!
    tmpy = selfy
    tmpdistance = selfz
    tmpargument = 0
    SpawnExactParticle		  
    GoPoof
    tmpargument = 2
    SendMessageNear
  Else					  // Scooch around friendly
    tmpx = rand & 1023 + targetx - 512      //
    tmpy = rand & 1023 + targety - 512      //
    ClearWaypoints			    //
    AddWaypoint				    //
    SetTargetToOldTarget		    //
    
IfTimeOut
  tmpdistance = 128*5		// This is done every so often
  SetTargetToDistantEnemy		  // Look for enemies
    tmpx = rand & 511 - 256 + targetx	    //
    tmpy = rand & 511 - 256 + targety	    //
    tmpargument = rand & 64 + 50		  // Wait a while and try again
  Else					  // Wander around home position
    tmpx = rand & 1023 - 512 + selfspawnx   //
    tmpy = rand & 1023 - 512 + selfspawny   //
    tmpargument = rand & 20 + 10		  // Wait a while and try again
  ClearWaypoints			  //
  AddWaypoint				  //
  tmpargument = rand & 63 + 20		  // Wait a while and try again
  SetTime				  //
  
End					// Finished with this character
