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(); } }
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(); }
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(); } } }
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() }; }
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() } } ; }
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); } }
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); }
private void ReadObjectDestroyUpdate(StreamHandler Reader) { uint nObjects = Reader.ReadUInt32(); for (var i = 0; i < nObjects; ++i) { m_destroyedObjects.Add(Reader.ReadPackedGuid()); } }
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(); } }
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); } }
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(); } }
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); } }
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); }
public MonsterMove(StreamHandler Reader, bool LazyReading) { this.Unit = Reader.ReadPackedGuid(); this.Reader = Reader; m_readers = new Action[] { ReadMovementData }; if (!LazyReading) { EnsureRead(); } }
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); } } }
public override void Read(StreamHandler reader) { this.Unit = reader.ReadPackedGuid(); }
public override void Read(StreamHandler reader) { this.Unit = reader.ReadPackedGuid(); this.Victim = reader.ReadPackedGuid(); }
public MonsterMove(StreamHandler Reader, bool LazyReading) { this.Unit = Reader.ReadPackedGuid(); this.Reader = Reader; m_readers = new Action[] { ReadMovementData }; if (!LazyReading) EnsureRead(); }
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; } } } }
private void ReadObjectDestroyUpdate(StreamHandler Reader) { uint nObjects = Reader.ReadUInt32(); for (var i = 0; i < nObjects; ++i) m_destroyedObjects.Add(Reader.ReadPackedGuid()); }
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(); } }
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; } } }
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); } }