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

◆ UnlockOrExchangePet()

static void Terraria.NPC.UnlockOrExchangePet ( ref bool petBoughtFlag,
int npcType,
string textKeyForLicense,
int netMessageData )
inlinestatic

Definition at line 91335 of file NPC.cs.

91336 {
91337 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
91338 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
91339 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
91340 Color color = default(Color);
91341 ((Color)(ref color))._002Ector(50, 255, 130);
91342 if (Main.netMode == 1)
91343 {
91344 if (!petBoughtFlag || AnyNPCs(npcType))
91345 {
91346 NetMessage.SendData(61, -1, -1, null, Main.myPlayer, netMessageData);
91347 }
91348 }
91349 else if (!petBoughtFlag)
91350 {
91351 petBoughtFlag = true;
91353 NetMessage.TrySendData(7);
91354 }
91356 {
91357 ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Misc.PetExchangeSuccess"), color);
91358 }
91359 else
91360 {
91361 ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Misc.PetExchangeFail"), color);
91362 }
91363 }
static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer=-1)
Definition ChatHelper.cs:51
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 bool RerollVariationForNPCType(int npcType)
Definition NPC.cs:91365
static bool AnyNPCs(int Type)
Returns true if there are any active NPC in the world of the given NPC type (F:Terraria....
Definition NPC.cs:106615
Color color
Definition NPC.cs:1085

References Terraria.Chat.ChatHelper.BroadcastChatMessage(), Terraria.Localization.NetworkText.FromKey(), Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.NetMessage.SendData(), and Terraria.NetMessage.TrySendData().

Referenced by Terraria.MessageBuffer.GetData(), and Terraria.Player.LicenseOrExchangePet().

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