public void HandlePacket(GameClient client, GSPacketIn packet) { if (client.Player == null) return; uint X = packet.ReadInt(); uint Y = packet.ReadInt(); ushort id =(ushort) packet.ReadShort(); ushort obj=(ushort) packet.ReadShort(); GameObject target = client.Player.TargetObject; if (target == null) { client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "PlayerPickUpRequestHandler.HandlePacket.Target"), eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (target.ObjectState != GameObject.eObjectState.Active) { client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "PlayerPickUpRequestHandler.HandlePacket.InvalidTarget"), eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } client.Player.PickupObject(target, false); }
/// <summary> /// Reads up ONE character iteration on the packet stream /// </summary> /// <param name="packet"></param> /// <param name="client"></param> public CreationCharacterData(GSPacketIn packet, GameClient client) { //unk - probably indicates customize or create (these are moved from 1.99 4 added bytes) if (client.Version >= GameClient.eClientVersion.Version1104) packet.ReadIntLowEndian(); CharName = packet.ReadString(24); CustomMode = packet.ReadByte(); EyeSize = packet.ReadByte(); LipSize = packet.ReadByte(); EyeColor = packet.ReadByte(); HairColor = packet.ReadByte(); FaceType = packet.ReadByte(); HairStyle = packet.ReadByte(); packet.Skip(3); MoodType = packet.ReadByte(); packet.Skip(8); Operation = packet.ReadInt(); var unk = packet.ReadByte(); packet.Skip(24); //Location String packet.Skip(24); //Skip class name packet.Skip(24); //Skip race name var level = packet.ReadByte(); //not safe! Class = packet.ReadByte(); Realm = packet.ReadByte(); //The following byte contains //1bit=start location ... in ShroudedIsles you can choose ... //1bit=first race bit //1bit=unknown //1bit=gender (0=male, 1=female) //4bit=race byte startRaceGender = (byte)packet.ReadByte(); Race = (startRaceGender & 0x0F) + ((startRaceGender & 0x40) >> 2); Gender = ((startRaceGender >> 4) & 0x01); SIStartLocation = ((startRaceGender >> 7) != 0); CreationModel = packet.ReadShortLowEndian(); Region = packet.ReadByte(); packet.Skip(1); //TODO second byte of region unused currently packet.Skip(4); //TODO Unknown Int / last used? Strength = packet.ReadByte(); Dexterity = packet.ReadByte(); Constitution = packet.ReadByte(); Quickness = packet.ReadByte(); Intelligence = packet.ReadByte(); Piety = packet.ReadByte(); Empathy = packet.ReadByte(); Charisma = packet.ReadByte(); packet.Skip(40); //TODO equipment var activeRightSlot = packet.ReadByte(); // 0x9C var activeLeftSlot = packet.ReadByte(); // 0x9D var siZone = packet.ReadByte(); // 0x9E // skip 4 bytes added in 1.99 if (client.Version >= GameClient.eClientVersion.Version199 && client.Version < GameClient.eClientVersion.Version1104) packet.Skip(4); // New constitution must be read before skipping 4 bytes NewConstitution = packet.ReadByte(); // 0x9F }