Exemplo n.º 1
0
        public void Write(WorldPacket data)
        {
            data.WriteBit(PlayerGuid.HasValue);
            data.WriteInt32(Slot.Count);

            if (PlayerGuid.HasValue)
            {
                data.WritePackedGuid(PlayerGuid.Value);
            }

            foreach (LFGBlackListSlot slot in Slot)
            {
                slot.Write(data);
            }
        }
Exemplo n.º 2
0
 public void Write(WorldPacket data)
 {
     data.WritePackedGuid(GuildGUID);
     data.WriteUInt32(GuildVirtualRealm);
     data.WriteInt32(ClassRoles);
     data.WriteInt32(PlayStyle);
     data.WriteInt32(Availability);
     data.WriteUInt32(SecondsSinceCreated);
     data.WriteUInt32(SecondsUntilExpiration);
     data.WriteBits(GuildName.Length, 7);
     data.WriteBits(Comment.Length, 10);
     data.FlushBits();
     data.WriteString(GuildName);
     data.WriteString(Comment);
 }
Exemplo n.º 3
0
 public void Write(WorldPacket data)
 {
     data.WriteBits(Name.GetByteCount(), 6);
     data.WriteBits(VoiceStateID.GetByteCount(), 6);
     data.WriteBit(FromSocialQueue);
     data.WriteBit(VoiceChatSilenced);
     data.WritePackedGuid(GUID);
     data.WriteUInt8(Status);
     data.WriteUInt8(Subgroup);
     data.WriteUInt8(Flags);
     data.WriteUInt8(RolesAssigned);
     data.WriteUInt8(Class);
     data.WriteString(Name);
     data.WriteString(VoiceStateID);
 }
Exemplo n.º 4
0
        public void Write(WorldPacket data)
        {
            data.WritePackedGuid(Guid);
            data.WriteUInt64(InviteID);

            data.WriteUInt8(Level);
            data.WriteUInt8((byte)Status);
            data.WriteUInt8((byte)Moderator);
            data.WriteUInt8(InviteType);

            data.WritePackedTime(ResponseTime);

            data.WriteBits(Notes.GetByteCount(), 8);
            data.FlushBits();
            data.WriteString(Notes);
        }
Exemplo n.º 5
0
        public void Write(WorldPacket data)
        {
            data.WritePackedGuid(Guid);
            data.WriteUInt64(InviteID);

            data.WriteUInt8(Level);
            data.WriteUInt8(Status);
            data.WriteUInt8(Moderator);
            data.WriteUInt8(InviteType);

            data.WritePackedTime(ResponseTime);

            data.WriteBits(Notes.Length, 8);
            data.FlushBits();
            data.WriteString(Notes);
        }
Exemplo n.º 6
0
            public void Write(WorldPacket data)
            {
                data.WriteUInt16((ushort)MessageID);
                data.WriteUInt32(SequenceIndex);
                data.WriteBit(Speed.HasValue);
                data.WriteBit(KnockBack.HasValue);
                data.WriteBit(VehicleRecID.HasValue);
                data.WriteBit(CollisionHeight.HasValue);
                data.WriteBit(MovementForce_.HasValue);
                data.WriteBit(MovementForceGUID.HasValue);
                data.FlushBits();

                if (CollisionHeight.HasValue)
                {
                    data.WriteFloat(CollisionHeight.Value.Height);
                    data.WriteFloat(CollisionHeight.Value.Scale);
                    data.WriteBits(CollisionHeight.Value.Reason, 2);
                    data.FlushBits();
                }

                if (Speed.HasValue)
                {
                    data.WriteFloat(Speed.Value);
                }

                if (KnockBack.HasValue)
                {
                    data.WriteFloat(KnockBack.Value.HorzSpeed);
                    data.WriteVector2(KnockBack.Value.Direction);
                    data.WriteFloat(KnockBack.Value.InitVertSpeed);
                }

                if (VehicleRecID.HasValue)
                {
                    data.WriteInt32(VehicleRecID.Value);
                }

                if (MovementForceGUID.HasValue)
                {
                    data.WritePackedGuid(MovementForceGUID.Value);
                }

                if (MovementForce_.HasValue)
                {
                    MovementForce_.Value.Write(data);
                }
            }
Exemplo n.º 7
0
        public void Write(WorldPacket data)
        {
            data.WriteUInt32(Id);
            data.WriteUInt64(Quantity);
            data.WritePackedGuid(Player);
            data.WritePackedTime(Date);
            data.WriteUInt32(TimeFromStart);
            data.WriteUInt32(TimeFromCreate);
            data.WriteBits(Flags, 4);
            data.WriteBit(RafAcceptanceID.HasValue);
            data.FlushBits();

            if (RafAcceptanceID.HasValue)
            {
                data.WriteUInt64(RafAcceptanceID.Value);
            }
        }
Exemplo n.º 8
0
            public void Write(WorldPacket data)
            {
                data.WriteInt32(EnchantID);
                data.WriteInt32(OnUseEnchantmentID);
                data.WritePackedGuid(Creator);
                data.WriteInt32(Charges);
                data.WriteUInt32(MaxDurability);
                data.WriteUInt32(Durability);
                data.WriteBits(Gems.Count, 2);
                data.WriteBit(Lock);
                data.FlushBits();

                foreach (var gem in Gems)
                {
                    gem.Write(data);
                }
            }
Exemplo n.º 9
0
        public void Write(WorldPacket data)
        {
            data.WriteBit(PlayerGuid.HasValue);
            data.WriteInt32(Slot.Count);
            if (PlayerGuid.HasValue)
            {
                data.WritePackedGuid(PlayerGuid.Value);
            }

            foreach (LFGBlackListSlot lfgBlackListSlot in Slot)
            {
                data.WriteUInt32(lfgBlackListSlot.Slot);
                data.WriteUInt32(lfgBlackListSlot.Reason);
                data.WriteInt32(lfgBlackListSlot.SubReason1);
                data.WriteInt32(lfgBlackListSlot.SubReason2);
            }
        }
Exemplo n.º 10
0
 public void Write(WorldPacket data)
 {
     data.WritePackedGuid(RecruitGUID);
     data.WriteUInt32(RecruitVirtualRealm);
     data.WriteInt32(CharacterClass);
     data.WriteInt32(CharacterGender);
     data.WriteInt32(CharacterLevel);
     data.WriteInt32(ClassRoles);
     data.WriteInt32(PlayStyle);
     data.WriteInt32(Availability);
     data.WriteUInt32(SecondsSinceCreated);
     data.WriteUInt32(SecondsUntilExpiration);
     data.WriteBits(Name.GetByteCount(), 6);
     data.WriteBits(Comment.GetByteCount(), 10);
     data.FlushBits();
     data.WriteString(Name);
     data.WriteString(Comment);
 }
Exemplo n.º 11
0
        public void SendPetitionShowList(ObjectGuid guid)
        {
            Creature creature = GetPlayer().GetNPCIfCanInteractWith(guid, NPCFlags.Petitioner, NPCFlags2.None);

            if (!creature)
            {
                Log.outDebug(LogFilter.Network, "WORLD: HandlePetitionShowListOpcode - {0} not found or you can't interact with him.", guid.ToString());
                return;
            }

            WorldPacket data = new WorldPacket(ServerOpcodes.PetitionShowList);

            data.WritePackedGuid(guid);                                           // npc guid

            ServerPetitionShowList packet = new ServerPetitionShowList();

            packet.Unit  = guid;
            packet.Price = WorldConfig.GetUIntValue(WorldCfg.CharterCostGuild);
            SendPacket(packet);
        }
Exemplo n.º 12
0
        public void Write(WorldPacket data)
        {
            data.WritePackedGuid(CreatorGUID);
            data.WriteUInt8(Index);
            Item.Write(data);
            data.WriteBit(Usable);
            data.WriteBits(Enchants.Count, 4);
            data.WriteBits(Gems.Count, 2);
            data.FlushBits();

            foreach (var gem in Gems)
            {
                gem.Write(data);
            }

            for (int i = 0; i < Enchants.Count; ++i)
            {
                Enchants[i].Write(data);
            }
        }
Exemplo n.º 13
0
        public static void WriteMovementForceWithDirection(MovementForce movementForce, WorldPacket data, Position objectPosition = null)
        {
            data.WritePackedGuid(movementForce.ID);
            data.WriteVector3(movementForce.Origin);
            if (movementForce.Type == 1 && objectPosition != null) // gravity
            {
                Vector3 direction = Vector3.Zero;
                if (movementForce.Magnitude != 0.0f)
                {
                    Position tmp = new Position(movementForce.Origin.X - objectPosition.GetPositionX(),
                                                movementForce.Origin.Y - objectPosition.GetPositionY(),
                                                movementForce.Origin.Z - objectPosition.GetPositionZ());
                    float lengthSquared = tmp.GetExactDistSq(0.0f, 0.0f, 0.0f);
                    if (lengthSquared > 0.0f)
                    {
                        float mult = 1.0f / (float)Math.Sqrt(lengthSquared) * movementForce.Magnitude;
                        tmp.posX *= mult;
                        tmp.posY *= mult;
                        tmp.posZ *= mult;
                        float minLengthSquared = (tmp.GetPositionX() * tmp.GetPositionX() * 0.04f) +
                                                 (tmp.GetPositionY() * tmp.GetPositionY() * 0.04f) +
                                                 (tmp.GetPositionZ() * tmp.GetPositionZ() * 0.04f);
                        if (lengthSquared > minLengthSquared)
                        {
                            direction = new Vector3(tmp.posX, tmp.posY, tmp.posZ);
                        }
                    }
                }

                data.WriteVector3(direction);
            }
            else
            {
                data.WriteVector3(movementForce.Direction);
            }

            data.WriteUInt32(movementForce.TransportID);
            data.WriteFloat(movementForce.Magnitude);
            data.WriteBits(movementForce.Type, 2);
            data.FlushBits();
        }
Exemplo n.º 14
0
        public void Write(WorldPacket data)
        {
            data.WritePackedGuid(QuestGiverGUID);
            data.WriteUInt32(QuestGiverCreatureID);
            data.WriteUInt32(QuestID);
            data.WriteUInt32(QuestFlags[0]); // Flags
            data.WriteUInt32(QuestFlags[1]); // FlagsEx
            data.WriteUInt32(SuggestedPartyMembers);

            data.WriteInt32(Emotes.Count);
            foreach (QuestDescEmote emote in Emotes)
            {
                data.WriteInt32(emote.Type);
                data.WriteInt32(emote.Delay);
            }

            data.WriteBit(AutoLaunched);
            data.FlushBits();

            Rewards.Write(data);
        }
Exemplo n.º 15
0
        public void Inspect(WorldSession session, ObjectGuid guid)
        {
            ArenaTeamMember member = GetMember(guid);

            if (member == null)
            {
                return;
            }

            WorldPacket data = new WorldPacket(ServerOpcodes.InspectPvp);

            data.WritePackedGuid(guid);                              // player guid
            data.WriteUInt8(GetSlot());                              // slot (0...2)
            data.WriteUInt32(GetId());                               // arena team id
            data.WriteUInt32(stats.Rating);                          // rating
            data.WriteUInt32(stats.SeasonGames);                     // season played
            data.WriteUInt32(stats.SeasonWins);                      // season wins
            data.WriteUInt32(member.SeasonGames);                    // played (count of all games, that the inspected member participated...)
            data.WriteUInt32(member.PersonalRating);                 // personal rating
            //session.SendPacket(data);
        }
Exemplo n.º 16
0
 public void Write(WorldPacket data)
 {
     data.WriteBits(GuildName.GetByteCount(), 7);
     data.WriteBits(Comment.GetByteCount(), 10);
     data.WritePackedGuid(GuildGUID);
     data.WriteUInt32(GuildVirtualRealm);
     data.WriteInt32(GuildMembers);
     data.WriteUInt32(GuildAchievementPoints);
     data.WriteInt32(PlayStyle);
     data.WriteInt32(Availability);
     data.WriteInt32(ClassRoles);
     data.WriteInt32(LevelRange);
     data.WriteUInt32(EmblemStyle);
     data.WriteUInt32(EmblemColor);
     data.WriteUInt32(BorderStyle);
     data.WriteUInt32(BorderColor);
     data.WriteUInt32(Background);
     data.WriteInt8(Cached);
     data.WriteInt8(MembershipRequested);
     data.WriteString(GuildName);
     data.WriteString(Comment);
 }
Exemplo n.º 17
0
        public void Write(WorldPacket data)
        {
            data.WritePackedGuid(GUID);
            data.WriteUInt32(SpecializationID);
            data.WriteInt32(Items.Count);
            data.WriteBits(Name.GetByteCount(), 6);
            data.WriteUInt8(GenderID);
            data.WriteUInt8(Skin);
            data.WriteUInt8(HairColor);
            data.WriteUInt8(HairStyle);
            data.WriteUInt8(FacialHairStyle);
            data.WriteUInt8(Face);
            data.WriteUInt8(Race);
            data.WriteUInt8(ClassID);
            CustomDisplay.ForEach(id => data.WriteUInt8(id));

            data.WriteString(Name);

            foreach (InspectItemData item in Items)
            {
                item.Write(data);
            }
        }
Exemplo n.º 18
0
        public void Write(WorldPacket data)
        {
            data.WritePackedGuid(GUID);
            data.WriteUInt32(SpecializationID);
            data.WriteInt32(Items.Count);
            data.WriteBits(Name.GetByteCount(), 6);
            data.WriteUInt8(GenderID);
            data.WriteUInt8(Race);
            data.WriteUInt8(ClassID);
            data.WriteInt32(Customizations.Count);
            data.WriteString(Name);

            foreach (var customization in Customizations)
            {
                data.WriteUInt32(customization.ChrCustomizationOptionID);
                data.WriteUInt32(customization.ChrCustomizationChoiceID);
            }

            foreach (InspectItemData item in Items)
            {
                item.Write(data);
            }
        }
Exemplo n.º 19
0
        public void Write(WorldPacket data)
        {
            data.WriteInt32(PetitionID);
            data.WritePackedGuid(Petitioner);

            data.WriteUInt32(MinSignatures);
            data.WriteUInt32(MaxSignatures);
            data.WriteInt32(DeadLine);
            data.WriteInt32(IssueDate);
            data.WriteInt32(AllowedGuildID);
            data.WriteInt32(AllowedClasses);
            data.WriteInt32(AllowedRaces);
            data.WriteInt16(AllowedGender);
            data.WriteInt32(AllowedMinLevel);
            data.WriteInt32(AllowedMaxLevel);
            data.WriteInt32(NumChoices);
            data.WriteInt32(StaticType);
            data.WriteUInt32(Muid);

            data.WriteBits(Title.GetByteCount(), 7);
            data.WriteBits(BodyText.GetByteCount(), 12);

            for (byte i = 0; i < Choicetext.Length; i++)
            {
                data.WriteBits(Choicetext[i].GetByteCount(), 6);
            }

            data.FlushBits();

            for (byte i = 0; i < Choicetext.Length; i++)
            {
                data.WriteString(Choicetext[i]);
            }

            data.WriteString(Title);
            data.WriteString(BodyText);
        }
Exemplo n.º 20
0
        void BuildValuesUpdateForPlayerWithMask(UpdateData data, UpdateMask requestedObjectMask, UpdateMask requestedDynamicObjectMask, Player target)
        {
            UpdateMask valuesMask = new UpdateMask((int)TypeId.Max);

            if (requestedObjectMask.IsAnySet())
            {
                valuesMask.Set((int)TypeId.Object);
            }

            if (requestedDynamicObjectMask.IsAnySet())
            {
                valuesMask.Set((int)TypeId.DynamicObject);
            }

            WorldPacket buffer = new WorldPacket();

            buffer.WriteUInt32(valuesMask.GetBlock(0));

            if (valuesMask[(int)TypeId.Object])
            {
                m_objectData.WriteUpdate(buffer, requestedObjectMask, true, this, target);
            }

            if (valuesMask[(int)TypeId.DynamicObject])
            {
                m_dynamicObjectData.WriteUpdate(buffer, requestedDynamicObjectMask, true, this, target);
            }

            WorldPacket buffer1 = new WorldPacket();

            buffer1.WriteUInt8((byte)UpdateType.Values);
            buffer1.WritePackedGuid(GetGUID());
            buffer1.WriteUInt32(buffer.GetSize());
            buffer1.WriteBytes(buffer.GetData());

            data.AddUpdateBlock(buffer1);
        }
        public void Write(WorldPacket data)
        {
            data.WriteBit(Item.HasValue);
            data.WriteBits(Enchantments.Count, 4);
            data.WriteBits(Gems.Count, 2);
            data.WriteBit(MinBid.HasValue);
            data.WriteBit(MinIncrement.HasValue);
            data.WriteBit(BuyoutPrice.HasValue);
            data.WriteBit(UnitPrice.HasValue);
            data.WriteBit(CensorServerSideInfo);
            data.WriteBit(CensorBidInfo);
            data.WriteBit(AuctionBucketKey.HasValue);
            if (!CensorBidInfo)
            {
                data.WriteBit(Bidder.HasValue);
                data.WriteBit(BidAmount.HasValue);
            }

            data.FlushBits();

            if (Item.HasValue)
            {
                Item.Value.Write(data);
            }

            data.WriteInt32(Count);
            data.WriteInt32(Charges);
            data.WriteUInt32(Flags);
            data.WriteUInt32(AuctionID);
            data.WritePackedGuid(Owner);
            data.WriteInt32(DurationLeft);
            data.WriteUInt8(DeleteReason);

            foreach (ItemEnchantData enchant in Enchantments)
            {
                enchant.Write(data);
            }

            if (MinBid.HasValue)
            {
                data.WriteUInt64(MinBid.Value);
            }

            if (MinIncrement.HasValue)
            {
                data.WriteUInt64(MinIncrement.Value);
            }

            if (BuyoutPrice.HasValue)
            {
                data.WriteUInt64(BuyoutPrice.Value);
            }

            if (UnitPrice.HasValue)
            {
                data.WriteUInt64(UnitPrice.Value);
            }

            if (!CensorServerSideInfo)
            {
                data.WritePackedGuid(ItemGuid);
                data.WritePackedGuid(OwnerAccountID);
                data.WriteUInt32(EndTime);
            }

            if (!CensorBidInfo)
            {
                if (Bidder.HasValue)
                {
                    data.WritePackedGuid(Bidder.Value);
                }

                if (BidAmount.HasValue)
                {
                    data.WriteUInt64(BidAmount.Value);
                }
            }

            foreach (ItemGemData gem in Gems)
            {
                gem.Write(data);
            }

            if (AuctionBucketKey.HasValue)
            {
                AuctionBucketKey.Value.Write(data);
            }
        }
Exemplo n.º 22
0
 public void Write(WorldPacket data)
 {
     data.WritePackedGuid(GuildGUID);
     data.WriteInt32(NumGuildMembers);
     data.WriteInt32(AchievementPoints);
 }
Exemplo n.º 23
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt8(Method);
     data.WritePackedGuid(LootMaster);
     data.WriteUInt8(Threshold);
 }
Exemplo n.º 24
0
            public void Write(WorldPacket data)
            {
                data.WritePackedGuid(Guid);
                data.WriteUInt64(GuildClubMemberID);
                data.WriteUInt8(ListPosition);
                data.WriteUInt8(RaceId);
                data.WriteUInt8((byte)ClassId);
                data.WriteUInt8(SexId);
                data.WriteUInt8(SkinId);
                data.WriteUInt8(FaceId);
                data.WriteUInt8(HairStyle);
                data.WriteUInt8(HairColor);
                data.WriteUInt8(FacialHair);

                foreach (var display in CustomDisplay)
                {
                    data.WriteUInt8(display);
                }

                data.WriteUInt8(ExperienceLevel);
                data.WriteUInt32(ZoneId);
                data.WriteUInt32(MapId);
                data.WriteVector3(PreloadPos);
                data.WritePackedGuid(GuildGuid);
                data.WriteUInt32((uint)Flags);
                data.WriteUInt32((uint)Flags2);
                data.WriteUInt32(Flags3);
                data.WriteUInt32(PetCreatureDisplayId);
                data.WriteUInt32(PetExperienceLevel);
                data.WriteUInt32(PetCreatureFamilyId);

                data.WriteUInt32(ProfessionIds[0]);
                data.WriteUInt32(ProfessionIds[1]);

                foreach (var visualItem in VisualItems)
                {
                    visualItem.Write(data);
                }

                data.WriteUInt32(LastPlayedTime);
                data.WriteUInt16(SpecID);
                data.WriteUInt32(Unknown703);
                data.WriteUInt32(LastLoginVersion);
                data.WriteUInt32(Flags4);
                data.WriteInt32(Unknown830.Count);
                data.WriteBits(Name.GetByteCount(), 6);
                data.WriteBit(FirstLogin);
                data.WriteBit(BoostInProgress);
                data.WriteBits(unkWod61x, 5);

                foreach (string str in Unknown830)
                {
                    data.WriteBits(str.GetByteCount() + 1, 6);
                }

                data.FlushBits();

                foreach (string str in Unknown830)
                {
                    if (!str.IsEmpty())
                    {
                        data.WriteCString(str);
                    }
                }

                data.WriteString(Name);
            }
Exemplo n.º 25
0
        public void Write(WorldPacket data)
        {
            data.WriteUInt32(Flags);
            data.WriteUInt8(AnimTier);
            data.WriteUInt32(TierTransStartTime);
            data.WriteInt32(Elapsed);
            data.WriteUInt32(MoveTime);
            data.WriteUInt32(FadeObjectTime);
            data.WriteUInt8(Mode);
            data.WriteUInt8(VehicleExitVoluntary);
            data.WritePackedGuid(TransportGUID);
            data.WriteInt8(VehicleSeat);
            data.WriteBits((byte)Face, 2);
            data.WriteBits(Points.Count, 16);
            data.WriteBits(PackedDeltas.Count, 16);
            data.WriteBit(SplineFilter.HasValue);
            data.WriteBit(SpellEffectExtraData.HasValue);
            data.WriteBit(JumpExtraData.HasValue);
            data.FlushBits();

            if (SplineFilter.HasValue)
            {
                SplineFilter.Value.Write(data);
            }

            switch (Face)
            {
            case MonsterMoveType.FacingSpot:
                data.WriteVector3(FaceSpot);
                break;

            case MonsterMoveType.FacingTarget:
                data.WriteFloat(FaceDirection);
                data.WritePackedGuid(FaceGUID);
                break;

            case MonsterMoveType.FacingAngle:
                data.WriteFloat(FaceDirection);
                break;
            }

            foreach (Vector3 pos in Points)
            {
                data.WriteVector3(pos);
            }

            foreach (Vector3 pos in PackedDeltas)
            {
                data.WritePackXYZ(pos);
            }

            if (SpellEffectExtraData.HasValue)
            {
                SpellEffectExtraData.Value.Write(data);
            }

            if (JumpExtraData.HasValue)
            {
                JumpExtraData.Value.Write(data);
            }
        }
Exemplo n.º 26
0
        public override void Write()
        {
            WorldPacket attackRoundInfo = new WorldPacket();

            attackRoundInfo.WriteUInt32((uint)hitInfo);
            attackRoundInfo.WritePackedGuid(AttackerGUID);
            attackRoundInfo.WritePackedGuid(VictimGUID);
            attackRoundInfo.WriteInt32(Damage);
            attackRoundInfo.WriteInt32(OriginalDamage);
            attackRoundInfo.WriteInt32(OverDamage);
            attackRoundInfo.WriteUInt8((byte)(SubDmg.HasValue ? 1 : 0));

            if (SubDmg.HasValue)
            {
                attackRoundInfo.WriteInt32(SubDmg.Value.SchoolMask);
                attackRoundInfo.WriteFloat(SubDmg.Value.FDamage);
                attackRoundInfo.WriteInt32(SubDmg.Value.Damage);
                if (hitInfo.HasAnyFlag(HitInfo.FullAbsorb | HitInfo.PartialAbsorb))
                {
                    attackRoundInfo.WriteInt32(SubDmg.Value.Absorbed);
                }
                if (hitInfo.HasAnyFlag(HitInfo.FullResist | HitInfo.PartialResist))
                {
                    attackRoundInfo.WriteInt32(SubDmg.Value.Resisted);
                }
            }

            attackRoundInfo.WriteUInt8(VictimState);
            attackRoundInfo.WriteUInt32(AttackerState);
            attackRoundInfo.WriteUInt32(MeleeSpellID);

            if (hitInfo.HasAnyFlag(HitInfo.Block))
            {
                attackRoundInfo.WriteInt32(BlockAmount);
            }

            if (hitInfo.HasAnyFlag(HitInfo.RageGain))
            {
                attackRoundInfo.WriteInt32(RageGained);
            }

            if (hitInfo.HasAnyFlag(HitInfo.Unk1))
            {
                attackRoundInfo.WriteUInt32(UnkState.State1);
                attackRoundInfo.WriteFloat(UnkState.State2);
                attackRoundInfo.WriteFloat(UnkState.State3);
                attackRoundInfo.WriteFloat(UnkState.State4);
                attackRoundInfo.WriteFloat(UnkState.State5);
                attackRoundInfo.WriteFloat(UnkState.State6);
                attackRoundInfo.WriteFloat(UnkState.State7);
                attackRoundInfo.WriteFloat(UnkState.State8);
                attackRoundInfo.WriteFloat(UnkState.State9);
                attackRoundInfo.WriteFloat(UnkState.State10);
                attackRoundInfo.WriteFloat(UnkState.State11);
                attackRoundInfo.WriteUInt32(UnkState.State12);
            }

            if (hitInfo.HasAnyFlag(HitInfo.Block | HitInfo.Unk12))
            {
                attackRoundInfo.WriteFloat(Unk);
            }

            attackRoundInfo.WriteUInt8((byte)ContentTuning.TuningType);
            attackRoundInfo.WriteUInt8(ContentTuning.TargetLevel);
            attackRoundInfo.WriteUInt8(ContentTuning.Expansion);
            attackRoundInfo.WriteUInt8(ContentTuning.TargetMinScalingLevel);
            attackRoundInfo.WriteUInt8(ContentTuning.TargetMaxScalingLevel);
            attackRoundInfo.WriteInt16(ContentTuning.PlayerLevelDelta);
            attackRoundInfo.WriteInt8(ContentTuning.TargetScalingLevelDelta);
            attackRoundInfo.WriteUInt16(ContentTuning.PlayerItemLevel);
            attackRoundInfo.WriteUInt16(ContentTuning.ScalingHealthItemLevelCurveID);
            attackRoundInfo.WriteUInt8((byte)(ContentTuning.ScalesWithItemLevel ? 1 : 0));

            WriteLogDataBit();
            FlushBits();
            WriteLogData();

            _worldPacket.WriteUInt32(attackRoundInfo.GetSize());
            _worldPacket.WriteBytes(attackRoundInfo);
        }
Exemplo n.º 27
0
        public static void WriteCreateObjectSplineDataBlock(MoveSpline moveSpline, WorldPacket data)
        {
            data.WriteUInt32(moveSpline.GetId());                                       // ID

            if (!moveSpline.isCyclic())                                                 // Destination
            {
                data.WriteVector3(moveSpline.FinalDestination());
            }
            else
            {
                data.WriteVector3(Vector3.Zero);
            }

            bool hasSplineMove = data.WriteBit(!moveSpline.Finalized() && !moveSpline.splineIsFacingOnly);

            data.FlushBits();

            if (hasSplineMove)
            {
                data.WriteUInt32((uint)moveSpline.splineflags.Flags);  // SplineFlags
                data.WriteInt32(moveSpline.timePassed());              // Elapsed
                data.WriteInt32(moveSpline.Duration());                // Duration
                data.WriteFloat(1.0f);                                 // DurationModifier
                data.WriteFloat(1.0f);                                 // NextDurationModifier
                data.WriteBits((byte)moveSpline.facing.type, 2);       // Face
                bool hasFadeObjectTime = data.WriteBit(moveSpline.splineflags.hasFlag(SplineFlag.FadeObject) && moveSpline.effect_start_time < moveSpline.Duration());
                data.WriteBits(moveSpline.getPath().Length, 16);
                data.WriteBits((byte)moveSpline.spline.m_mode, 2);                   // Mode
                data.WriteBit(0);                                                    // HasSplineFilter
                data.WriteBit(moveSpline.spell_effect_extra.HasValue);               // HasSpellEffectExtraData
                data.WriteBit(moveSpline.splineflags.hasFlag(SplineFlag.Parabolic)); // HasJumpExtraData
                data.FlushBits();

                //if (HasSplineFilterKey)
                //{
                //    data << uint32(FilterKeysCount);
                //    for (var i = 0; i < FilterKeysCount; ++i)
                //    {
                //        data << float(In);
                //        data << float(Out);
                //    }

                //    data.WriteBits(FilterFlags, 2);
                //    data.FlushBits();
                //}

                switch (moveSpline.facing.type)
                {
                case MonsterMoveType.FacingSpot:
                    data.WriteVector3(moveSpline.facing.f);             // FaceSpot
                    break;

                case MonsterMoveType.FacingTarget:
                    data.WritePackedGuid(moveSpline.facing.target);     // FaceGUID
                    break;

                case MonsterMoveType.FacingAngle:
                    data.WriteFloat(moveSpline.facing.angle);           // FaceDirection
                    break;
                }

                if (hasFadeObjectTime)
                {
                    data.WriteInt32(moveSpline.effect_start_time);     // FadeObjectTime
                }
                foreach (var vec in moveSpline.getPath())
                {
                    data.WriteVector3(vec);
                }

                if (moveSpline.spell_effect_extra.HasValue)
                {
                    data.WritePackedGuid(moveSpline.spell_effect_extra.Value.Target);
                    data.WriteUInt32(moveSpline.spell_effect_extra.Value.SpellVisualId);
                    data.WriteUInt32(moveSpline.spell_effect_extra.Value.ProgressCurveId);
                    data.WriteUInt32(moveSpline.spell_effect_extra.Value.ParabolicCurveId);
                }

                if (moveSpline.splineflags.hasFlag(SplineFlag.Parabolic))
                {
                    data.WriteFloat(moveSpline.vertical_acceleration);
                    data.WriteInt32(moveSpline.effect_start_time);
                    data.WriteUInt32(0);                                                  // Duration (override)
                }
            }
        }
Exemplo n.º 28
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(AuctionID);
     data.WritePackedGuid(Bidder);
     Item.Write(data);
 }
Exemplo n.º 29
0
            public void Write(WorldPacket data)
            {
                data.WritePackedGuid(Guid);
                data.WriteUInt64(GuildClubMemberID);
                data.WriteUInt8(ListPosition);
                data.WriteUInt8(RaceId);
                data.WriteUInt8((byte)ClassId);
                data.WriteUInt8(SexId);
                data.WriteInt32(Customizations.Count);

                data.WriteUInt8(ExperienceLevel);
                data.WriteUInt32(ZoneId);
                data.WriteUInt32(MapId);
                data.WriteVector3(PreloadPos);
                data.WritePackedGuid(GuildGuid);
                data.WriteUInt32((uint)Flags);
                data.WriteUInt32((uint)Flags2);
                data.WriteUInt32(Flags3);
                data.WriteUInt32(PetCreatureDisplayId);
                data.WriteUInt32(PetExperienceLevel);
                data.WriteUInt32(PetCreatureFamilyId);

                data.WriteUInt32(ProfessionIds[0]);
                data.WriteUInt32(ProfessionIds[1]);

                foreach (var visualItem in VisualItems)
                {
                    visualItem.Write(data);
                }

                data.WriteInt64(LastPlayedTime);
                data.WriteUInt16(SpecID);
                data.WriteUInt32(Unknown703);
                data.WriteUInt32(LastLoginVersion);
                data.WriteUInt32(Flags4);
                data.WriteInt32(MailSenders.Count);
                data.WriteInt32(MailSenderTypes.Count);
                data.WriteUInt32(OverrideSelectScreenFileDataID);

                foreach (ChrCustomizationChoice customization in Customizations)
                {
                    data.WriteUInt32(customization.ChrCustomizationOptionID);
                    data.WriteUInt32(customization.ChrCustomizationChoiceID);
                }

                foreach (var mailSenderType in MailSenderTypes)
                {
                    data.WriteUInt32(mailSenderType);
                }

                data.WriteBits(Name.GetByteCount(), 6);
                data.WriteBit(FirstLogin);
                data.WriteBit(BoostInProgress);
                data.WriteBits(unkWod61x, 5);

                foreach (string str in MailSenders)
                {
                    data.WriteBits(str.GetByteCount() + 1, 6);
                }

                data.FlushBits();

                foreach (string str in MailSenders)
                {
                    if (!str.IsEmpty())
                    {
                        data.WriteCString(str);
                    }
                }

                data.WriteString(Name);
            }