Beispiel #1
0
        public MirrorImageData(WowPlayer source, WowGuid destination)
        {
            this.Entity = destination;
            this.Model = source.Model;
            this.Race = source.Race;
            this.Gender = source.Gender;
            this.Class = source.Class;
            this.Skin = source.Skin;
            this.Face = source.Face;
            this.Hair = source.HairStyle;
            this.HairColor = source.HairColor;
            this.FaceFeatures = source.FaceFeatures;
            this.Guild = new WowGuid(source.GetULong(ObjectUpdateFields.OBJECT_FIELD_DATA));

            this.Head = source.GetVisibleItemEntry(InventorySlot.Head);
            this.Shoulders = source.GetVisibleItemEntry(InventorySlot.Shoulders);
            this.Body = source.GetVisibleItemEntry(InventorySlot.Body);
            this.Chest = source.GetVisibleItemEntry(InventorySlot.Chest);
            this.Waist = source.GetVisibleItemEntry(InventorySlot.Waist);
            this.Legs = source.GetVisibleItemEntry(InventorySlot.Legs);
            this.Feet = source.GetVisibleItemEntry(InventorySlot.Feet);
            this.Wrists = source.GetVisibleItemEntry(InventorySlot.Wrists);
            this.Hands = source.GetVisibleItemEntry(InventorySlot.Hands);
            this.Back = source.GetVisibleItemEntry(InventorySlot.Back);
            this.Tabard = source.GetVisibleItemEntry(InventorySlot.Tabard);
        }
Beispiel #2
0
        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);
        }