Наследование: Server.Mobile, IRewardItem
Пример #1
0
        public CharacterStatuePlinth( CharacterStatue statue )
            : base(0x32F2)
        {
            m_Statue = statue;

            InvalidateHue();
        }
Пример #2
0
		public CharacterStatueDeed( CharacterStatue statue ) : base( 0x14F0 )
		{
			m_Statue = statue;
		
			LootType = LootType.Blessed;
			Weight = 1.0;
		}
Пример #3
0
        public CharacterStatueDeed(CharacterStatue statue) : base(0x14F0)
        {
            m_Statue = statue;

            LootType = LootType.Blessed;
            Weight   = 1.0;
        }
Пример #4
0
        public CharacterStatueGump( Item maker, CharacterStatue statue, Mobile owner )
            : base(60, 36)
        {
            m_Maker = maker;
            m_Statue = statue;
            m_Owner = owner;

            if ( m_Statue == null )
                return;

            Closable = true;
            Disposable = true;
            Dragable = true;
            Resizable = false;

            AddPage( 0 );

            AddBackground( 0, 0, 327, 324, 0x13BE );
            AddImageTiled( 10, 10, 307, 20, 0xA40 );
            AddImageTiled( 10, 40, 307, 244, 0xA40 );
            AddImageTiled( 10, 294, 307, 20, 0xA40 );
            AddAlphaRegion( 10, 10, 307, 304 );
            AddHtmlLocalized( 14, 12, 327, 20, 1076156, 0x7FFF, false, false ); // Character Statue Maker

            // pose
            AddHtmlLocalized( 133, 41, 120, 20, 1076168, 0x7FFF, false, false ); // Choose Pose
            AddHtmlLocalized( 133, 61, 120, 20, 1076208 + (int) m_Statue.Pose, 0x77E, false, false );
            AddButton( 163, 81, 0xFA5, 0xFA7, (int) Buttons.PoseNext, GumpButtonType.Reply, 0 );
            AddButton( 133, 81, 0xFAE, 0xFB0, (int) Buttons.PosePrev, GumpButtonType.Reply, 0 );

            // direction
            AddHtmlLocalized( 133, 126, 120, 20, 1076170, 0x7FFF, false, false ); // Choose Direction
            AddHtmlLocalized( 133, 146, 120, 20, GetDirectionNumber( m_Statue.Direction ), 0x77E, false, false );
            AddButton( 163, 167, 0xFA5, 0xFA7, (int) Buttons.DirNext, GumpButtonType.Reply, 0 );
            AddButton( 133, 167, 0xFAE, 0xFB0, (int) Buttons.DirPrev, GumpButtonType.Reply, 0 );

            // material
            AddHtmlLocalized( 133, 211, 120, 20, 1076171, 0x7FFF, false, false ); // Choose Material
            AddHtmlLocalized( 133, 231, 120, 20, GetMaterialNumber( m_Statue.StatueType, m_Statue.Material ), 0x77E, false, false );
            AddButton( 163, 253, 0xFA5, 0xFA7, (int) Buttons.MatNext, GumpButtonType.Reply, 0 );
            AddButton( 133, 253, 0xFAE, 0xFB0, (int) Buttons.MatPrev, GumpButtonType.Reply, 0 );

            // cancel
            AddButton( 10, 294, 0xFB1, 0xFB2, (int) Buttons.Close, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 45, 294, 80, 20, 1006045, 0x7FFF, false, false );	// Cancel

            // sculpt
            AddButton( 234, 294, 0xFB7, 0xFB9, (int) Buttons.Sculpt, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 269, 294, 80, 20, 1076174, 0x7FFF, false, false ); // Sculpt

            // restore
            if ( m_Maker is CharacterStatueDeed )
            {
                AddButton( 107, 294, 0xFAB, 0xFAD, (int) Buttons.Restore, GumpButtonType.Reply, 0 );
                AddHtmlLocalized( 142, 294, 80, 20, 1076193, 0x7FFF, false, false ); // Restore
            }

            m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), TimeSpan.FromSeconds( 2.5 ), new TimerCallback( CheckOnline ) );
        }
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadEncodedInt();

			m_Statue = reader.ReadMobile() as CharacterStatue;
		}
Пример #6
0
        public CharacterStatueGump(Item maker, CharacterStatue statue, Mobile owner)
            : base(60, 36)
        {
            this.m_Maker = maker;
            this.m_Statue = statue;
            this.m_Owner = owner;

            if (this.m_Statue == null)
                return;

            this.Closable = true;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = false;

            this.AddPage(0);

            this.AddBackground(0, 0, 327, 324, 0x13BE);
            this.AddImageTiled(10, 10, 307, 20, 0xA40);
            this.AddImageTiled(10, 40, 307, 244, 0xA40);
            this.AddImageTiled(10, 294, 307, 20, 0xA40);
            this.AddAlphaRegion(10, 10, 307, 304);
            this.AddHtmlLocalized(14, 12, 327, 20, 1076156, 0x7FFF, false, false); // Character Statue Maker

            // pose
            this.AddHtmlLocalized(133, 41, 120, 20, 1076168, 0x7FFF, false, false); // Choose Pose
            this.AddHtmlLocalized(133, 61, 120, 20, 1076208 + (int)this.m_Statue.Pose, 0x77E, false, false);
            this.AddButton(163, 81, 0xFA5, 0xFA7, (int)Buttons.PoseNext, GumpButtonType.Reply, 0);
            this.AddButton(133, 81, 0xFAE, 0xFB0, (int)Buttons.PosePrev, GumpButtonType.Reply, 0);

            // direction
            this.AddHtmlLocalized(133, 126, 120, 20, 1076170, 0x7FFF, false, false); // Choose Direction
            this.AddHtmlLocalized(133, 146, 120, 20, this.GetDirectionNumber(this.m_Statue.Direction), 0x77E, false, false);
            this.AddButton(163, 167, 0xFA5, 0xFA7, (int)Buttons.DirNext, GumpButtonType.Reply, 0);
            this.AddButton(133, 167, 0xFAE, 0xFB0, (int)Buttons.DirPrev, GumpButtonType.Reply, 0);

            // material
            this.AddHtmlLocalized(133, 211, 120, 20, 1076171, 0x7FFF, false, false); // Choose Material
            this.AddHtmlLocalized(133, 231, 120, 20, this.GetMaterialNumber(this.m_Statue.StatueType, this.m_Statue.Material), 0x77E, false, false);
            this.AddButton(163, 253, 0xFA5, 0xFA7, (int)Buttons.MatNext, GumpButtonType.Reply, 0);
            this.AddButton(133, 253, 0xFAE, 0xFB0, (int)Buttons.MatPrev, GumpButtonType.Reply, 0);

            // cancel
            this.AddButton(10, 294, 0xFB1, 0xFB2, (int)Buttons.Close, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(45, 294, 80, 20, 1006045, 0x7FFF, false, false);	// Cancel

            // sculpt
            this.AddButton(234, 294, 0xFB7, 0xFB9, (int)Buttons.Sculpt, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(269, 294, 80, 20, 1076174, 0x7FFF, false, false); // Sculpt

            // restore
            if (this.m_Maker is CharacterStatueDeed)
            {
                this.AddButton(107, 294, 0xFAB, 0xFAD, (int)Buttons.Restore, GumpButtonType.Reply, 0);
                this.AddHtmlLocalized(142, 294, 80, 20, 1076193, 0x7FFF, false, false); // Restore
            }
        }
Пример #7
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            m_Statue       = reader.ReadMobile() as CharacterStatue;
            m_IsRewardItem = reader.ReadBool();
        }
        public void Delete(bool keepstatue)
        {
            if (keepstatue)
            {
                m_Statue = null;
            }

            Delete();
        }
		public override void OnAfterDelete()
		{
			base.OnAfterDelete();

			if (m_Statue == null)
			{
				return;
			}

			m_Statue.Delete();
			m_Statue = null;
		}
Пример #10
0
        public void Restore(CharacterStatue from)
        {
            this.m_Material = from.Material;
            this.m_Pose     = from.Pose;

            this.Direction = from.Direction;

            this.CloneBody(from);
            this.CloneClothes(from);

            this.InvalidateHues();
            this.InvalidatePose();
        }
Пример #11
0
		public CharacterPlinthGump( CharacterStatue statue ) : base( 60, 30 )
		{						
			Closable = true;
			Disposable = true;
			Dragable = true;
			Resizable = false;
		
			AddPage( 0 );			
			AddImage( 0, 0, 0x24F4 );
			AddHtml( 55, 50, 150, 20, statue.Name, false, false );
			AddHtml( 55, 75, 150, 20, statue.SculptedOn.ToString( "G", new CultureInfo("de-DE") ), false, false );
			AddHtmlLocalized( 55, 100, 150, 20, GetTypeNumber( statue.StatueType ), 0, false, false );
		}
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			reader.ReadEncodedInt();

			m_Statue = reader.ReadMobile<CharacterStatue>();

			if (m_Statue == null || m_Statue.SculptedBy == null || Map == Map.Internal)
			{
				Timer.DelayCall(TimeSpan.Zero, Delete);
			}
		}
Пример #13
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadEncodedInt();

            m_Statue = reader.ReadMobile() as CharacterStatue;

            if( m_Statue == null || m_Statue.SculptedBy == null || Map == Map.Internal )
            {
                Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) );
            }
        }
Пример #14
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            if (version >= 1)
            {
                m_Type = (StatueType)reader.ReadInt();
            }

            m_Statue = reader.ReadMobile() as CharacterStatue;
        }
Пример #15
0
        public CharacterStatueDeed(CharacterStatue statue) : base(0x14F0)
        {
            m_Statue = statue;

            if (statue != null)
            {
                m_Type         = statue.StatueType;
                m_IsRewardItem = statue.IsRewardItem;
            }

            LootType = LootType.Blessed;
            Weight   = 1.0;
        }
Пример #16
0
        public void Restore(CharacterStatue from)
        {
            m_Material = from.Material;
            m_Pose     = from.Pose;

            Direction = from.Direction;

            CloneBody(from);
            CloneClothes(from);

            InvalidateHues();
            InvalidatePose();
        }
Пример #17
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            if (version >= 1)
            {
                this.m_Type = (StatueType)reader.ReadInt();
            }

            this.m_Statue       = reader.ReadMobile() as CharacterStatue;
            this.m_IsRewardItem = reader.ReadBool();
        }
Пример #18
0
        public CharacterStatueDeed(CharacterStatue statue)
            : base(0x14F0)
        {
            m_Statue = statue;

            if (statue != null)
            {
                m_Type = statue.StatueType;
            }

            Name = "a character statue deed";

            LootType = LootType.Blessed;
            Weight   = 1.0;
        }
Пример #19
0
        public void Restore(CharacterStatue m)
        {
            if (m == null || m.Deleted)
            {
                return;
            }

            m_Pose = m.Pose;

            Direction = m.Direction;

            CloneBody(m);
            CloneClothes(m);

            InvalidateHues();
            InvalidatePose();
        }
		protected override void OnTarget( Mobile from, object targeted )
		{
			IPoint3D p = targeted as IPoint3D;
			Map map = from.Map;

			if ( p == null || map == null || m_Maker == null || m_Maker.Deleted )
				return;
				
			if ( m_Maker.IsChildOf( from.Backpack ) )
			{
				SpellHelper.GetSurfaceTop( ref p );			
				BaseHouse house = null;
				Point3D loc = new Point3D( p );
				
				AddonFitResult result = CouldFit( loc, map, from, ref house );
								
				if ( result == AddonFitResult.Valid )
				{				
					CharacterStatue statue = new CharacterStatue( from, m_Type );
					CharacterStatuePlinth plinth = new CharacterStatuePlinth( statue );
										
					house.Addons.Add( plinth );
					
					statue.Plinth = plinth;
					plinth.MoveToWorld( loc, map );
					statue.InvalidatePose();
					
					from.SendGump( new CharacterStatueGump( m_Maker, statue ) );
				}
				else if ( result == AddonFitResult.Blocked )
					from.SendLocalizedMessage( 500269 ); // You cannot build that there.
				else if ( result == AddonFitResult.NotInHouse )
					from.SendLocalizedMessage( 1076192 ); // Statues can only be placed in houses where you are the owner or co-owner.
				else if ( result == AddonFitResult.DoorsNotClosed )
					from.SendMessage( "You must close all house doors before placing this." );
				else if ( result == AddonFitResult.DoorTooClose )
					from.SendLocalizedMessage( 500271 ); // You cannot build near the door.				
			}
			else
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
		}
Пример #21
0
        protected override void OnTarget( Mobile from, object targeted )
        {
            IPoint3D p = targeted as IPoint3D;
            Map map = from.Map;

            if ( p == null || map == null || m_Maker == null || m_Maker.Deleted )
                return;

            if ( m_Maker.IsChildOf( from.Backpack ) )
            {
                SpellHelper.GetSurfaceTop( ref p );
                BaseHouse house = null;
                Point3D loc = new Point3D( p );

                if ( targeted is Item && !((Item) targeted).IsLockedDown && !((Item) targeted).IsSecure && !(targeted is AddonComponent) )
                {
                    from.SendLocalizedMessage( 1076191 ); // Statues can only be placed in houses.
                    return;
                }
                else if ( from.IsBodyMod )
                {
                    from.SendLocalizedMessage( 1073648 ); // You may only proceed while in your original state...
                    return;
                }

                AddonFitResult result = CouldFit( loc, map, from, ref house );

                if ( result == AddonFitResult.Valid )
                {
                    CharacterStatue statue = new CharacterStatue( from, m_Type );
                    CharacterStatuePlinth plinth = new CharacterStatuePlinth( statue );

                    house.Addons.Add( plinth );

                    if ( m_Maker is IRewardItem )
                        statue.IsRewardItem = ( (IRewardItem) m_Maker).IsRewardItem;

                    statue.Plinth = plinth;
                    plinth.MoveToWorld( loc, map );
                    statue.InvalidatePose();

                    from.CloseGump( typeof( CharacterStatueGump ) );
                    from.SendGump( new CharacterStatueGump( m_Maker, statue, from ) );
                }
                else if ( result == AddonFitResult.Blocked )
                    from.SendLocalizedMessage( 500269 ); // You cannot build that there.
                else if ( result == AddonFitResult.NotInHouse )
                    from.SendLocalizedMessage( 1076192 ); // Statues can only be placed in houses where you are the owner or co-owner.
                else if ( result == AddonFitResult.DoorTooClose )
                    from.SendLocalizedMessage( 500271 ); // You cannot build near the door.
            }
            else
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
        }
Пример #22
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadEncodedInt();

            if ( version >= 1 ) {
                m_Type = (StatueType) reader.ReadInt();
            }

            m_Statue = reader.ReadMobile() as CharacterStatue;
            m_IsRewardItem = reader.ReadBool();
        }
		public CharacterStatueGump( CharacterStatue statue, Mobile owner ) : this( statue, owner, null )
		{
		}
		public void Restore( CharacterStatue from )
		{
			m_Material = from.Material;
			m_Pose = from.Pose;

			Direction = from.Direction;

			CloneBody( from );
			CloneClothes( from );

			InvalidateHues();
			InvalidatePose();
		}
Пример #25
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            var p = targeted as IPoint3D;
            Map map = from.Map;

            if (p == null || map == null || m_Maker == null || m_Maker.Deleted)
            {
                return;
            }

            if (m_Maker.IsChildOf(from.Backpack))
            {
                SpellHelper.GetSurfaceTop(ref p);
                BaseHouse house = null;
                var loc = new Point3D(p);

                if (m_Maker is CharacterStatueDeed && !((CharacterStatueDeed) m_Maker).NoHouse ||
                    m_Maker is CharacterStatueMaker && !((CharacterStatueMaker) m_Maker).NoHouse)
                {
                    if (targeted is Item && !((Item) targeted).IsLockedDown && !((Item) targeted).IsSecure &&
                        !(targeted is AddonComponent))
                    {
                        from.SendLocalizedMessage(1076191); // Statues can only be placed in houses.
                        return;
                    }
                }
                if (@from.IsBodyMod)
                {
                    @from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
                    return;
                }

                AddonFitResult result = CouldFit(loc, map, from, ref house);

                if (result == AddonFitResult.Valid || m_Maker is CharacterStatueDeed && ((CharacterStatueDeed) m_Maker).NoHouse ||
                    m_Maker is CharacterStatueMaker && ((CharacterStatueMaker) m_Maker).NoHouse)
                {
                    var statue = new CharacterStatue(from, m_Type);
                    var plinth = new CharacterStatuePlinth(statue);

                    if (m_Maker is CharacterStatueDeed && !((CharacterStatueDeed) m_Maker).NoHouse ||
                        m_Maker is CharacterStatueMaker && !((CharacterStatueMaker) m_Maker).NoHouse)
                    {
                        house.Addons.Add(plinth);
                    }

                    if (m_Maker is IRewardItem)
                    {
                        statue.IsRewardItem = ((IRewardItem) m_Maker).IsRewardItem;
                    }

                    statue.Plinth = plinth;
                    plinth.MoveToWorld(loc, map);
                    statue.InvalidatePose();

                    /*
                     * TODO: Previously the maker wasn't deleted until after statue
                     * customization, leading to redeeding issues. Exact OSI behavior
                     * needs looking into.
                     */
                    m_Maker.Delete();
                    statue.Sculpt(from);

                    from.CloseGump(typeof(CharacterStatueGump));
                    from.SendGump(new CharacterStatueGump(m_Maker, statue, from));
                }
                else if (result == AddonFitResult.Blocked)
                {
                    from.SendLocalizedMessage(500269); // You cannot build that there.
                }
                else if (result == AddonFitResult.NotInHouse)
                {
                    from.SendLocalizedMessage(1076192);
                    // Statues can only be placed in houses where you are the owner or co-owner.
                }
                else if (result == AddonFitResult.DoorTooClose)
                {
                    from.SendLocalizedMessage(500271); // You cannot build near the door.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
Пример #26
0
        public CharacterStatueDeed(CharacterStatue statue)
            : base(0x14F0)
        {
            m_Statue = statue;

            if (statue != null)
            {
                m_Type = statue.StatueType;
                m_IsRewardItem = statue.IsRewardItem;
            }

            LootType = LootType.Blessed;
            Weight = 1.0;
        }
Пример #27
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            IPoint3D p   = targeted as IPoint3D;
            Map      map = from.Map;

            if (p == null || map == null || m_Maker == null || m_Maker.Deleted)
            {
                return;
            }

            if (m_Maker.IsChildOf(from.Backpack))
            {
                SpellHelper.GetSurfaceTop(ref p);
                BaseHouse house = null;
                Point3D   loc   = new Point3D(p);

                if (targeted is Item && !((Item)targeted).IsLockedDown && !((Item)targeted).IsSecure && !(targeted is AddonComponent))
                {
                    from.SendLocalizedMessage(1076191); // Statues can only be placed in houses.
                    return;
                }
                else if (from.IsBodyMod)
                {
                    from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
                    return;
                }

                AddonFitResult result = CouldFit(loc, map, from, ref house);

                if (result == AddonFitResult.Valid)
                {
                    CharacterStatue       statue = new CharacterStatue(from, m_Type);
                    CharacterStatuePlinth plinth = new CharacterStatuePlinth(statue);

                    house.Addons[plinth] = from;

                    if (m_Maker is IRewardItem)
                    {
                        statue.IsRewardItem = ((IRewardItem)m_Maker).IsRewardItem;
                    }

                    statue.Plinth = plinth;
                    plinth.MoveToWorld(loc, map);
                    statue.InvalidatePose();

                    /*
                     * TODO: Previously the maker wasn't deleted until after statue
                     * customization, leading to redeeding issues. Exact OSI behavior
                     * needs looking into.
                     */
                    m_Maker.Delete();
                    statue.Sculpt(from);

                    from.CloseGump(typeof(CharacterStatueGump));
                    from.SendGump(new CharacterStatueGump(m_Maker, statue, from));
                }
                else if (result == AddonFitResult.Blocked)
                {
                    from.SendLocalizedMessage(500269); // You cannot build that there.
                }
                else if (result == AddonFitResult.NotInHouse)
                {
                    from.SendLocalizedMessage(1076192); // Statues can only be placed in houses where you are the owner or co-owner.
                }
                else if (result == AddonFitResult.DoorTooClose)
                {
                    from.SendLocalizedMessage(500271); // You cannot build near the door.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
        public void Delete( bool keepstatue )
        {
            if ( keepstatue )
                m_Statue = null;

            Delete();
        }
Пример #29
0
        public void Restore(CharacterStatue from)
        {
            this.m_Material = from.Material;
            this.m_Pose = from.Pose;

            this.Direction = from.Direction;

            this.CloneBody(from);
            this.CloneClothes(from);

            this.InvalidateHues();
            this.InvalidatePose();
        }
Пример #30
0
        public CharacterStatueDeed(CharacterStatue statue)
            : base(0x14F0)
        {
            this.m_Statue = statue;

            this.LootType = LootType.Blessed;
            this.Weight = 1.0;
        }
Пример #31
0
            public CharacterPlinthGump(CharacterStatue statue)
                : base(60, 30)
            {
                this.Closable = true;
                this.Disposable = true;
                this.Dragable = true;
                this.Resizable = false;

                this.AddPage(0);
                this.AddImage(0, 0, 0x24F4);
                this.AddHtml(55, 50, 150, 20, statue.Name, false, false);
                this.AddHtml(55, 75, 150, 20, statue.SculptedOn.ToString(), false, false);
                this.AddHtmlLocalized(55, 100, 150, 20, this.GetTypeNumber(statue.StatueType), 0, false, false);
            }
Пример #32
0
        public CharacterStatueDeed(CharacterStatue statue)
            : base(0x14F0)
        {
            m_Statue = statue;

            if (statue != null)
            {
                m_Type = statue.StatueType;
            }

            Name = "a character statue deed";

            LootType = LootType.Blessed;
            Weight = 1.0;
        }
Пример #33
0
 public UpdateTimer(CharacterStatue statue) : base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(1.0))
 {
     Priority = TimerPriority.OneSecond;
     Statue = statue;
 }
Пример #34
0
 public DemolishEntry(CharacterStatue statue)
     : base(6275, 2)
 {
     m_Statue = statue;
 }
			public CharacterPlinthGump(CharacterStatue statue)
				: base(60, 30)
			{
				Closable = true;
				Disposable = true;
				Dragable = true;
				Resizable = false;

				AddPage(0);
				AddImage(0, 0, 0x24F4);
				AddHtml(55, 50, 150, 20, statue.Name, false, false);
				AddHtml(55, 75, 150, 20, statue.SculptedOn.ToString(CultureInfo.InvariantCulture), false, false);
			}
Пример #36
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            IPoint3D p   = targeted as IPoint3D;
            Map      map = from.Map;

            if (p == null || map == null || m_Maker == null || m_Maker.Deleted)
            {
                return;
            }

            if (m_Maker.IsChildOf(from.Backpack))
            {
                SpellHelper.GetSurfaceTop(ref p);
                IHouse  house = null;
                Point3D loc   = new Point3D(p);

                if (targeted is Item && !((Item)targeted).IsLockedDown && !((Item)targeted).IsSecure && !(targeted is AddonComponent))
                {
                    from.SendLocalizedMessage(1076191);                       // Statues can only be placed in houses.
                    return;
                }
                else if (from.IsBodyMod)
                {
                    from.SendLocalizedMessage(1073648);                       // You may only proceed while in your original state...
                    return;
                }

                AddonFitResult result = CouldFit(loc, map, from, ref house);

                if (result == AddonFitResult.Valid)
                {
                    CharacterStatue       statue = new CharacterStatue(from, m_Type);
                    CharacterStatuePlinth plinth = new CharacterStatuePlinth(statue);

                    house.Addons.Add(plinth);

                    if (m_Maker is IRewardItem)
                    {
                        statue.IsRewardItem = ((IRewardItem)m_Maker).IsRewardItem;
                    }

                    statue.Plinth = plinth;
                    plinth.MoveToWorld(loc, map);
                    statue.InvalidatePose();

                    from.CloseGump <CharacterStatueGump>();
                    from.SendGump(new CharacterStatueGump(m_Maker, statue, from));
                }
                else if (result == AddonFitResult.Blocked)
                {
                    from.SendLocalizedMessage(500269);                       // You cannot build that there.
                }
                else if (result == AddonFitResult.NotInHouse)
                {
                    from.SendLocalizedMessage(1076192);                       // Statues can only be placed in houses where you are the owner or co-owner.
                }
                else if (result == AddonFitResult.DoorsNotClosed)
                {
                    from.SendMessage("You must close all house doors before placing this.");
                }
                else if (result == AddonFitResult.DoorTooClose)
                {
                    from.SendLocalizedMessage(500271);                       // You cannot build near the door.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
        }
Пример #37
0
 public UpdateTimer(CharacterStatue statue) : base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(1.0))
 {
     Priority = TimerPriority.OneSecond;
     Statue   = statue;
 }
			public DemolishEntry( CharacterStatue statue ) : base( 6275, 2 )
			{
				m_Statue = statue;
			}
Пример #39
0
        public void Restore(CharacterStatue m)
        {
            if (m == null || m.Deleted)
            {
                return;
            }

            m_Pose = m.Pose;

            Direction = m.Direction;

            CloneBody(m);
            CloneClothes(m);

            InvalidateHues();
            InvalidatePose();
        }