NotifyNPCKilledDirect() public static method

public static NotifyNPCKilledDirect ( Player player, int npcNetID ) : void
player Terraria.Player
npcNetID int
return void
 public static void NotifyNPCKilled(NPC npc)
 {
     if (Main.netMode != 0)
     {
         for (int i = 0; i < 255; i++)
         {
             if (npc.playerInteraction[i])
             {
                 NetMessage.SendData((int)PacketTypes.NotifyPlayerNpcKilled, i, -1, "", npc.netID, 0f, 0f, 0f, 0, 0, 0);
             }
         }
     }
     else if (npc.playerInteraction[Main.myPlayer])
     {
         AchievementsHelper.NotifyNPCKilledDirect(Main.player[Main.myPlayer], npc.netID);
         return;
     }
 }
示例#2
0
 public static void NotifyNPCKilled(NPC npc)
 {
     if (Main.netMode == 0)
     {
         if (!npc.playerInteraction[Main.myPlayer])
         {
             return;
         }
         AchievementsHelper.NotifyNPCKilledDirect(Main.player[Main.myPlayer], npc.netID);
     }
     else
     {
         for (int remoteClient = 0; remoteClient < (int)byte.MaxValue; ++remoteClient)
         {
             if (npc.playerInteraction[remoteClient])
             {
                 NetMessage.SendData(97, remoteClient, -1, "", npc.netID, 0.0f, 0.0f, 0.0f, 0, 0, 0);
             }
         }
     }
 }