void Rspawn(float fX, float fY, float fZ)
{//Spawns random enemy next to caller.
//
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.

   void self = getlocalvar("self"); //Get calling entity.
   void vSpawn; //Spawn object.
   void vName; //Spawn object's name.
      void vRName = getentityproperty(self,"defaultname"); // Get caller's real name.
      void vAlias = getentityproperty(self,"name"); // Get caller's alias.
      void Health = getentityproperty(self,"health"); // Get caller's health.
   int  iDirection = getentityproperty(self, "direction"); // Get caller's direction.
   int  iMap = getentityproperty(self, "map"); // Get caller's remap.
      int  iR = rand()%22 + 22;

   if (iR > 0 && 2 > iR){ 
        vName = "zoe";
      } else if (iR > 1 && 3 > iR){ 
        vName = "billy";
      } else if (iR > 2 && 4 > iR){ 
        vName = "bongo";
      } else if (iR > 3 && 5 > iR) { 
        vName = "Cliff";
      } else if (iR > 4 && 6 > iR) { 
        vName = "Donovan";
      } else if (iR > 5 && 7 > iR) { 
        vName = "Electra";
      } else if (iR > 6 && 8 > iR) { 
        vName = "Helena";
      } else if (iR > 7 && 9 > iR) { 
        vName = "Hakuyo";
      } else if (iR > 8 && 10 > iR) { 
        vName = "KBoxer";
      } else if (iR > 9 && 11 > iR) { 
        vName = "Macleod";
      } else if (iR > 10 && 12 > iR) { 
        vName = "billy";
      } else if (iR > 11 && 13 > iR) { 
        vName = "Sara";
      } else if (iR > 12 && 14 > iR) { 
        vName = "Slash";
      } else if (iR > 13 && 15 > iR) { 
        vName = "Soozie";
      } else if (iR > 14 && 16 > iR) { 
        vName = "Signal";
      } else if (iR > 15 && 17 > iR) { 
        vName = "Signal";
      } else if (iR > 16 && 18 > iR) { 
        vName = "Zack";
      } else if (iR > 17 && 19 > iR) { 
        vName = "cindy";
      } else if (iR > 18 && 20 > iR) { 
        vName = "Jack";
      } else if (iR > 19 && 21 > iR) { 
        vName = "keada";
      } else if (iR > 20 && 22 > iR) { 
        vName = "galsia";
      } else if (iR > 21 && 23 > iR) { 
        vName = "Chameleon";
      } else if (iR > 22 && 24 > iR) { 
        vName = "maurice";
      } else if (iR > 23 && 25 > iR) { 
        vName = "Tiger";
      } else if (iR > 24 && 26 > iR) { 
        vName = "zoe";
      } else if (iR > 25 && 27 > iR) { 
        vName = "cindy";
      } else if (iR > 26 && 28 > iR) { 
        vName = "billy";
      } else if (iR > 27 && 29 > iR) { 
        vName = "K'";
      } else if (iR > 28 && 30 > iR) { 
        vName = "muffy";
      } else if (iR > 29 && 31 > iR) { 
        vName = "syrus";
      } else if (iR > 30 && 32 > iR) { 
        vName = "zoe";
      } else if (iR > 31 && 33 > iR) { 
        vName = "bruce";
      } else if (iR > 32 && 34 > iR) { 
        vName = "Abadede";
      } else if (iR > 33 && 35 > iR) { 
        vName = "Boxer";
      } else if (iR > 34 && 36 > iR) { 
        vName = "Zamza";
      } else if (iR > 35 && 37 > iR) { 
        vName = "Barbon";
      } else if (iR > 36 && 38 > iR) { 
        vName = "Jet";
      } else if (iR > 37 && 39 > iR) { 
        vName = "Victy";
      } else if (iR > 40 && 42 > iR) { 
        vName = "bruce";
      } else if (iR > 41 && 43 > iR) { 
        vName = "freddy";
      } else if (iR > 42 && 44 > iR) { 
        vName = "ash";
      } else { 
        vName = "galsia";
      }

      int  RR = rand()%5 + 5;

	if (RR >= 0 && iR < 2){ 
        iMap = 1;
      } else if (iR >= 1 && iR < 3){ 
        iMap = 2;
      } else if (iR >= 2 && iR < 4){ 
        iMap = 3;
      } else if (iR >= 3 && iR < 5){ 
        iMap = 4;
      } else if (iR >= 4 && iR < 6){ 
        iMap = 5;
      } else if (iR >= 5 && iR < 7){ 
        iMap = 6;
      } else { 
        iMap = 1;
      }

   clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

   if (iDirection == 0){ //Is entity facing left?                  
          fX = -fX; //Reverse X direction to match facing.
   }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
   
   vSpawn = spawn(); //Spawn in entity.

   changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
   changeentityproperty(vSpawn, "map", 1); //Set map.
   changeentityproperty(vSpawn, "health", 160); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}


void Rspawn2(float fX, float fY, float fZ)
{//Spawns random enemy next to caller.
//
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.

   void self = getlocalvar("self"); //Get calling entity.
   void vSpawn; //Spawn object.
   void vName; //Spawn object's name.
      void vRName = getentityproperty(self,"defaultname"); // Get caller's real name.
      void vAlias = getentityproperty(self,"name"); // Get caller's alias.
      void Health = getentityproperty(self,"health"); // Get caller's health.
   int  iDirection = getentityproperty(self, "direction"); // Get caller's direction.
   int  iMap = getentityproperty(self, "map"); // Get caller's remap.
      int  iR = rand()%6 + 6;

   if (iR > 0 && 2 > iR){ 
        vName = "bat";
      } else if (iR > 1 && 3 > iR) { 
        vName = "ratman";
      } else if (iR > 2 && 4 > iR) { 
        vName = "stomper";
      } else if (iR > 3 && 5 > iR) { 
        vName = "rat";
      } else if (iR > 4 && 6 > iR) { 
        vName = "rat_";
      } else if (iR > 5 && 7 > iR) { 
        vName = "Slaughter";
      } else if (iR > 6 && 8 > iR) { 
        vName = "spider";
      } else if (iR > 6 && 9 > iR) { 
        vName = "grogg";
      } else if (iR > 7 && 10 > iR) { 
        vName = "ratman";
      } else { 
        vName = "bat";
      }

   clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

   if (iDirection == 0){ //Is entity facing left?                  
          fX = -fX; //Reverse X direction to match facing.
   }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
   
   vSpawn = spawn(); //Spawn in entity.

   changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
   changeentityproperty(vSpawn, "map", iMap); //Set map.
   changeentityproperty(vSpawn, "health", 160); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}


void Rspawn3(float fX, float fY, float fZ)
{//Spawns random enemy next to caller.
//
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.

   void self = getlocalvar("self"); //Get calling entity.
   void vSpawn; //Spawn object.
   void vName; //Spawn object's name.
      void vRName = getentityproperty(self,"defaultname"); // Get caller's real name.
      void vAlias = getentityproperty(self,"name"); // Get caller's alias.
      void Health = getentityproperty(self,"health"); // Get caller's health.
   int  iDirection = getentityproperty(self, "direction"); // Get caller's direction.
   int  iMap = getentityproperty(self, "map"); // Get caller's remap.
      int  iR = rand()%6 + 6;

   if (iR > 0 && 2 > iR){ 
        vName = "Ripper";
      } else if (iR > 1 && 3 > iR) { 
        vName = "Baby";
      } else if (iR > 2 && 4 > iR) { 
        vName = "Ball";
      } else if (iR > 3 && 5 > iR) { 
        vName = "Biggy_Man";
      } else if (iR > 4 && 6 > iR) { 
        vName = "Fly";
      } else if (iR > 5 && 7 > iR) { 
        vName = "Bellyache";
      } else if (iR > 6 && 8 > iR) { 
        vName = "Mutant_Jennifer";
      } else if (iR > 6 && 9 > iR) { 
        vName = "Hell_Hound";
      } else if (iR > 7 && 10 > iR) { 
        vName = "Undress";
      } else { 
        vName = "Dead_Man_Fat";
      }

   clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

   if (iDirection == 0){ //Is entity facing left?                  
          fX = -fX; //Reverse X direction to match facing.
   }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
   
   vSpawn = spawn(); //Spawn in entity.

   changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
   changeentityproperty(vSpawn, "map", iMap); //Set map.
   changeentityproperty(vSpawn, "health", 160); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void Rspawn4(float fX, float fY, float fZ)
{//Spawns random enemy next to caller.
//
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.

   void self = getlocalvar("self"); //Get calling entity.
   void vSpawn; //Spawn object.
   void vName; //Spawn object's name.
      void vRName = getentityproperty(self,"defaultname"); // Get caller's real name.
      void vAlias = getentityproperty(self,"name"); // Get caller's alias.
      void Health = getentityproperty(self,"health"); // Get caller's health.
   int  iDirection = getentityproperty(self, "direction"); // Get caller's direction.
   int  iMap = getentityproperty(self, "map"); // Get caller's remap.
      int  iR = rand()%3 + 3;

   if (iR > 0 && 2 > iR){ 
        vName = "Ripper";
      } else if (iR > 1 && 3 > iR) { 
        vName = "baby";
      } else if (iR > 2 && 4 > iR) { 
        vName = "ball";
      } else if (iR > 3 && 5 > iR) { 
        vName = "Biggy_Man";
      } else if (iR > 4 && 6 > iR) { 
        vName = "ball";
      } else { 
        vName = "Ripper";
      }

   clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

   if (iDirection == 0){ //Is entity facing left?                  
          fX = -fX; //Reverse X direction to match facing.
   }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
   
   vSpawn = spawn(); //Spawn in entity.

   changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
   changeentityproperty(vSpawn, "map", iMap); //Set map.
   changeentityproperty(vSpawn, "health", 160); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}