コード例 #1
0
        public void Read(StreamHandler Reader)
        {
            Flags = (SpellCastTargetFlags)Reader.ReadUInt32();

            if ((Flags & (
                     SpellCastTargetFlags.Unit | SpellCastTargetFlags.Unk2 |
                     SpellCastTargetFlags.Object |
                     SpellCastTargetFlags.Corpse | SpellCastTargetFlags.PvPCorpse
                     )) != 0)
            {
                TargetUnit = Reader.ReadPackedGuid();
            }

            if ((Flags & (SpellCastTargetFlags.Item | SpellCastTargetFlags.TradeItem)) != 0)
            {
                TargetItem = Reader.ReadPackedGuid();
            }

            if ((Flags & SpellCastTargetFlags.SourceLocation) != 0)
            {
                SourceTransportGuid = Reader.ReadPackedGuid();
                SourceLocation      = Reader.ReadVector3();
            }

            if ((Flags & SpellCastTargetFlags.DestLocation) != 0)
            {
                DestTransportGuid = Reader.ReadPackedGuid();
                DestLocation      = Reader.ReadVector3();
            }

            if ((Flags & SpellCastTargetFlags.String) != 0)
            {
                StringTarget = Reader.ReadCString();
            }
        }
コード例 #2
0
ファイル: SpellCasting.cs プロジェクト: SkyFire/Kamilla.Wow
        public void Read(StreamHandler Reader)
        {
            Flags = (SpellCastTargetFlags)Reader.ReadUInt32();

            if ((Flags & (
                SpellCastTargetFlags.Unit   | SpellCastTargetFlags.Unk2 |
                SpellCastTargetFlags.Object |
                SpellCastTargetFlags.Corpse | SpellCastTargetFlags.PvPCorpse
                )) != 0)
                TargetUnit = Reader.ReadPackedGuid();

            if ((Flags & (SpellCastTargetFlags.Item | SpellCastTargetFlags.TradeItem)) != 0)
                TargetItem = Reader.ReadPackedGuid();

            if ((Flags & SpellCastTargetFlags.SourceLocation) != 0)
            {
                SourceTransportGuid = Reader.ReadPackedGuid();
                SourceLocation = Reader.ReadVector3();
            }

            if ((Flags & SpellCastTargetFlags.DestLocation) != 0)
            {
                DestTransportGuid = Reader.ReadPackedGuid();
                DestLocation = Reader.ReadVector3();
            }

            if ((Flags & SpellCastTargetFlags.String) != 0)
                StringTarget = Reader.ReadCString();
        }
コード例 #3
0
ファイル: ChannelStart.cs プロジェクト: Torpedoes/Kamilla.Wow
        public override void Read(StreamHandler reader)
        {
            Caster   = reader.ReadPackedGuid();
            SpellId  = reader.ReadUInt32();
            Duration = reader.ReadInt32();

            HaveFlags = reader.ReadBoolean();
            if (HaveFlags)
            {
                TargetFlags1 = reader.ReadUInt32();
                TargetFlags2 = reader.ReadUInt32();
            }

            Unk_HaveData2 = reader.ReadBoolean();
            if (Unk_HaveData2)
            {
                Unk_Guid1 = reader.ReadPackedGuid();
                Unk_UInt3 = reader.ReadUInt32();
                Unk_Byte  = reader.ReadByte();
                if (Unk_Byte == 2)
                {
                    Unk_Guid2 = reader.ReadPackedGuid();
                }
            }
        }
コード例 #4
0
ファイル: ThreatUpdate.cs プロジェクト: CarlosX/Kamilla.Wow
        public override void Read(StreamHandler reader)
        {
            this.Unit = reader.ReadPackedGuid();

            var count = reader.ReadInt32();
            this.ThreatList = new ThreatUpdatePair[count];
            for (int i = 0; i < count; ++i)
                this.ThreatList[i] = new ThreatUpdatePair { Unit = reader.ReadPackedGuid(), Threat = reader.ReadUInt32() };
        }
コード例 #5
0
        public override void Read(StreamHandler reader)
        {
            this.Unit = reader.ReadPackedGuid();

            var count = reader.ReadInt32();

            this.ThreatList = new ThreatUpdatePair[count];
            for (int i = 0; i < count; ++i)
            {
                this.ThreatList[i] = new ThreatUpdatePair {
                    Unit = reader.ReadPackedGuid(), Threat = reader.ReadUInt32()
                }
            }
            ;
        }
コード例 #6
0
ファイル: UpdateData.cs プロジェクト: Torpedoes/Kamilla.Wow
        private void ReadObjectCreateUpdate(StreamHandler Reader)
        {
            var guid = Reader.ReadPackedGuid();
            var type = (ObjectTypeId)Reader.ReadByte();

            WowObject obj;

            switch (type)
            {
            case ObjectTypeId.Container:
                obj = new WowContainer();
                break;

            case ObjectTypeId.Corpse:
                obj = new WowCorpse();
                break;

            case ObjectTypeId.DynamicObject:
                obj = new WowDynamicObject();
                break;

            case ObjectTypeId.GameObject:
                obj = new WowGameObject();
                break;

            case ObjectTypeId.Item:
                obj = new WowItem();
                break;

            case ObjectTypeId.Object:
            default:
                throw new Exception("Cannot instantiate an object with TypeId=" + type);

            case ObjectTypeId.Player:
                obj = new WowPlayer();
                break;

            case ObjectTypeId.Unit:
                obj = new WowUnit();
                break;

            case ObjectTypeId.AreaTrigger:
                obj = new WowAreaTrigger();
                break;
            }

            obj.Guid         = guid;
            obj.MovementData = new MovementInfo(Reader);
            obj.SetValues(ReadValues(Reader));
            obj.ResetUpdatedFields();

            if (!m_createdObjects.ContainsKey(guid))
            {
                m_createdObjects.Add(guid, obj);
            }
            else
            {
                Console.WriteLine("Error: Created object duplicate guid {0}", guid);
            }
        }
コード例 #7
0
ファイル: UpdateData.cs プロジェクト: CarlosX/Kamilla.Wow
 private void ReadObjectValuesUpdate(StreamHandler Reader)
 {
     var guid = Reader.ReadPackedGuid();
     var values = ReadValues(Reader);
     if (!m_valuesUpdates.ContainsKey(guid))
         m_valuesUpdates.Add(guid, values);
     else
         Console.WriteLine("Error: Updated object duplicate guid {0}", guid);
 }
コード例 #8
0
ファイル: UpdateData.cs プロジェクト: Torpedoes/Kamilla.Wow
        private void ReadObjectDestroyUpdate(StreamHandler Reader)
        {
            uint nObjects = Reader.ReadUInt32();

            for (var i = 0; i < nObjects; ++i)
            {
                m_destroyedObjects.Add(Reader.ReadPackedGuid());
            }
        }
コード例 #9
0
        public override void Read(StreamHandler Reader)
        {
            Caster      = Reader.ReadPackedGuid();
            CastInvoker = Reader.ReadPackedGuid();
            CastId      = Reader.ReadByte();
            SpellId     = Reader.ReadUInt32();
            Flags       = (CastFlags)Reader.ReadUInt32();
            Unk43       = Reader.ReadUInt32();
            Unk43_2     = Reader.ReadUInt32();

            TargetData.Read(Reader);

            if ((Flags & CastFlags.PredictedPower) != 0)
            {
                PredictedPower = Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.RuneStates) != 0)
            {
                RunesBefore = (RuneStates)Reader.ReadByte();
                RunesAfter  = (RuneStates)Reader.ReadByte();
                for (int i = 0; i < RuneCooldowns.Length; ++i)
                {
                    RuneCooldowns[i] = Reader.ReadByte();
                }
            }

            if ((Flags & CastFlags.Ammo) != 0)
            {
                ProjectileDisplayId     = Reader.ReadUInt32();
                ProjectileInventoryType = (InventorySlotType)Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.Unk0x04000000) != 0)
            {
                Unk0x04000000_UInt32_1 = Reader.ReadUInt32();
                Unk0x04000000_UInt32_2 = Reader.ReadUInt32();
            }
        }
コード例 #10
0
ファイル: AuraUpdates.cs プロジェクト: CarlosX/Kamilla.Wow
        public override void Read(StreamHandler reader)
        {
            Unit = reader.ReadPackedGuid();

            while (!reader.IsRead)
            {
                var update = new Aura();
                update.Unit = Unit;

                update.Read(reader);

                this.Auras.Add(update);
            }
        }
コード例 #11
0
ファイル: ChannelStart.cs プロジェクト: SkyFire/Kamilla.Wow
        public override void Read(StreamHandler reader)
        {
            Caster = reader.ReadPackedGuid();
            SpellId = reader.ReadUInt32();
            Duration = reader.ReadInt32();

            HaveFlags = reader.ReadBoolean();
            if (HaveFlags)
            {
                TargetFlags1 = reader.ReadUInt32();
                TargetFlags2 = reader.ReadUInt32();
            }

            Unk_HaveData2 = reader.ReadBoolean();
            if (Unk_HaveData2)
            {
                Unk_Guid1 = reader.ReadPackedGuid();
                Unk_UInt3 = reader.ReadUInt32();
                Unk_Byte = reader.ReadByte();
                if (Unk_Byte == 2)
                    Unk_Guid2 = reader.ReadPackedGuid();
            }
        }
コード例 #12
0
        public override void Read(StreamHandler reader)
        {
            Unit = reader.ReadPackedGuid();

            while (!reader.IsRead)
            {
                var update = new Aura();
                update.Unit = Unit;

                update.Read(reader);

                this.Auras.Add(update);
            }
        }
コード例 #13
0
ファイル: UpdateData.cs プロジェクト: Torpedoes/Kamilla.Wow
        private void ReadObjectValuesUpdate(StreamHandler Reader)
        {
            var guid   = Reader.ReadPackedGuid();
            var values = ReadValues(Reader);

            if (!m_valuesUpdates.ContainsKey(guid))
            {
                m_valuesUpdates.Add(guid, values);
            }
            else
            {
                Console.WriteLine("Error: Updated object duplicate guid {0}", guid);
            }
        }
コード例 #14
0
ファイル: UpdateData.cs プロジェクト: CarlosX/Kamilla.Wow
        private void ReadObjectCreateUpdate(StreamHandler Reader)
        {
            var guid = Reader.ReadPackedGuid();
            var type = (ObjectTypeId)Reader.ReadByte();

            WowObject obj;

            switch (type)
            {
                case ObjectTypeId.Container:
                    obj = new WowContainer();
                    break;
                case ObjectTypeId.Corpse:
                    obj = new WowCorpse();
                    break;
                case ObjectTypeId.DynamicObject:
                    obj = new WowDynamicObject();
                    break;
                case ObjectTypeId.GameObject:
                    obj = new WowGameObject();
                    break;
                case ObjectTypeId.Item:
                    obj = new WowItem();
                    break;
                case ObjectTypeId.Object:
                default:
                    throw new Exception("Cannot instantiate an object with TypeId=" + type);
                case ObjectTypeId.Player:
                    obj = new WowPlayer();
                    break;
                case ObjectTypeId.Unit:
                    obj = new WowUnit();
                    break;
                case ObjectTypeId.AreaTrigger:
                    obj = new WowAreaTrigger();
                    break;
            }

            obj.Guid = guid;
            obj.MovementData = new MovementInfo(Reader);
            obj.SetValues(ReadValues(Reader));
            obj.ResetUpdatedFields();

            if (!m_createdObjects.ContainsKey(guid))
                m_createdObjects.Add(guid, obj);
            else
                Console.WriteLine("Error: Created object duplicate guid {0}", guid);
        }
コード例 #15
0
        public MonsterMove(StreamHandler Reader, bool LazyReading)
        {
            this.Unit = Reader.ReadPackedGuid();

            this.Reader = Reader;

            m_readers = new Action[]
            {
                ReadMovementData
            };

            if (!LazyReading)
            {
                EnsureRead();
            }
        }
コード例 #16
0
ファイル: Aura.cs プロジェクト: Torpedoes/Kamilla.Wow
        public void Read(StreamHandler Reader)
        {
            Slot  = Reader.ReadByte();
            Spell = Reader.ReadUInt32();

            Caster = Unit;

            if (Spell != 0)
            {
                Flags   = (AuraFlags)Reader.ReadUInt16();
                Level   = Reader.ReadByte();
                Charges = Reader.ReadByte();

                if ((Flags & AuraFlags.NotCaster) == 0)
                {
                    Caster = Reader.ReadPackedGuid();
                }

                if ((Flags & AuraFlags.Duration) != 0)
                {
                    MaxDuration = Reader.ReadUInt32();
                    var currentDurationMs = Reader.ReadUInt32();

                    this.AppliedTime = (uint)Environment.TickCount - currentDurationMs;
                }

                if ((Flags & AuraFlags.BasePoints) != 0)
                {
                    for (int i = 0; i < MaxEffects; ++i)
                    {
                        if ((Flags & (AuraFlags)(1 << i)) != 0)
                        {
                            BasePoints[i] = Reader.ReadInt32();
                        }
                        else
                        {
                            BasePoints[i] = 0;
                        }
                    }
                }
                else
                {
                    Array.Clear(BasePoints, 0, MaxEffects);
                }
            }
        }
コード例 #17
0
ファイル: ThreatClear.cs プロジェクト: CarlosX/Kamilla.Wow
 public override void Read(StreamHandler reader)
 {
     this.Unit = reader.ReadPackedGuid();
 }
コード例 #18
0
 public override void Read(StreamHandler reader)
 {
     this.Unit   = reader.ReadPackedGuid();
     this.Victim = reader.ReadPackedGuid();
 }
コード例 #19
0
ファイル: MonsterMove.cs プロジェクト: SkyFire/Kamilla.Wow
        public MonsterMove(StreamHandler Reader, bool LazyReading)
        {
            this.Unit = Reader.ReadPackedGuid();

            this.Reader = Reader;

            m_readers = new Action[]
                {
                    ReadMovementData
                };

            if (!LazyReading)
                EnsureRead();
        }
コード例 #20
0
        public override void Read(StreamHandler Reader)
        {
            Caster      = Reader.ReadPackedGuid();
            CastInvoker = Reader.ReadPackedGuid();
            CastId      = Reader.ReadByte();
            SpellId     = Reader.ReadUInt32();
            Flags       = (CastFlags)Reader.ReadUInt32();
            Unk43       = Reader.ReadUInt32();
            CastTime    = Reader.ReadUInt32();

            byte hits = Reader.ReadByte();

            Hits.Capacity = hits;
            for (byte i = 0; i < hits; ++i)
            {
                Hits.Add(Reader.ReadGuid());
            }

            byte misses = Reader.ReadByte();

            Misses.Capacity = misses;
            for (byte i = 0; i < misses; ++i)
            {
                var miss = new MissData();
                miss.Read(Reader);
                Misses.Add(miss);
            }

            TargetData.Read(Reader);

            if ((Flags & CastFlags.PredictedPower) != 0)
            {
                PredictedPower = Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.RuneStates) != 0)
            {
                RunesBefore = (RuneStates)Reader.ReadByte();
                RunesAfter  = (RuneStates)Reader.ReadByte();
                for (int i = 0; i < RuneCooldowns.Length; ++i)
                {
                    RuneCooldowns[i] = Reader.ReadByte();
                }
            }

            if ((Flags & CastFlags.Unk0x00020000) != 0)
            {
                Unk0x20000_Float  = Reader.ReadSingle();
                Unk0x20000_UInt32 = Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.Ammo) != 0)
            {
                ProjectileDisplayId     = Reader.ReadUInt32();
                ProjectileInventoryType = (InventorySlotType)Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.Unk0x00080000) != 0)
            {
                Unk0x80000_UInt32_1 = Reader.ReadUInt32();
                Unk0x80000_UInt32_2 = Reader.ReadUInt32();
            }

            if ((TargetData.Flags & SpellCastTargetFlags.DestLocation) != 0)
            {
                DestLocationCounter = Reader.ReadByte();
            }

            if ((TargetData.Flags & SpellCastTargetFlags.Unk4) != 0)
            {
                uint count = Reader.ReadUInt32();
                Unk4_Count         = count;
                Unk4_List.Capacity = (int)count;

                for (uint i = 0; i < count; ++i)
                {
                    Vector3 v3   = Reader.ReadVector3();
                    WowGuid guid = Reader.ReadGuid();
                    Unk4_List.Add(new KeyValuePair <WowGuid, Vector3>(guid, v3));
                    if (guid.IsEmpty)
                    {
                        break;
                    }
                }
            }
        }
コード例 #21
0
ファイル: UpdateData.cs プロジェクト: CarlosX/Kamilla.Wow
 private void ReadObjectDestroyUpdate(StreamHandler Reader)
 {
     uint nObjects = Reader.ReadUInt32();
     for (var i = 0; i < nObjects; ++i)
         m_destroyedObjects.Add(Reader.ReadPackedGuid());
 }
コード例 #22
0
ファイル: SpellCasting.cs プロジェクト: SkyFire/Kamilla.Wow
        public override void Read(StreamHandler Reader)
        {
            Caster = Reader.ReadPackedGuid();
            CastInvoker = Reader.ReadPackedGuid();
            CastId = Reader.ReadByte();
            SpellId = Reader.ReadUInt32();
            Flags = (CastFlags)Reader.ReadUInt32();
            Unk43 = Reader.ReadUInt32();
            Unk43_2 = Reader.ReadUInt32();

            TargetData.Read(Reader);

            if ((Flags & CastFlags.PredictedPower) != 0)
                PredictedPower = Reader.ReadUInt32();

            if ((Flags & CastFlags.RuneStates) != 0)
            {
                RunesBefore = (RuneStates)Reader.ReadByte();
                RunesAfter = (RuneStates)Reader.ReadByte();
                for (int i = 0; i < RuneCooldowns.Length; ++i)
                    RuneCooldowns[i] = Reader.ReadByte();
            }

            if ((Flags & CastFlags.Ammo) != 0)
            {
                ProjectileDisplayId = Reader.ReadUInt32();
                ProjectileInventoryType = (InventorySlotType)Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.Unk0x04000000) != 0)
            {
                Unk0x04000000_UInt32_1 = Reader.ReadUInt32();
                Unk0x04000000_UInt32_2 = Reader.ReadUInt32();
            }
        }
コード例 #23
0
ファイル: SpellCasting.cs プロジェクト: SkyFire/Kamilla.Wow
        public override void Read(StreamHandler Reader)
        {
            Caster = Reader.ReadPackedGuid();
            CastInvoker = Reader.ReadPackedGuid();
            CastId = Reader.ReadByte();
            SpellId = Reader.ReadUInt32();
            Flags = (CastFlags)Reader.ReadUInt32();
            Unk43 = Reader.ReadUInt32();
            CastTime = Reader.ReadUInt32();

            byte hits = Reader.ReadByte();
            Hits.Capacity = hits;
            for (byte i = 0; i < hits; ++i)
                Hits.Add(Reader.ReadGuid());

            byte misses = Reader.ReadByte();
            Misses.Capacity = misses;
            for (byte i = 0; i < misses; ++i)
            {
                var miss = new MissData();
                miss.Read(Reader);
                Misses.Add(miss);
            }

            TargetData.Read(Reader);

            if ((Flags & CastFlags.PredictedPower) != 0)
                PredictedPower = Reader.ReadUInt32();

            if ((Flags & CastFlags.RuneStates) != 0)
            {
                RunesBefore = (RuneStates)Reader.ReadByte();
                RunesAfter = (RuneStates)Reader.ReadByte();
                for (int i = 0; i < RuneCooldowns.Length; ++i)
                    RuneCooldowns[i] = Reader.ReadByte();
            }

            if ((Flags & CastFlags.Unk0x00020000) != 0)
            {
                Unk0x20000_Float = Reader.ReadSingle();
                Unk0x20000_UInt32 = Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.Ammo) != 0)
            {
                ProjectileDisplayId = Reader.ReadUInt32();
                ProjectileInventoryType = (InventorySlotType)Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.Unk0x00080000) != 0)
            {
                Unk0x80000_UInt32_1 = Reader.ReadUInt32();
                Unk0x80000_UInt32_2 = Reader.ReadUInt32();
            }

            if ((TargetData.Flags & SpellCastTargetFlags.DestLocation) != 0)
                DestLocationCounter = Reader.ReadByte();

            if ((TargetData.Flags & SpellCastTargetFlags.Unk4) != 0)
            {
                uint count = Reader.ReadUInt32();
                Unk4_Count = count;
                Unk4_List.Capacity = (int)count;

                for (uint i = 0; i < count; ++i)
                {
                    Vector3 v3 = Reader.ReadVector3();
                    WowGuid guid = Reader.ReadGuid();
                    Unk4_List.Add(new KeyValuePair<WowGuid, Vector3>(guid, v3));
                    if (guid.IsEmpty)
                        break;
                }
            }
        }
コード例 #24
0
ファイル: Aura.cs プロジェクト: CarlosX/Kamilla.Wow
        public void Read(StreamHandler Reader)
        {
            Slot = Reader.ReadByte();
            Spell = Reader.ReadUInt32();

            Caster = Unit;

            if (Spell != 0)
            {
                Flags = (AuraFlags)Reader.ReadUInt16();
                Level = Reader.ReadByte();
                Charges = Reader.ReadByte();

                if ((Flags & AuraFlags.NotCaster) == 0)
                    Caster = Reader.ReadPackedGuid();

                if ((Flags & AuraFlags.Duration) != 0)
                {
                    MaxDuration = Reader.ReadUInt32();
                    var currentDurationMs = Reader.ReadUInt32();

                    this.AppliedTime = (uint)Environment.TickCount - currentDurationMs;
                }

                if ((Flags & AuraFlags.BasePoints) != 0)
                {
                    for (int i = 0; i < MaxEffects; ++i)
                    {
                        if ((Flags & (AuraFlags)(1 << i)) != 0)
                            BasePoints[i] = Reader.ReadInt32();
                        else
                            BasePoints[i] = 0;
                    }
                }
                else
                    Array.Clear(BasePoints, 0, MaxEffects);
            }
        }