#include "data/scripts2/item.c"

void level1e(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()%4 + 4;

   if (iR >= 0 && iR < 2){ 
        vName = "Bret";
      } else if (iR >= 1 && iR < 3){ 
        vName = "Dug";
      } else if (iR >= 2 && iR < 4){ 
        vName = "Jake";
      } else if (iR >= 3 && iR < 5){ 
        vName = "Simons";
      } else if (iR >= 4 && iR < 6){ 
        vName = "Jay";
      } else if (iR >= 5 && iR < 7){ 
        vName = "Two_p";
      } else if (iR >= 6 && iR < 8){ 
        vName = "Slash";
      } else { 
        vName = "Axl";
      }

   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", 120); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void mouse(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 && iR < 2){ 
        vName = "RATMAN";
      } else if (iR >= 1 && iR < 3){ 
        vName = "RAT_";
      } else if (iR >= 2 && iR < 4){ 
        vName = "RAT";
      } else if (iR >= 3 && iR < 5){ 
        vName = "SRAT";
      } else if (iR >= 4 && iR < 6){ 
        vName = "WRENCHIE";
      } else { 
        vName = "SRAT";
      }

   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", 120); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void piggy(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()%2 + 2;

   if (iR >= 0 && iR < 2){ 
        vName = "PIGMAN";
      } else if (iR >= 1 && iR < 3){ 
        vName = "PIG_";
      } else if (iR >= 2 && iR < 4){ 
        vName = "PIG";
      } else { 
        vName = "DOG";
      }

   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", 120); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void level2e(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 && iR < 2){ 
        vName = "Poison";
      } else if (iR >= 1 && iR < 3){ 
        vName = "Gory";
      } else if (iR >= 2 && iR < 4){ 
        vName = "Bill";
      } else if (iR >= 3 && iR < 5){ 
        vName = "Holly";
      } else if (iR >= 4 && iR < 6){ 
        vName = "Elgado";
      } else { 
        vName = "Wood";
      }

   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", 120); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void level3e(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 && iR < 2){ 
        vName = "Andore";
      } else if (iR >= 1 && iR < 3){ 
        vName = "Elic";
      } else if (iR >= 2 && iR < 4){ 
        vName = "Elias";
      } else if (iR >= 3 && iR < 5){ 
        vName = "Holly";
      } else if (iR >= 4 && iR < 6){ 
        vName = "Eliot";
      } else { 
        vName = "Leon";
      }

   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", 120); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void level4e(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()%5 + 5;

   if (iR >= 0 && iR < 2){ 
        vName = "Mic";
      } else if (iR >= 1 && iR < 3){ 
        vName = "Mark";
      } else if (iR >= 2 && iR < 4){ 
        vName = "Bull";
      } else if (iR >= 3 && iR < 5){ 
        vName = "Elijah";
      } else if (iR >= 4 && iR < 6){ 
        vName = "Jack";
      } else if (iR >= 5 && iR < 7){ 
        vName = "Atlus";
      } else if (iR >= 6 && iR < 8){ 
        vName = "Jony";
      } else if (iR >= 7 && iR < 9){ 
        vName = "tsubomi";
      } else if (iR >= 8 && iR < 10){ 
        vName = "May";
      } else { 
        vName = "Schot";
      }

   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", 120); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void level5e(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 && iR < 2){ 
        vName = "Damnd";
      } else if (iR >= 1 && iR < 3){ 
        vName = "Sodom";
      } else if (iR >= 2 && iR < 4){ 
        vName = "Edi";
      } else if (iR >= 3 && iR < 5){ 
        vName = "Abigail";
      } else if (iR >= 4 && iR < 6){ 
        vName = "Rolent";
      } else { 
        vName = "Wonwon";
      }

   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", 220); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void level6e(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 && iR < 2){ 
        vName = "Freddie";
      } else if (iR >= 1 && iR < 3){ 
        vName = "Bratken";
      } else if (iR >= 2 && iR < 4){ 
        vName = "Phil";
      } else if (iR >= 3 && iR < 5){ 
        vName = "Retu";
      } else if (iR >= 4 && iR < 6){ 
        vName = "Balrog";
      } else { 
        vName = "Vega";
      }

   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", 220); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}

void robe(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()%2 + 2;

   if (iR >= 0 && iR < 2){ 
        vName = "ROBO";
      } else if (iR >= 1 && iR < 3){ 
        vName = "ROBOT";
      } else if (iR >= 2 && iR < 4){ 
        vName = "CYBER";
      } else { 
        vName = "ROBO";
      }

   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", 120); //Set health.
   changeentityproperty(vSpawn, "direction", iDirection); //Set direction.

   return vSpawn; //Return spawn.
}
