private static void Message_Unicode(PacketReader pvSrc) { int serial = pvSrc.ReadInt32(); int num2 = pvSrc.ReadInt16(); int type = pvSrc.ReadByte(); IHue hue = Hues.Load(pvSrc.ReadInt16()); IFont uniFont = Engine.GetUniFont(pvSrc.ReadInt16()); string str = pvSrc.ReadString(4); string name = pvSrc.ReadString(30); string text = pvSrc.ReadUnicodeString(); AddMessage(serial, uniFont, hue, type, name, text); }
private static void Message_Localized_Affix(PacketReader pvSrc) { int serial = pvSrc.ReadInt32(); int num2 = pvSrc.ReadInt16(); int type = pvSrc.ReadByte(); IHue hue = Hues.Load(pvSrc.ReadInt16()); IFont uniFont = Engine.GetUniFont(pvSrc.ReadInt16()); int number = pvSrc.ReadInt32(); int num5 = pvSrc.ReadByte(); string name = pvSrc.ReadString(30); string input = Localization.GetString(number); string str3 = pvSrc.ReadString(); string str4 = pvSrc.ReadUnicodeString(); if (((num5 & -8) != 0) || (((num5 & 2) != 0) && (serial > 0))) { using (StreamWriter writer = new StreamWriter("Message Localized Affix.log", true)) { writer.WriteLine("Serial: 0x{0:X8}; Graphic: 0x{1:X4}; Type: {2}; Number: {3}; Flags: 0x{4:X2}; Name: '{5}'; Affix: '{6}'; Args: '{7}'; Text: '{8}';", new object[] { serial, num2, type, number, num5, name, str3, str4, input }); } } if (str3.Length > 0) { switch ((num5 & 1)) { case 0: input = input + str3; break; case 1: input = str3 + input; break; } } if (str4.Length > 0) { string[] strArray = str4.Split(new char[] { '\t' }); for (int i = 0; i < strArray.Length; i++) { if ((strArray[i].Length > 1) && strArray[i].StartsWith("#")) { try { strArray[i] = Localization.GetString(Convert.ToInt32(strArray[i].Substring(1))); } catch { } } } m_Args = strArray; input = m_ArgReplace.Replace(input, new MatchEvaluator(PacketHandlers.ArgReplace_Eval)); } if ((num5 & -8) != 0) { pvSrc.Trace(); input = string.Format("0x{0:X2}\n{1}", num5, input); } AddMessage(serial, uniFont, hue, type, name, input, number); }
private static void DisplayGump(PacketReader pvSrc) { int serial = pvSrc.ReadInt32(); int dialogID = pvSrc.ReadInt32(); int x = pvSrc.ReadInt32(); int y = pvSrc.ReadInt32(); string layout = pvSrc.ReadString(pvSrc.ReadUInt16()); string[] text = new string[pvSrc.ReadUInt16()]; for (int i = 0; i < text.Length; i++) { text[i] = pvSrc.ReadUnicodeString(pvSrc.ReadUInt16()); } GServerGump.GetCachedLocation(dialogID, ref x, ref y); GServerGump toAdd = new GServerGump(serial, dialogID, x, y, layout, text); Gumps.Desktop.Children.Add(toAdd); }
private static void DisplayProfile(PacketReader pvSrc) { int serial = pvSrc.ReadInt32(); string header = pvSrc.ReadString(); string footer = pvSrc.ReadUnicodeString(); string body = pvSrc.ReadUnicodeString(); Mobile owner = World.FindMobile(serial); if (owner != null) { Gumps.Desktop.Children.Add(new GCharacterProfile(owner, header, body, footer)); } }
private static void Command_Party(PacketReader pvSrc) { int num = pvSrc.ReadByte(); switch (num) { case 1: { pvSrc.ReturnName = "Party Member List"; int num2 = pvSrc.ReadByte(); Mobile[] mobileArray = new Mobile[num2]; for (int i = 0; i < num2; i++) { mobileArray[i] = World.WantMobile(pvSrc.ReadInt32()); mobileArray[i].QueryStats(); } Party.State = PartyState.Joined; Party.Members = mobileArray; int num4 = (Engine.GameY + Engine.GameHeight) - 50; for (int j = 0; j < num2; j++) { if (!mobileArray[j].Player) { if (mobileArray[j].StatusBar == null) { mobileArray[j].OpenStatus(false); if (mobileArray[j].StatusBar != null) { mobileArray[j].StatusBar.Gump.X = ((Engine.GameX + Engine.GameWidth) - 30) - mobileArray[j].StatusBar.Gump.Width; mobileArray[j].StatusBar.Gump.Y = num4 - mobileArray[j].StatusBar.Gump.Height; num4 -= mobileArray[j].StatusBar.Gump.Height + 5; } } else { num4 -= mobileArray[j].StatusBar.Gump.Height + 5; } } } return; } case 2: { pvSrc.ReturnName = "Remove Party Member"; int num6 = pvSrc.ReadByte(); int num7 = pvSrc.ReadInt32(); Mobile[] mobileArray2 = new Mobile[num6]; for (int k = 0; k < num6; k++) { mobileArray2[k] = World.WantMobile(pvSrc.ReadInt32()); mobileArray2[k].QueryStats(); } Party.State = PartyState.Joined; Party.Members = mobileArray2; return; } case 3: case 4: { string str2; IHue hue; pvSrc.ReturnName = (num == 3) ? "Private Party Message" : "Public Party Message"; int serial = pvSrc.ReadInt32(); string str = pvSrc.ReadUnicodeString(); Mobile mobile = World.FindMobile(serial); if (((mobile == null) || ((str2 = mobile.Name) == null)) || ((str2 = str2.Trim()).Length <= 0)) { str2 = "Someone"; } if (str == "I'm stunned !!") { hue = Hues.Load(0x22); if (mobile != null) { Engine.Sounds.PlaySound(0x157, mobile.X, mobile.Y, mobile.Z); } } else if (str.StartsWith("I stunned ") && str.EndsWith(" !!")) { hue = Hues.Load(0x22); if (mobile != null) { Engine.Sounds.PlaySound(0x1e1, mobile.X, mobile.Y, mobile.Z); } } else if (str.StartsWith("Changing last target to ")) { hue = Hues.Load(0x35); } else if (num == 3) { hue = Hues.Load(World.CharData.WhisperHue); } else { hue = Hues.Load(World.CharData.TextHue); } Engine.AddTextMessage(string.Format("<{0}{1}> {2}", (num == 3) ? "Whisper: " : "", str2, str), Engine.DefaultFont, hue); return; } case 7: { pvSrc.ReturnName = "Party Invitation"; int num10 = pvSrc.ReadInt32(); Party.State = PartyState.Joining; Party.Leader = World.WantMobile(num10); return; } } pvSrc.ReturnName = "Unknown Party Message"; pvSrc.Trace(); }