示例#1
0
        public static void GetCharecterInfoRequest(IRealmClient client, RealmPacketIn packet)
        {
            packet.Position -= 4;
            Character characterBySessionId = World.GetCharacterBySessionId(packet.ReadUInt16());

            if (characterBySessionId == null)
            {
                client.ActiveCharacter.SendInfoMsg("Character not founded.");
            }
            else
            {
                Asda2TeleportHandler.SendCharacterFullInfoResponse(client, characterBySessionId);
                Asda2TeleportHandler.SendCharacterRegularEquipmentInfoResponse(client, characterBySessionId);
            }
        }
示例#2
0
        public static void DeleteSavedLocationRequest(IRealmClient client, RealmPacketIn packet)
        {
            byte num = packet.ReadByte();

            if (client.ActiveCharacter.TeleportPoints[(int)num] == null)
            {
                client.ActiveCharacter.SendInfoMsg("Can't delete, point not founded.");
                Asda2TeleportHandler.SendSavedLocationDeletedResponse(client, LocationSavedStatus.Fail, (short)-1);
            }
            else
            {
                Asda2TeleportingPointRecord teleportPoint = client.ActiveCharacter.TeleportPoints[(int)num];
                client.ActiveCharacter.TeleportPoints[(int)num] = (Asda2TeleportingPointRecord)null;
                teleportPoint.DeleteLater();
                Asda2TeleportHandler.SendSavedLocationDeletedResponse(client, LocationSavedStatus.Ok, (short)num);
            }
        }
示例#3
0
        public static void SaveLocationRequest(IRealmClient client, RealmPacketIn packet)
        {
            string name = packet.ReadAsdaString(32, Locale.Start);

            ++packet.Position;
            int    num1     = (int)packet.ReadByte();
            ushort pointNum = packet.ReadUInt16();
            int    num2     = (int)packet.ReadInt16();
            int    num3     = (int)packet.ReadInt16();

            if (pointNum > (ushort)9)
            {
                client.ActiveCharacter.YouAreFuckingCheater("Trying to save teleportation point with id more than 9.",
                                                            50);
                Asda2TeleportHandler.SendLocationSavedResponse(client, LocationSavedStatus.Fail,
                                                               (Asda2TeleportingPointRecord)null, (short)0);
            }
            else if (client.ActiveCharacter.TeleportPoints[(int)pointNum] == null)
            {
                ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage((Action)(() =>
                {
                    Asda2TeleportingPointRecord record = Asda2TeleportingPointRecord.CreateRecord(
                        client.ActiveCharacter.EntityId.Low, (short)client.ActiveCharacter.Position.X,
                        (short)client.ActiveCharacter.Position.Y, client.ActiveCharacter.MapId);
                    record.CreateLater();
                    client.ActiveCharacter.TeleportPoints[(int)pointNum] = record;
                    record.X = (short)client.ActiveCharacter.Position.X;
                    record.Y = (short)client.ActiveCharacter.Position.Y;
                    record.MapId = client.ActiveCharacter.MapId;
                    record.Name = name;
                    Asda2TeleportHandler.SendLocationSavedResponse(client, LocationSavedStatus.Ok, record,
                                                                   (short)pointNum);
                }));
            }
            else
            {
                Asda2TeleportingPointRecord teleportPoint = client.ActiveCharacter.TeleportPoints[(int)pointNum];
                teleportPoint.X     = (short)client.ActiveCharacter.Position.X;
                teleportPoint.Y     = (short)client.ActiveCharacter.Position.Y;
                teleportPoint.MapId = client.ActiveCharacter.MapId;
                teleportPoint.Name  = name;
                teleportPoint.SaveLater();
                Asda2TeleportHandler.SendLocationSavedResponse(client, LocationSavedStatus.Ok, teleportPoint,
                                                               (short)pointNum);
            }
        }
示例#4
0
        public static void DisplayItemRequest(IRealmClient client, RealmPacketIn packet)
        {
            ushort    sessId  = packet.ReadUInt16();
            byte      num     = packet.ReadByte();
            short     slotInq = packet.ReadInt16();
            Character characterBySessionId = World.GetCharacterBySessionId(sessId);
            Asda2Item asda2Item            = num == (byte)1
                ? client.ActiveCharacter.Asda2Inventory.GetShopShopItem(slotInq)
                : client.ActiveCharacter.Asda2Inventory.GetRegularItem(slotInq);

            if (asda2Item == null)
            {
                client.ActiveCharacter.SendInfoMsg("Item not founded.");
            }
            else
            {
                Asda2TeleportHandler.SendItemDisplayedResponse(client.ActiveCharacter, asda2Item, characterBySessionId);
            }
        }