示例#1
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(SpellID);
     data.WriteBit(Usable);
     data.FlushBits();
 }
示例#2
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.WriteUInt32(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.WriteUInt32(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.WriteUInt32(moveSpline.effect_start_time);
                    data.WriteUInt32(0);                                                  // Duration (override)
                }
            }
        }
示例#3
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(Id);
     data.WriteUInt8(Index);
 }
示例#4
0
        public override void Write()
        {
            WorldPacket attackRoundInfo = new WorldPacket();

            attackRoundInfo.WriteUInt32(hitInfo);
            attackRoundInfo.WritePackedGuid(AttackerGUID);
            attackRoundInfo.WritePackedGuid(VictimGUID);
            attackRoundInfo.WriteInt32(Damage);
            attackRoundInfo.WriteInt32(OverDamage);
            attackRoundInfo.WriteUInt8(SubDmg.HasValue);

            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.WriteInt32(AttackerState);
            attackRoundInfo.WriteInt32(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(SandboxScaling.Type);
            attackRoundInfo.WriteUInt8(SandboxScaling.TargetLevel);
            attackRoundInfo.WriteUInt8(SandboxScaling.Expansion);
            attackRoundInfo.WriteUInt8(SandboxScaling.Class);
            attackRoundInfo.WriteUInt8(SandboxScaling.TargetMinScalingLevel);
            attackRoundInfo.WriteUInt8(SandboxScaling.TargetMaxScalingLevel);
            attackRoundInfo.WriteInt16(SandboxScaling.PlayerLevelDelta);
            attackRoundInfo.WriteInt8(SandboxScaling.TargetScalingLevelDelta);
            attackRoundInfo.WriteUInt16(SandboxScaling.PlayerItemLevel);

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

            _worldPacket.WriteInt32(attackRoundInfo.GetSize());
            _worldPacket.WriteBytes(attackRoundInfo);
        }
示例#5
0
 public void Write(WorldPacket data)
 {
     data.WriteFloat(JumpGravity);
     data.WriteUInt32(StartTime);
     data.WriteUInt32(Duration);
 }
示例#6
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(HonorKills);
     data.WriteUInt32(Deaths);
     data.WriteUInt32(ContributionPoints);
 }
示例#7
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(ItemID);
     data.WriteUInt32(ItemCount);
 }
示例#8
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(AuctionID);
     data.WriteUInt64(BidAmount);
     Item.Write(data);
 }
示例#9
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(AuctionID);
     data.WritePackedGuid(Bidder);
     Item.Write(data);
 }
示例#10
0
 public void Write(WorldPacket data)
 {
     data.WriteBits((byte)LootItemType, 2);
     Item.Write(data);
     data.WriteUInt32(Quantity);
 }
示例#11
0
        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);
            }
        }
示例#12
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(SpellID);
     data.WriteUInt32(PlayerConditionID);
 }
示例#13
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(ContentTuningConditionMask);
     data.WriteInt32(Unused901);
     data.WriteUInt32(ExpansionLevelMask);
 }
示例#14
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.WriteUInt32(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);
            }
示例#15
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(DungeonDifficultyID);
     data.WriteUInt32(RaidDifficultyID);
     data.WriteUInt32(LegacyRaidDifficultyID);
 }
示例#16
0
        public void Write(WorldPacket data)
        {
            data.WriteUInt64(DbID);
            data.WriteUInt32(GarrFollowerID);
            data.WriteUInt32(Quality);
            data.WriteUInt32(FollowerLevel);
            data.WriteUInt32(ItemLevelWeapon);
            data.WriteUInt32(ItemLevelArmor);
            data.WriteUInt32(Xp);
            data.WriteUInt32(Durability);
            data.WriteUInt32(CurrentBuildingID);
            data.WriteUInt32(CurrentMissionID);
            data.WriteInt32(AbilityID.Count);
            data.WriteUInt32(ZoneSupportSpellID);
            data.WriteUInt32(FollowerStatus);

            AbilityID.ForEach(ability => data.WriteUInt32(ability.Id));

            data.WriteBits(CustomName.GetByteCount(), 7);
            data.FlushBits();
            data.WriteString(CustomName);
        }
示例#17
0
        public void Write(WorldPacket data)
        {
            data.WriteUInt32(ChoiceItemCount);
            data.WriteUInt32(ItemCount);

            for (int i = 0; i < SharedConst.QuestRewardItemCount; ++i)
            {
                data.WriteUInt32(ItemID[i]);
                data.WriteUInt32(ItemQty[i]);
            }

            data.WriteUInt32(Money);
            data.WriteUInt32(XP);
            data.WriteUInt64(ArtifactXP);
            data.WriteUInt32(ArtifactCategoryID);
            data.WriteUInt32(Honor);
            data.WriteUInt32(Title);
            data.WriteUInt32(FactionFlags);

            for (int i = 0; i < SharedConst.QuestRewardReputationsCount; ++i)
            {
                data.WriteUInt32(FactionID[i]);
                data.WriteInt32(FactionValue[i]);
                data.WriteInt32(FactionOverride[i]);
                data.WriteInt32(FactionCapIn[i]);
            }

            foreach (var id in SpellCompletionDisplayID)
            {
                data.WriteInt32(id);
            }

            data.WriteUInt32(SpellCompletionID);

            for (int i = 0; i < SharedConst.QuestRewardCurrencyCount; ++i)
            {
                data.WriteUInt32(CurrencyID[i]);
                data.WriteUInt32(CurrencyQty[i]);
            }

            data.WriteUInt32(SkillLineID);
            data.WriteUInt32(NumSkillUps);
            data.WriteInt32(TreasurePickerID);

            for (int i = 0; i < SharedConst.QuestRewardChoicesCount; ++i)
            {
                ChoiceItems[i].Item.Write(data);
                data.WriteUInt32(ChoiceItems[i].Quantity);
            }

            data.WriteBit(IsBoostSpell);
            data.FlushBits();
        }
示例#18
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(GarrMssnBonusAbilityID);
     data.WriteUInt32((uint)StartTime);
 }
示例#19
0
 public void Write(WorldPacket data)
 {
     data.WriteInt32(PvpStatID);
     data.WriteUInt32(PvpStatValue);
 }
示例#20
0
 public void Write(WorldPacket data)
 {
     data.WriteInt32(GarrTalentID);
     data.WriteUInt32((uint)ResearchStartTime);
     data.WriteInt32(Flags);
 }
示例#21
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(CurrencyID);
     data.WriteUInt32(CurrencyCount);
 }
示例#22
0
        public void Write(WorldPacket data)
        {
            data.WriteUInt32((uint)GarrTypeID);
            data.WriteUInt32(GarrSiteID);
            data.WriteUInt32(GarrSiteLevelID);
            data.WriteInt32(Buildings.Count);
            data.WriteInt32(Plots.Count);
            data.WriteInt32(Followers.Count);
            data.WriteInt32(Missions.Count);
            data.WriteInt32(MissionRewards.Count);
            data.WriteInt32(MissionOvermaxRewards.Count);
            data.WriteInt32(MissionAreaBonuses.Count);
            data.WriteInt32(Talents.Count);
            data.WriteInt32(CanStartMission.Count);
            data.WriteInt32(ArchivedMissions.Count);
            data.WriteUInt32(NumFollowerActivationsRemaining);
            data.WriteUInt32(NumMissionsStartedToday);

            foreach (GarrisonPlotInfo plot in Plots)
            {
                plot.Write(data);
            }

            foreach (GarrisonMission mission in Missions)
            {
                mission.Write(data);
            }

            foreach (List <GarrisonMissionReward> missionReward in MissionRewards)
            {
                data.WriteInt32(missionReward.Count);
                foreach (GarrisonMissionReward missionRewardItem in missionReward)
                {
                    missionRewardItem.Write(data);
                }
            }

            foreach (List <GarrisonMissionReward> missionReward in MissionOvermaxRewards)
            {
                data.WriteInt32(missionReward.Count);
                foreach (GarrisonMissionReward missionRewardItem in missionReward)
                {
                    missionRewardItem.Write(data);
                }
            }

            foreach (GarrisonMissionBonusAbility areaBonus in MissionAreaBonuses)
            {
                areaBonus.Write(data);
            }

            foreach (GarrisonTalent talent in Talents)
            {
                talent.Write(data);
            }

            foreach (var id in ArchivedMissions)
            {
                data.WriteInt32(id);
            }

            foreach (GarrisonBuildingInfo building in Buildings)
            {
                building.Write(data);
            }

            foreach (bool canStartMission in CanStartMission)
            {
                data.WriteBit(canStartMission);
            }

            data.FlushBits();

            foreach (GarrisonFollower follower in Followers)
            {
                follower.Write(data);
            }
        }
示例#23
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(RealmAddress);
     RealmNameInfo.Write(data);
 }
示例#24
0
 public void Write(WorldPacket data)
 {
     data.WriteInt32(GarrFollowerTypeID);
     data.WriteUInt32(Count);
 }
示例#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);
            }
        }
示例#26
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(GarrPlotInstanceID);
     data.WriteUInt32(GarrBuildingID);
 }
示例#27
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(SpellID);
     data.WriteUInt16(GlyphID);
 }
示例#28
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(GarrBuildingPlotInstID);
     data.WriteXYZ(Pos);
 }
示例#29
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(GarrPlotInstanceID);
     data.WriteXYZO(PlotPos);
     data.WriteUInt32(PlotType);
 }
示例#30
0
 public void Write(WorldPacket data)
 {
     data.WriteUInt32(DisplayId);
     data.WriteUInt32(DisplayEnchantId);
     data.WriteUInt8(InventoryType);
 }