Beispiel #1
0
 public void CharacterList(PacketReader pvSrc)
 {
     int num = pvSrc.ReadByte();
     for (int i = 0; i < 5; i++)
     {
         string name = pvSrc.ReadString(60);
         if (name.Length > 0)
         {
             CharacterProfile profile = null;
             for (int j = 0; (profile == null) && (j < this.m_Shard.Characters.Length); j++)
             {
                 if (this.m_Shard.Characters[j].Index == i)
                 {
                     profile = this.m_Shard.Characters[j];
                 }
             }
             if (profile != null)
             {
                 profile.Name = name;
             }
             else
             {
                 this.m_Shard.AddCharacter(new CharacterProfile(this.m_Shard, name, i));
             }
         }
         else
         {
             CharacterProfile character = null;
             for (int k = 0; (character == null) && (k < this.m_Shard.Characters.Length); k++)
             {
                 if (this.m_Shard.Characters[k].Index == i)
                 {
                     character = this.m_Shard.Characters[k];
                 }
             }
             if (character != null)
             {
                 this.m_Shard.RemoveCharacter(character);
             }
         }
     }
     Array.Sort(this.m_Shard.Characters, new CharacterComparer());
     new Timer(new OnTick(this.Update_OnTick), 0, 1).Start(false);
 }
Beispiel #2
0
 private static void MultiTarget(PacketReader pvSrc)
 {
     pvSrc.ReadByte();
     Engine.m_MultiPreview = true;
     Engine.m_MultiSerial = pvSrc.ReadInt32();
     Engine.TargetHandler = new MultiTargetHandler(Engine.m_MultiSerial);
     pvSrc.Seek(12, SeekOrigin.Current);
     Engine.m_MultiID = pvSrc.ReadInt16();
     Engine.m_xMultiOffset = pvSrc.ReadInt16();
     Engine.m_yMultiOffset = pvSrc.ReadInt16();
     Engine.m_zMultiOffset = pvSrc.ReadInt16();
     ArrayList list = new ArrayList(Engine.Multis.Load(Engine.m_MultiID));
     int count = list.Count;
     int x = 0x3e8;
     int y = 0x3e8;
     int num4 = -1000;
     int num5 = -1000;
     for (int i = 0; i < count; i++)
     {
         MultiItem item = (MultiItem) list[i];
         if (item.X < x)
         {
             x = item.X;
         }
         if (item.X > num4)
         {
             num4 = item.X;
         }
         if (item.Y < y)
         {
             y = item.Y;
         }
         if (item.Y > num5)
         {
             num5 = item.Y;
         }
     }
     Engine.m_MultiMinX = x;
     Engine.m_MultiMinY = y;
     Engine.m_MultiMaxX = num4;
     Engine.m_MultiMaxY = num5;
     ArrayList list2 = new ArrayList(list.Count);
     for (int j = x; j <= num4; j++)
     {
         for (int k = y; k <= num5; k++)
         {
             ArrayList list3 = new ArrayList(8);
             count = list.Count;
             int index = 0;
             while (index < count)
             {
                 MultiItem item2 = (MultiItem) list[index];
                 if ((item2.X == j) && (item2.Y == k))
                 {
                     list3.Add(StaticItem.Instantiate(item2.ItemID, (sbyte) item2.Z, item2.Flags));
                     list.RemoveAt(index);
                     count--;
                 }
                 else
                 {
                     index++;
                 }
             }
             list3.Sort(TileSorter.Comparer);
             count = list3.Count;
             for (index = 0; index < count; index++)
             {
                 StaticItem item3 = (StaticItem) list3[index];
                 MultiItem item4 = new MultiItem {
                     X = (short) j,
                     Y = (short) k,
                     Z = item3.Z,
                     ItemID = (short) ((item3.ID & 0x3fff) | 0x4000),
                     Flags = item3.Serial
                 };
                 list2.Add(item4);
             }
         }
     }
     Engine.m_MultiList = list2;
 }
Beispiel #3
0
 private static void Command_ExtendedStatus(PacketReader pvSrc)
 {
     int num = pvSrc.ReadByte();
     Mobile mobile = World.FindMobile(pvSrc.ReadInt32());
     if (mobile != null)
     {
         mobile.Bonded = pvSrc.ReadBoolean();
         if (num >= 2)
         {
             int num2 = pvSrc.ReadByte();
             if (num >= 3)
             {
                 pvSrc.Trace();
             }
         }
     }
 }
Beispiel #4
0
 private static void Command_Damage(PacketReader pvSrc)
 {
     if (pvSrc.ReadByte() != 1)
     {
         pvSrc.Trace();
     }
     Mobile m = World.FindMobile(pvSrc.ReadInt32());
     if (m != null)
     {
         int damage = pvSrc.ReadByte();
         if (damage > 0)
         {
             Gumps.Desktop.Children.Add(new GDamageLabel(damage, m));
         }
     }
 }
Beispiel #5
0
 private static void CharacterList(PacketReader pvSrc)
 {
     bool flag;
     byte num = pvSrc.ReadByte();
     Cursor.Hourglass = false;
     Engine.CharacterCount = num;
     string[] strArray = Engine.CharacterNames = new string[5];
     int num2 = 0;
     for (int i = 0; i < 5; i++)
     {
         Engine.CharacterNames[i] = strArray[i] = pvSrc.ReadString(60);
         if (strArray[i].Length > 0)
         {
             num2++;
         }
     }
     pvSrc.ReadString(60);
     int num4 = pvSrc.ReadByte();
     while (--num4 >= 0)
     {
         byte num5 = pvSrc.ReadByte();
         string str = pvSrc.ReadString(0x1f);
         string str2 = pvSrc.ReadString(0x1f);
     }
     if (!pvSrc.Finished)
     {
         int num6 = pvSrc.ReadInt32();
         Engine.ServerFeatures.SingleChar = (num6 & 4) != 0;
         Engine.ServerFeatures.ContextMenus = (num6 & 8) != 0;
         Engine.ServerFeatures.AOS = (num6 & 0x20) != 0;
         if ((num6 & 4) != 0)
         {
             flag = num2 < 1;
         }
         else
         {
             flag = num2 < 5;
         }
     }
     else
     {
         flag = num2 < 5;
     }
     if (Engine.m_QuickLogin)
     {
         CharacterProfile charProfile = Engine.m_QuickEntry.CharProfile;
         if (charProfile != null)
         {
             ShardProfile shard = charProfile.Shard;
             for (int j = 0; j < 5; j++)
             {
                 string name = Engine.CharacterNames[j];
                 if (name.Length > 0)
                 {
                     CharacterProfile profile3 = null;
                     for (int k = 0; (profile3 == null) && (k < shard.Characters.Length); k++)
                     {
                         if (shard.Characters[k].Index == j)
                         {
                             profile3 = shard.Characters[k];
                         }
                     }
                     if (profile3 != null)
                     {
                         profile3.Name = name;
                     }
                     else
                     {
                         shard.AddCharacter(new CharacterProfile(shard, name, j));
                     }
                 }
                 else
                 {
                     CharacterProfile character = null;
                     for (int m = 0; (character == null) && (m < shard.Characters.Length); m++)
                     {
                         if (shard.Characters[m].Index == j)
                         {
                             character = shard.Characters[m];
                         }
                     }
                     if (character != null)
                     {
                         shard.RemoveCharacter(character);
                     }
                 }
             }
             Array.Sort(shard.Characters, new CharacterComparer());
             Timer timer = new Timer(new OnTick(PacketHandlers.Update_OnTick), 0, 1);
             timer.SetTag("shard", shard);
             timer.Start(false);
         }
         QuickLogin.Add(Engine.m_QuickEntry);
         Network.Send(new PCharSelect(Engine.m_QuickEntry.CharName, Engine.m_QuickEntry.CharID));
         if (Animations.IsLoading)
         {
             Gumps.Desktop.Children.Clear();
             xGumps.Display("AnimationLoad");
             do
             {
                 Engine.DrawNow();
             }
             while (!Animations.WaitLoading());
         }
         Gumps.Desktop.Children.Clear();
         xGumps.Display("EnterBritannia");
         Engine.DrawNow();
     }
     else
     {
         xGumps.SetVariable("CharSlotAvailable", flag ? "1" : "0");
         Gumps.Desktop.Children.Clear();
         xGumps.Display("CharacterList");
         int index = 0;
         int num11 = 0;
         while (index < 5)
         {
             if (strArray[index].Length > 0)
             {
                 xGumps.SetVariable("CharName", strArray[index]);
                 xGumps.SetVariable("CharDisplayIndex", num11++.ToString());
                 xGumps.SetVariable("CharIndex", index.ToString());
                 xGumps.Display("CharacterEntry", "CharacterList");
             }
             index++;
         }
     }
 }
Beispiel #6
0
 private static void BulletinBoard_SetBody(PacketReader pvSrc)
 {
     Item board = World.FindItem(pvSrc.ReadInt32());
     if (board != null)
     {
         Item item2 = World.WantItem(pvSrc.ReadInt32());
         if (item2 != null)
         {
             int serial = pvSrc.ReadInt32();
             Item thread = null;
             if (serial >= 0x40000000)
             {
                 thread = World.WantItem(serial);
             }
             string poster = BulletinBoard_ReadString(pvSrc);
             string subject = BulletinBoard_ReadString(pvSrc);
             string time = BulletinBoard_ReadString(pvSrc);
             item2.BulletinHeader = new BBMessageHeader(board, thread, poster, subject, time);
             int body = pvSrc.ReadUInt16();
             int hue = pvSrc.ReadUInt16();
             BBPAItem[] items = new BBPAItem[pvSrc.ReadByte()];
             for (int i = 0; i < items.Length; i++)
             {
                 items[i].ItemID = pvSrc.ReadUInt16();
                 items[i].Hue = pvSrc.ReadUInt16();
             }
             string[] lines = new string[pvSrc.ReadByte()];
             for (int j = 0; j < lines.Length; j++)
             {
                 lines[j] = BulletinBoard_ReadString(pvSrc);
             }
             item2.BulletinBody = new BBMessageBody(new BBPosterAppearance(body, hue, items), lines);
         }
     }
 }
Beispiel #7
0
        private static void BulletinBoard(PacketReader pvSrc)
        {
            switch (pvSrc.ReadByte())
            {
                case 0:
                    BulletinBoard_Display(pvSrc);
                    break;

                case 1:
                    BulletinBoard_SetHeader(pvSrc);
                    break;

                case 2:
                    BulletinBoard_SetBody(pvSrc);
                    break;

                default:
                    pvSrc.Trace();
                    break;
            }
        }
Beispiel #8
0
 private static void Weather(PacketReader pvSrc)
 {
     int num = pvSrc.ReadByte();
     int num2 = pvSrc.ReadByte();
     int num3 = pvSrc.ReadSByte();
 }
Beispiel #9
0
        private static void Sequence(PacketReader pvSrc)
        {
            byte num = pvSrc.ReadByte();
            if (num > 1)
            {
                pvSrc.Trace();
            }
            else
            {
                switch (num)
                {
                    case 0:
                        if (Engine.Effects.Locked)
                        {
                            pvSrc.Trace();
                        }
                        else
                        {
                            Engine.Effects.Lock();
                        }
                        break;

                    case 1:
                        if (!Engine.Effects.Locked)
                        {
                            pvSrc.Trace();
                        }
                        else
                        {
                            Engine.Effects.Unlock();
                        }
                        break;
                }
            }
        }
Beispiel #10
0
        private static void SecureTrade(PacketReader pvSrc)
        {
            byte num = pvSrc.ReadByte();
            int serial = pvSrc.ReadInt32();
            switch (num)
            {
                case 0:
                    pvSrc.ReturnName = "Initiate Secure Trade";
                    SecureTrade_Open(serial, pvSrc);
                    break;

                case 1:
                    pvSrc.ReturnName = "Close Secure Trade";
                    SecureTrade_Close(serial, pvSrc);
                    break;

                case 2:
                    pvSrc.ReturnName = "Update Secure Trade Status";
                    SecureTrade_Check(serial, pvSrc);
                    break;

                default:
                    pvSrc.Trace();
                    break;
            }
        }
Beispiel #11
0
 private static void Season(PacketReader pvSrc)
 {
     int num = pvSrc.ReadByte();
     int num2 = pvSrc.ReadByte();
     if (num > 4)
     {
         pvSrc.Trace();
     }
     else if (num2 > 1)
     {
         pvSrc.Trace();
     }
 }
Beispiel #12
0
 private static void ScrollMessage(PacketReader pvSrc)
 {
     int num = pvSrc.ReadByte();
     int num2 = pvSrc.ReadInt32();
     string text = pvSrc.ReadString(pvSrc.ReadUInt16());
     if (text != "MISSING UPDATE")
     {
         Gumps.Desktop.Children.Add(new GUpdateScroll(text));
     }
 }
Beispiel #13
0
 private static void ReviseUpdateRange(PacketReader pvSrc)
 {
     World.Range = pvSrc.ReadByte();
 }
Beispiel #14
0
 private static void PropertyListContent(PacketReader pvSrc)
 {
     int num = pvSrc.ReadUInt16();
     int serial = pvSrc.ReadInt32();
     int num3 = pvSrc.ReadByte();
     int num4 = pvSrc.ReadByte();
     int number = pvSrc.ReadInt32();
     if (((num != 1) || (num3 != 0)) || (num4 != 0))
     {
         pvSrc.Trace();
     }
     ArrayList dataStore = Engine.GetDataStore();
     while (true)
     {
         int num6 = pvSrc.ReadInt32();
         if (num6 == 0)
         {
             break;
         }
         int length = pvSrc.ReadUInt16();
         string arguments = Encoding.Unicode.GetString(pvSrc.ReadBytes(length));
         dataStore.Add(new ObjectProperty(num6, arguments));
     }
     ObjectPropertyList list2 = new ObjectPropertyList(serial, number, (ObjectProperty[]) dataStore.ToArray(typeof(ObjectProperty)));
     Engine.ReleaseDataStore(dataStore);
     Item item = World.FindItem(serial);
     if (item != null)
     {
         item.PropertyID = number;
     }
     Mobile mobile = World.FindMobile(serial);
     if (mobile != null)
     {
         mobile.PropertyID = number;
     }
     if (item != null)
     {
         object parent = item;
         bool flag = false;
         while (parent != null)
         {
             if (!(parent is Item))
             {
                 break;
             }
             Item item2 = (Item) parent;
             if (((item2.Container != null) && (item2.Container.Gump is GContainer)) && ((GContainer) item2.Container.Gump).m_TradeContainer)
             {
                 flag = true;
             }
             if (flag)
             {
                 break;
             }
             parent = item2.Parent;
         }
         if (flag && (parent is Item))
         {
             Item item3 = (Item) parent;
             if ((item3.Container != null) && (item3.Container.Gump.Tooltip is ItemTooltip))
             {
                 GObjectProperties gump = ((ItemTooltip) item3.Container.Gump.Tooltip).Gump as GObjectProperties;
                 if (gump != null)
                 {
                     gump.SetList(0xf9060 + (item3.ID & 0x3fff), item3.PropertyList);
                 }
             }
         }
     }
 }
Beispiel #15
0
 private static void PlaySound(PacketReader pvSrc)
 {
     byte num = pvSrc.ReadByte();
     short soundID = pvSrc.ReadInt16();
     short num3 = pvSrc.ReadInt16();
     short x = pvSrc.ReadInt16();
     short y = pvSrc.ReadInt16();
     short z = pvSrc.ReadInt16();
     if (num > 1)
     {
         pvSrc.Trace();
     }
     if (soundID >= 0)
     {
         Engine.Sounds.PlaySound(soundID, x, y, z, 0.75f);
     }
 }
Beispiel #16
0
 private static void Target(PacketReader pvSrc)
 {
     byte num = pvSrc.ReadByte();
     int targetID = pvSrc.ReadInt32();
     byte num3 = pvSrc.ReadByte();
     int num4 = pvSrc.ReadInt32();
     short num5 = pvSrc.ReadInt16();
     short num6 = pvSrc.ReadInt16();
     byte num7 = pvSrc.ReadByte();
     sbyte num8 = pvSrc.ReadSByte();
     short num9 = pvSrc.ReadInt16();
     if (m_CancelTarget)
     {
         m_CancelTarget = false;
     }
     else if (num3 == 3)
     {
         if (Engine.TargetHandler is ServerTargetHandler)
         {
             Engine.TargetHandler.OnCancel(TargetCancelType.UserCancel);
             Engine.TargetHandler = null;
         }
     }
     else
     {
         ServerTargetHandler handler;
         m_TimeLastCast = DateTime.Now;
         Engine.m_LastTargetID = targetID;
         if ((num > 1) || (((num3 != 1) && (num3 != 2)) && (num3 != 0)))
         {
             pvSrc.Trace();
         }
         Engine.TargetHandler = handler = new ServerTargetHandler(targetID, num != 1, (ServerTargetFlags) num3);
         TargetActions.Identify();
         if (handler.Action != TargetAction.Unknown)
         {
             for (int i = 0; i < Engine.m_AutoTarget.Count; i++)
             {
                 AutoTargetSession session = (AutoTargetSession) Engine.m_AutoTarget[i];
                 if (session.m_Action == handler.Action)
                 {
                     session.m_Timer.Delete();
                     Engine.m_AutoTarget.RemoveAt(i);
                     Engine.Target(session.m_Entity);
                     break;
                 }
             }
         }
     }
 }
Beispiel #17
0
 private static void WarmodeStatus(PacketReader pvSrc)
 {
     bool flag = pvSrc.ReadBoolean();
     if (pvSrc.ReadByte() == 0)
     {
         byte num = pvSrc.ReadByte();
         if (((num != 0x20) && (num != 50)) && (num != 0))
         {
             pvSrc.Trace();
         }
         else if (pvSrc.ReadByte() != 0)
         {
             pvSrc.Trace();
         }
     }
     Mobile player = World.Player;
     if (player != null)
     {
         player.Flags[MobileFlag.Warmode] = flag;
         if (!flag)
         {
             Engine.m_Highlight = null;
         }
         if (player.Paperdoll != null)
         {
             Gumps.OpenPaperdoll(player, player.PaperdollName, player.PaperdollCanDrag);
         }
     }
     Gumps.Invalidate();
     Engine.Redraw();
 }
Beispiel #18
0
 private static void ServerList(PacketReader pvSrc)
 {
     pvSrc.ReadByte();
     int num = pvSrc.ReadInt16();
     if (num <= 0)
     {
         Gumps.Desktop.Children.Clear();
         xGumps.SetVariable("FailMessage", "The Ultima Online servers are currently down. Please try again in a few moments.");
         xGumps.Display("ConnectionFailed");
         Cursor.Hourglass = false;
     }
     else
     {
         Server[] array = new Server[num];
         Server server = null;
         for (int i = 0; i < num; i++)
         {
             array[i] = new Server(pvSrc.ReadInt16(), pvSrc.ReadString(0x20), pvSrc.ReadByte(), pvSrc.ReadSByte(), new IPAddress((long) pvSrc.ReadUInt32()));
             if (array[i].ServerID == NewConfig.LastServerID)
             {
                 server = array[i];
             }
         }
         Array.Sort(array);
         Engine.Servers = array;
         Engine.LastServer = server;
         if (Engine.m_QuickLogin)
         {
             for (int j = 0; j < array.Length; j++)
             {
                 if ((array[j].ServerID == Engine.m_QuickEntry.ServerID) && (array[j].Name == Engine.m_QuickEntry.ServerName))
                 {
                     array[j].Select();
                     Cursor.Hourglass = true;
                     Gumps.Desktop.Children.Clear();
                     xGumps.Display("Connecting");
                     Engine.DrawNow();
                     return;
                 }
             }
             Cursor.Hourglass = false;
             Gumps.Desktop.Children.Clear();
             xGumps.SetVariable("FailMessage", "That server was not found on the server list.");
             xGumps.Display("ConnectionFailed");
             Engine.DrawNow();
         }
         else
         {
             Cursor.Hourglass = false;
             Gumps.Desktop.Children.Clear();
             xGumps.Display("ServerList");
         }
     }
 }
Beispiel #19
0
 private static void WorldItem(PacketReader pvSrc)
 {
     int serial = pvSrc.ReadInt32();
     int itemID = pvSrc.ReadUInt16();
     int num3 = ((serial & 0x80000000L) != 0L) ? pvSrc.ReadInt16() : 0;
     if ((itemID & 0x8000) != 0)
     {
         itemID &= 0x7fff;
         itemID += pvSrc.ReadSByte();
     }
     int num4 = pvSrc.ReadInt16();
     int num5 = pvSrc.ReadInt16();
     bool flag2 = (num4 & 0x8000) != 0;
     bool flag3 = (num5 & 0x8000) != 0;
     bool flag4 = (num5 & 0x4000) != 0;
     int num6 = flag2 ? pvSrc.ReadByte() : 0;
     int num7 = pvSrc.ReadSByte();
     int hue = flag3 ? pvSrc.ReadUInt16() : 0;
     int num9 = flag4 ? pvSrc.ReadByte() : 0;
     serial &= 0x7fffffff;
     num4 &= 0x7fff;
     num5 &= 0x3fff;
     bool wasFound = false;
     Item i = World.WantItem(serial, ref wasFound);
     bool isMulti = i.IsMulti;
     i.IsMulti = itemID >= 0x4000;
     int id = 0;
     if (i.IsMulti)
     {
         id = itemID & 0x3fff;
         Engine.Multis.Register(i, id);
         itemID = 1;
     }
     else if (isMulti)
     {
         Engine.Multis.Unregister(i);
     }
     Engine.ItemArt.Translate(ref itemID, ref hue);
     itemID &= 0x3fff;
     i.SetLocation((short) num4, (short) num5, (short) num7);
     i.ID = (short) itemID;
     i.Amount = (short) num3;
     i.Direction = (byte) num6;
     i.Hue = (ushort) hue;
     i.Flags.Value = num9;
     if ((!i.Visible && (i.IsCorpse || i.IsBones)) && World.CharData.IncomingNames)
     {
         i.Look();
     }
     i.Visible = true;
     i.InWorld = true;
     if (i.IsEquip)
     {
         i.RemoveEquip();
     }
     if (i.Parent != null)
     {
         i.Parent.RemoveItem(i);
     }
     if ((itemID == 0x2006) && (i.CorpseSerial != 0))
     {
         Mobile mobile = World.FindMobile(i.CorpseSerial);
         if (mobile != null)
         {
             i.Direction = mobile.Direction;
             i.Visible = false;
         }
     }
     i.Update();
     if (i.IsMulti && Engine.GMPrivs)
     {
         Engine.AddTextMessage(string.Format("House serial: 0x{0:X}", serial));
     }
 }
Beispiel #20
0
 private static void ServerRelay(PacketReader pvSrc)
 {
     int serverIP = ((pvSrc.ReadByte() | (pvSrc.ReadByte() << 8)) | (pvSrc.ReadByte() << 0x10)) | (pvSrc.ReadByte() << 0x18);
     int port = pvSrc.ReadInt16();
     int gameSeed = pvSrc.ReadInt32();
     Network.Disconnect();
     if (!Network.Connect(serverIP, port))
     {
         Gumps.Desktop.Children.Clear();
         xGumps.SetVariable("FailMessage", "Couldn't connect to the game server.  Either the server is down, or an invalid host / port was specified in the server ini.");
         xGumps.Display("ConnectionFailed");
         Cursor.Hourglass = false;
     }
     else
     {
         Network.EnableUnpacking();
         Network.Send(new PGameSeed(gameSeed));
         if (Engine.m_QuickLogin)
         {
             Network.Send(new PGameLogin(gameSeed, Engine.m_QuickEntry.AccountName, Engine.m_QuickEntry.Password));
         }
         else
         {
             Network.Send(new PGameLogin(gameSeed, NewConfig.Username, NewConfig.Password));
         }
         Network.CheckCache();
     }
 }
Beispiel #21
0
 private static string BulletinBoard_ReadString(PacketReader pvSrc)
 {
     int length = pvSrc.ReadByte();
     byte[] bytes = pvSrc.ReadBytes(length);
     for (int i = 0; i < length; i++)
     {
         if (bytes[i] == 0)
         {
             length = i;
             break;
         }
     }
     return Encoding.UTF8.GetString(bytes, 0, length);
 }
Beispiel #22
0
 private static void ShopContent(PacketReader pvSrc)
 {
     int num = pvSrc.ReadInt32();
     int num2 = pvSrc.ReadByte();
     if (num2 > 0)
     {
         m_BuyMenuSerial = num;
         m_BuyMenuNames = new string[num2];
         m_BuyMenuPrices = new int[num2];
         for (int i = 0; i < num2; i++)
         {
             m_BuyMenuPrices[i] = pvSrc.ReadInt32();
             string str = pvSrc.ReadString(pvSrc.ReadByte());
             try
             {
                 str = Localization.GetString(Convert.ToInt32(str));
             }
             catch
             {
             }
             m_BuyMenuNames[i] = str;
         }
     }
 }
Beispiel #23
0
 private static void ChangeCharacter(PacketReader pvSrc)
 {
     int num = pvSrc.ReadByte();
     int num2 = pvSrc.ReadByte();
     string[] strArray = new string[5];
     for (int i = 0; i < 5; i++)
     {
         strArray[i] = pvSrc.ReadString(30);
         pvSrc.Seek(30, SeekOrigin.Current);
     }
     if (!pvSrc.Finished || (num2 != 0))
     {
         pvSrc.Trace();
     }
     Engine.AddTextMessage("That is not supported.");
 }
Beispiel #24
0
        private static void Skills(PacketReader pvSrc)
        {
            switch (pvSrc.ReadByte())
            {
                case 0:
                    pvSrc.ReturnName = "Skills (Absolute)";
                    Skills_Absolute(pvSrc, false);
                    return;

                case 2:
                    pvSrc.ReturnName = "Skills (Absolute, Capped)";
                    Skills_Absolute(pvSrc, true);
                    return;

                case 0xdf:
                    pvSrc.ReturnName = "Skills (Delta, Capped)";
                    Skills_Delta(pvSrc, true);
                    return;

                case 0xff:
                    pvSrc.ReturnName = "Skills (Delta)";
                    Skills_Delta(pvSrc, false);
                    return;
            }
            pvSrc.Trace();
        }
Beispiel #25
0
 private static void CloseShopDialog(PacketReader pvSrc)
 {
     int num = pvSrc.ReadInt32();
     if (pvSrc.ReadByte() != 0)
     {
         pvSrc.Trace();
     }
     Gumps.Destroy(Gumps.FindGumpByGUID(string.Format("GSellGump-{0}", num)));
     Gumps.Destroy(Gumps.FindGumpByGUID(string.Format("GBuyGump-{0}", num)));
 }
Beispiel #26
0
 private static void Skills_Absolute(PacketReader pvSrc, bool hasCapData)
 {
     int num;
     Client.Skills skills = Engine.Skills;
     while ((num = pvSrc.ReadInt16()) > 0)
     {
         Skill skill = skills[num - 1];
         if (skill != null)
         {
             skill.Value = ((float) pvSrc.ReadInt16()) / 10f;
             skill.Real = ((float) pvSrc.ReadInt16()) / 10f;
             skill.Lock = (SkillLock) pvSrc.ReadByte();
             if (hasCapData)
             {
                 pvSrc.Seek(2, SeekOrigin.Current);
             }
             if (Engine.m_SkillsOpen && (Engine.m_SkillsGump != null))
             {
                 Engine.m_SkillsGump.OnSkillChange(skill);
             }
         }
     }
 }
Beispiel #27
0
 private static void Command_EditCustomHouse(PacketReader pvSrc)
 {
     if (World.FindItem(pvSrc.ReadInt32()) != null)
     {
         int num = pvSrc.ReadByte();
     }
 }
Beispiel #28
0
 private static void Skills_Delta(PacketReader pvSrc, bool hasCapData)
 {
     Skill skill = Engine.Skills[pvSrc.ReadInt16()];
     if (skill != null)
     {
         float num = ((float) pvSrc.ReadInt16()) / 10f;
         if (skill.Value != num)
         {
             float num2 = num - skill.Value;
             int num3 = Math.Sign(num2);
             Engine.AddTextMessage(string.Format("Your skill in {0} has {1} by {2:F1}. Is it now {3:F1}.", new object[] { skill.Name, (num2 > 0f) ? "increased" : "decreased", Math.Abs(num2), num }), Engine.GetFont(3), Hues.Load(0x59));
             skill.Value = num;
         }
         skill.Real = ((float) pvSrc.ReadInt16()) / 10f;
         skill.Lock = (SkillLock) pvSrc.ReadByte();
         if (hasCapData)
         {
             pvSrc.Seek(2, SeekOrigin.Current);
         }
         if (Engine.m_SkillsOpen && (Engine.m_SkillsGump != null))
         {
             Engine.m_SkillsGump.OnSkillChange(skill);
         }
     }
 }
Beispiel #29
0
 private static void StringQuery(PacketReader pvSrc)
 {
     GDragable dragable;
     GWrappedLabel label2;
     int num = pvSrc.ReadInt32();
     short num2 = pvSrc.ReadInt16();
     int fixedLength = pvSrc.ReadInt16();
     string text = pvSrc.ReadString(fixedLength);
     bool flag = pvSrc.ReadBoolean();
     byte num4 = pvSrc.ReadByte();
     int num5 = pvSrc.ReadInt32();
     int num6 = pvSrc.ReadInt16();
     string str2 = pvSrc.ReadString(num6);
     dragable = new GDragable(0x474, 0, 0) {
         CanClose = false,
         Modal = true,
         X = (Engine.ScreenWidth - dragable.Width) / 2,
         Y = (Engine.ScreenHeight - dragable.Height) / 2
     };
     GButton toAdd = new GButton(0x47b, 0x47d, 0x47c, 0x75, 190, new OnClick(Engine.StringQueryOkay_OnClick));
     GButton button2 = new GButton(0x478, 0x47a, 0x479, 0xcc, 190, flag ? new OnClick(Engine.StringQueryCancel_OnClick) : null);
     if (!flag)
     {
         button2.Enabled = false;
     }
     GImage image = new GImage(0x477, 60, 0x91);
     GWrappedLabel label = new GWrappedLabel(text, Engine.GetFont(2), Hues.Load(0x455), 60, 0x30, 0x110);
     label2 = new GWrappedLabel(str2, Engine.GetFont(2), Hues.Load(0x455), 60, 0x30, 0x110) {
         Y = image.Y - label2.Height
     };
     GTextBox box = new GTextBox(0, false, 0x44, 140, image.Width - 8, image.Height, "", Engine.GetFont(1), Hues.Load(0x455), Hues.Load(0x455), Hues.Load(0x455));
     box.Focus();
     if (num4 == 1)
     {
         box.MaxChars = num5;
     }
     toAdd.SetTag("Dialog", dragable);
     toAdd.SetTag("Serial", num);
     toAdd.SetTag("Type", num2);
     toAdd.SetTag("Text", box);
     button2.SetTag("Dialog", dragable);
     button2.SetTag("Serial", num);
     button2.SetTag("Type", num2);
     dragable.Children.Add(label);
     dragable.Children.Add(label2);
     dragable.Children.Add(image);
     dragable.Children.Add(box);
     dragable.Children.Add(button2);
     dragable.Children.Add(toAdd);
     dragable.m_CanDrag = true;
     Gumps.Desktop.Children.Add(dragable);
 }
Beispiel #30
0
 private static void Movement_Reject(PacketReader pvSrc)
 {
     m_Sequences.Clear();
     Engine.m_Sequence = 0;
     Engine.m_WalkReq = 0;
     Engine.m_WalkAck = 0;
     Mobile player = World.Player;
     if (player != null)
     {
         pvSrc.ReadByte();
         short x = pvSrc.ReadInt16();
         short y = pvSrc.ReadInt16();
         byte dir = pvSrc.ReadByte();
         if (player.Direction != dir)
         {
             player.Direction = dir;
             player.Equip.Sort(LayerComparer.FromDirection(dir));
         }
         sbyte z = pvSrc.ReadSByte();
         World.SetLocation(x, y, z);
         player.SetLocation(x, y, z);
         player.MovedTiles = 0;
         player.HorseFootsteps = 0;
         player.IsMoving = false;
         player.Walking.Clear();
         player.UpdateReal();
         player.Update();
     }
 }