Ejemplo n.º 1
0
            public void Read(WorldPacket data)
            {
                RideTicket = new RideTicket();
                RideTicket.Read(data);

                GroupFinderActivityID     = data.ReadUInt32();
                LastTitleAuthorGuid       = data.ReadPackedGuid();
                LastDescriptionAuthorGuid = data.ReadPackedGuid();
                LastVoiceChatAuthorGuid   = data.ReadPackedGuid();

                byte titleLength       = data.ReadBits <byte>(8);
                byte descriptionLength = data.ReadBits <byte>(11);
                byte voiceChatLength   = data.ReadBits <byte>(8);

                Title       = data.ReadString(titleLength);
                Description = data.ReadString(descriptionLength);
                VoiceChat   = data.ReadString(voiceChatLength);
            }
Ejemplo n.º 2
0
            public void Read(WorldPacket data)
            {
                Timestamp  = data.ReadInt32();
                AuthorGUID = data.ReadPackedGuid();

                bool hasClubID       = data.HasBit();
                bool hasChannelGUID  = data.HasBit();
                bool hasRealmAddress = data.HasBit();
                bool hasSlashCmd     = data.HasBit();
                uint textLength      = data.ReadBits <uint>(12);

                if (hasClubID)
                {
                    ClubID.HasValue = true;
                    ClubID.Value    = data.ReadUInt64();
                }

                if (hasChannelGUID)
                {
                    ChannelGUID.HasValue = true;
                    ChannelGUID.Value    = data.ReadPackedGuid();
                }

                if (hasRealmAddress)
                {
                    RealmAddress.HasValue = true;
                    RealmAddress.Value.VirtualRealmAddress = data.ReadUInt32();
                    RealmAddress.Value.field_4             = data.ReadUInt16();
                    RealmAddress.Value.field_6             = data.ReadUInt8();
                }

                if (hasSlashCmd)
                {
                    SlashCmd.HasValue = true;
                    SlashCmd.Value    = data.ReadInt32();
                }

                Text = data.ReadString(textLength);
            }
Ejemplo n.º 3
0
        public void Read(WorldPacket data)
        {
            Guid      = data.ReadPackedGuid();
            Status    = data.ReadUInt8();
            Moderator = data.ReadUInt8();

            bool hasUnused801_1 = data.HasBit();
            bool hasUnused801_2 = data.HasBit();
            bool hasUnused801_3 = data.HasBit();

            if (hasUnused801_1)
            {
                Unused801_1.Set(data.ReadPackedGuid());
            }
            if (hasUnused801_2)
            {
                Unused801_2.Set(data.ReadUInt64());
            }
            if (hasUnused801_3)
            {
                Unused801_3.Set(data.ReadUInt64());
            }
        }
Ejemplo n.º 4
0
        public static void ReadTransportInfo(WorldPacket data, ref MovementInfo.TransportInfo transportInfo)
        {
            transportInfo.guid            = data.ReadPackedGuid();      // Transport Guid
            transportInfo.pos.posX        = data.ReadFloat();
            transportInfo.pos.posY        = data.ReadFloat();
            transportInfo.pos.posZ        = data.ReadFloat();
            transportInfo.pos.Orientation = data.ReadFloat();
            transportInfo.seat            = data.ReadInt8();      // VehicleSeatIndex
            transportInfo.time            = data.ReadUInt32();    // MoveTime

            bool hasPrevTime  = data.HasBit();
            bool hasVehicleId = data.HasBit();

            if (hasPrevTime)
            {
                transportInfo.prevTime = data.ReadUInt32();         // PrevMoveTime
            }
            if (hasVehicleId)
            {
                transportInfo.vehicleId = data.ReadUInt32();        // VehicleRecID
            }
        }
Ejemplo n.º 5
0
        //[WorldPacketHandler(ClientOpcodes.MasterLootItem)]
        void HandleLootMasterGive(WorldPacket packet)
        {
            ObjectGuid lootguid          = packet.ReadPackedGuid();
            byte       slotid            = packet.ReadUInt8();
            ObjectGuid target_playerguid = packet.ReadPackedGuid();

            if (GetPlayer().GetGroup() == null || GetPlayer().GetGroup().GetLooterGuid() != GetPlayer().GetGUID() || GetPlayer().GetGroup().GetLootMethod() != LootMethod.MasterLoot)
            {
                GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.DidntKill);
                return;
            }

            // player on other map
            Player target = Global.ObjAccessor.GetPlayer(_player, target_playerguid);

            if (!target)
            {
                GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.PlayerNotFound);
                return;
            }

            Log.outDebug(LogFilter.Network, "HandleLootMasterGive (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [{0}].", target.GetName());

            if (GetPlayer().GetLootGUID() != lootguid)
            {
                GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.DidntKill);
                return;
            }

            if (!GetPlayer().IsInRaidWith(target) || !GetPlayer().IsInMap(target))
            {
                GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.MasterOther);
                Log.outInfo(LogFilter.Loot, "MasterLootItem: Player {0} tried to give an item to ineligible player {1}!", GetPlayer().GetName(), target.GetName());
                return;
            }

            Loot loot = null;

            if (GetPlayer().GetLootGUID().IsCreatureOrVehicle())
            {
                Creature creature = GetPlayer().GetMap().GetCreature(lootguid);
                if (creature == null)
                {
                    return;
                }

                loot = creature.loot;
            }
            else if (GetPlayer().GetLootGUID().IsGameObject())
            {
                GameObject pGO = GetPlayer().GetMap().GetGameObject(lootguid);
                if (pGO == null)
                {
                    return;
                }

                loot = pGO.loot;
            }

            if (loot == null)
            {
                return;
            }

            if (slotid >= loot.items.Count + loot.quest_items.Count)
            {
                Log.outDebug(LogFilter.Loot, "MasterLootItem: Player {0} might be using a hack! (slot {1}, size {2})",
                             GetPlayer().GetName(), slotid, loot.items.Count);
                return;
            }

            LootItem item = slotid >= loot.items.Count ? loot.quest_items[slotid - loot.items.Count] : loot.items[slotid];

            List <ItemPosCount> dest = new List <ItemPosCount>();
            InventoryResult     msg  = target.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, item.itemid, item.count);

            if (item.follow_loot_rules && !item.AllowedForPlayer(target))
            {
                msg = InventoryResult.CantEquipEver;
            }
            if (msg != InventoryResult.Ok)
            {
                if (msg == InventoryResult.ItemMaxCount)
                {
                    GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.MasterUniqueItem);
                }
                else if (msg == InventoryResult.InvFull)
                {
                    GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.MasterInvFull);
                }
                else
                {
                    GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.MasterOther);
                }

                target.SendEquipError(msg, null, null, item.itemid);
                return;
            }

            // not move item from loot to target inventory
            Item newitem = target.StoreNewItem(dest, item.itemid, true, item.randomBonusListId, item.GetAllowedLooters(), item.context, item.BonusListIDs);

            target.SendNewItem(newitem, item.count, false, false, true);
            target.UpdateCriteria(CriteriaTypes.LootItem, item.itemid, item.count);
            target.UpdateCriteria(CriteriaTypes.LootType, item.itemid, item.count, (ulong)loot.loot_type);
            target.UpdateCriteria(CriteriaTypes.LootEpicItem, item.itemid, item.count);

            // mark as looted
            item.count     = 0;
            item.is_looted = true;

            loot.NotifyItemRemoved(slotid);
            --loot.unlootedCount;
        }
Ejemplo n.º 6
0
 public void Read(WorldPacket data)
 {
     PlayerGuid       = data.ReadPackedGuid();
     RealmAddress     = data.ReadUInt32();
     TimeSinceOffence = data.ReadUInt32();
 }
Ejemplo n.º 7
0
            public void Read(WorldPacket data)
            {
                PetID = data.ReadPackedGuid();

                PetName = data.ReadString(data.ReadBits <byte>(8));
            }
Ejemplo n.º 8
0
 public AuctionItemForSale(WorldPacket data)
 {
     Guid     = data.ReadPackedGuid();
     UseCount = data.ReadUInt32();
 }
Ejemplo n.º 9
0
 public void Read(WorldPacket data)
 {
     VirtualRealmAddress = data.ReadUInt32();
     Guid = data.ReadPackedGuid();
 }
Ejemplo n.º 10
0
 public void Read(WorldPacket data)
 {
     Guid      = data.ReadPackedGuid();
     Status    = data.ReadUInt8();
     Moderator = data.ReadUInt8();
 }