TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ SpawnSkeletron()

static void Terraria.NPC.SpawnSkeletron ( int onWho)
inlinestatic

Definition at line 90659 of file NPC.cs.

90660 {
90661 //IL_0004: Unknown result type (might be due to invalid IL or missing references)
90662 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
90663 //IL_0139: Unknown result type (might be due to invalid IL or missing references)
90664 //IL_0144: Unknown result type (might be due to invalid IL or missing references)
90665 //IL_0090: Unknown result type (might be due to invalid IL or missing references)
90666 //IL_0095: Unknown result type (might be due to invalid IL or missing references)
90667 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
90668 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
90669 //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
90670 bool flag = true;
90671 bool flag2 = false;
90672 Vector2 zero = Vector2.Zero;
90673 int num = 0;
90674 int num2 = 0;
90675 for (int i = 0; i < 200; i++)
90676 {
90677 if (Main.npc[i].active && Main.npc[i].type == 35)
90678 {
90679 flag = false;
90680 break;
90681 }
90682 }
90683 for (int j = 0; j < 200; j++)
90684 {
90685 if (!Main.npc[j].active)
90686 {
90687 continue;
90688 }
90689 if (Main.npc[j].type == 37)
90690 {
90691 flag2 = true;
90692 Main.npc[j].ai[3] = 1f;
90693 zero = Main.npc[j].position;
90694 num = Main.npc[j].width;
90695 num2 = Main.npc[j].height;
90696 if (Main.netMode == 2)
90697 {
90698 NetMessage.SendData(23, -1, -1, null, j);
90699 }
90700 }
90701 else if (Main.npc[j].type == 54)
90702 {
90703 flag2 = true;
90704 zero = Main.npc[j].position;
90705 num = Main.npc[j].width;
90706 num2 = Main.npc[j].height;
90707 }
90708 }
90709 if (flag && flag2)
90710 {
90711 int num3 = NewNPC(GetBossSpawnSource(onWho), (int)zero.X + num / 2, (int)zero.Y + num2 / 2, 35);
90712 Main.npc[num3].netUpdate = true;
90713 string nPCNameValue = Lang.GetNPCNameValue(35);
90714 if (Main.netMode == 0)
90715 {
90716 Main.NewText(Language.GetTextValue("Announcement.HasAwoken", nPCNameValue), 175, 75);
90717 }
90718 else if (Main.netMode == 2)
90719 {
90720 ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", Lang.GetNPCName(35).ToNetworkText()), new Color(175, 75, 255));
90721 }
90722 }
90723 }
static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer=-1)
Definition ChatHelper.cs:51
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
static NetworkText FromKey(string key, params object[] substitutions)
Creates a NetworkText object from a localization key and optional substitutions. The receiving client...
Represents text that will be sent over the network in multiplayer and displayed to the receiving user...
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
Spawns an NPC into the game world with the given type. This method should not be called on multipla...
Definition NPC.cs:91239
static IEntitySource GetBossSpawnSource(int targetPlayerIndex)
Definition NPC.cs:91144

References Terraria.Chat.ChatHelper.BroadcastChatMessage(), Terraria.Localization.NetworkText.FromKey(), Terraria.Lang.GetNPCName(), Terraria.Lang.GetNPCNameValue(), Terraria.Localization.Language.GetTextValue(), Terraria.Main.netMode, Terraria.Main.NewText(), Terraria.Main.npc, and Terraria.NetMessage.SendData().

Referenced by Terraria.NPC.checkDead(), Terraria.MessageBuffer.GetData(), and Terraria.Main.GUIChatDrawInner().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: