Пример #1
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (m_Parrot != null)
            {
                if (m_Parrot.Name != null)
                {
                    list.Add(1072624, m_Parrot.Name);                       // Includes a pet Parrot named ~1_NAME~
                }
                else
                {
                    list.Add(1072620);                       // Includes a pet Parrot
                }
                int weeks = PetParrot.GetWeeks(m_Parrot.Birth);

                if (weeks == 1)
                {
                    list.Add(1072626);                       // 1 week old
                }
                else if (weeks > 1)
                {
                    list.Add(1072627, weeks.ToString());                       // ~1_AGE~ weeks old
                }
            }
        }
Пример #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Parrot = reader.ReadMobile() as PetParrot;
        }
Пример #3
0
        public ParrotPerchAddonDeed(PetParrot parrot)
        {
            ItemValue = ItemValue.Common;

            LootType = LootType.Blessed;

            m_Parrot = parrot;
        }
Пример #4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is AddonComponent)
                {
                    var component = (AddonComponent)targeted;

                    if (component.Addon is ParrotPerchAddon)
                    {
                        var perch = (ParrotPerchAddon)component.Addon;

                        BaseHouse house = BaseHouse.FindHouseAt(perch);

                        if (house != null && house.IsCoOwner(from))
                        {
                            if (perch.Parrot == null || perch.Parrot.Deleted)
                            {
                                var parrot = new PetParrot {
                                    Hue = m_Parrot.Hue
                                };
                                parrot.MoveToWorld(perch.Location, perch.Map);
                                parrot.Z += 12;

                                perch.Parrot = parrot;
                                m_Parrot.Delete();
                            }
                            else
                            {
                                from.SendLocalizedMessage(1072616); //That Parrot Perch already has a Parrot.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1072618);
                            //Parrots can only be placed on Parrot Perches in houses where you are an owner or co-owner.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1072614); //You must place the Parrot on a Parrot Perch.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1072614); //You must place the Parrot on a Parrot Perch.
                }
            }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
			
            switch ( version )
            {
                case 1:
                    this.m_Parrot = reader.ReadMobile() as PetParrot;
					
                    break;
                case 0: 
                    reader.ReadDateTime();
                    reader.ReadString();
                    reader.ReadInt();
					
                    break;
            }
        }
Пример #6
0
        public ParrotPerchAddon(PetParrot parrot)
        {
            AddComponent(new AddonComponent(0x2FB6), 0, 0, 0);

            m_Parrot = parrot;
        }
Пример #7
0
        public ParrotPerchAddonDeed(PetParrot parrot)
        {
            LootType = LootType.Blessed;

            m_Parrot = parrot;
        }