Guest User

Untitled

a guest
Jun 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. public static void SpawnSkeletron()
  2.         {
  3.             bool flag = true;
  4.             bool flag2 = false;
  5.             Vector2 vector = default(Vector2);
  6.             int num = 0;
  7.             int num2 = 0;
  8.             for (int i = 0; i < 200; i++)
  9.             {
  10.                 if (Main.npc[i].active && Main.npc[i].type == 35)
  11.                 {
  12.                     flag = false;
  13.                     break;
  14.                 }
  15.             }
  16.             for (int j = 0; j < 200; j++)
  17.             {
  18.                 if (Main.npc[j].active && Main.npc[j].type == 37)
  19.                 {
  20.                     flag2 = true;
  21.                     Main.npc[j].ai[3] = 1f;
  22.                     vector = Main.npc[j].position;
  23.                     num = Main.npc[j].width;
  24.                     num2 = Main.npc[j].height;
  25.                     if (Main.netMode == 2)
  26.                     {
  27.                         NetMessage.SendData(23, -1, -1, "", j, 0f, 0f, 0f, 0);
  28.                     }
  29.                 }
  30.             }
  31.             if (flag && flag2)
  32.             {
  33.                 int num3 = NPC.NewNPC((int)vector.X + num / 2, (int)vector.Y + num2 / 2, 35, 0);
  34.                 Main.npc[num3].netUpdate = true;
  35.                 string str = "Skeletron";
  36.                 if (Main.netMode == 0)
  37.                 {
  38.                     Main.NewText(str + " " + Lang.misc[16], 175, 75, 255);
  39.                     return;
  40.                 }
  41.                 if (Main.netMode == 2)
  42.                 {
  43.                     NetMessage.SendData(25, -1, -1, str + " " + Lang.misc[16], 255, 175f, 75f, 255f, 0);
  44.                 }
  45.             }
  46.         }
Add Comment
Please, Sign In to add comment