コード例 #1
0
		public static void AddStatue( PlayercastStatue statue )
		{
			if( m_List.Contains( statue ) )
				m_List.Remove( statue );

			m_List.Add( statue );
		}
コード例 #2
0
 public static void RemoveStatue(PlayercastStatue statue)
 {
     if (m_List.Contains(statue))
     {
         m_List.Remove(statue);
     }
 }
コード例 #3
0
ファイル: Plinth.cs プロジェクト: greeduomacro/hubroot
		public Plinth( PlayercastStatue statue )
            : base( 0x0788 )
		{
			Hue = (int)statue.Material;
			Movable = false;
			Name = "a statue plinth";

			m_Statue = statue;
		}
コード例 #4
0
        public Plinth(PlayercastStatue statue)
            : base(0x0788)
        {
            Hue     = (int)statue.Material;
            Movable = false;
            Name    = "a statue plinth";

            m_Statue = statue;
        }
コード例 #5
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            #region v0
            m_Statue = reader.ReadMobile() as PlayercastStatue;

            m_Engraving = reader.ReadString();
            #endregion
        }
コード例 #6
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from) && IsAccessibleTo(from))
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (ValidateHouse(house, from) || from.AccessLevel >= AccessLevel.Counselor)
                {
                    PlayercastStatue statue = new PlayercastStatue(from);
                    statue.Direction = from.Direction;

                    if (CloneMobile(from, statue))
                    {
                        statue.MoveToWorld(new Point3D(from.Location), from.Map);
                        statue.HasPlinth = m_HasPlinth;
                        statue.Material  = MaterialType.GrayMarble;

                        this.Delete();
                    }
                    else
                    {
                        from.SendMessage("Statue construction failed. Please contact your administrator.");

                        statue.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502092);                       //You must be in your house to do this.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001);                   //That must be in your pack to use it.
            }
        }
コード例 #7
0
		private bool CloneMobile( Mobile m, PlayercastStatue statue )
		{
			bool success = false;

			try
			{
				statue.Body = m.Body;
				statue.Female = m.Female;
				statue.Hue = m.Hue;
				statue.RawName = String.Format( "a statue of {0}", m.RawName );

				statue.RawDex = m.RawDex;
				statue.RawInt = m.RawInt;
				statue.RawStr = m.RawStr;

				statue.Hits = statue.HitsMax;
				statue.Mana = statue.ManaMax;
				statue.Stam = statue.StamMax;

				statue.HairItemID = m.HairItemID;
				statue.FacialHairItemID = m.FacialHairItemID;

				statue.HairHue = m.HairHue;
				statue.FacialHairHue = m.FacialHairHue;

				for( int i = 0; i < m.Items.Count; i++ )
				{
					Item item = m.Items[i];

					if( item != null && !item.Deleted )
					{
						if( item.RootParent == m && item != m.Backpack && item != m.BankBox && item.Layer != Layer.Mount )
						{
							Item newItem = new Item( item.ItemID );
							newItem.Hue = item.Hue;
							newItem.Layer = item.Layer;
							newItem.Movable = false;
							newItem.Name = item.Name;

							statue.AddItem( newItem );
						}
					}
				}

				for( int i = 0; i < SkillInfo.Table.Length; i++ )
				{
					statue.Skills[i].Cap = statue.Skills[i].Base = m.Skills[i].Cap;
				}

				if( m.Mount != null && m.Mount is BaseMount )
				{
					BaseMount newMount = (BaseMount)Activator.CreateInstance( ((BaseMount)m.Mount).GetType() );

					newMount.Direction = statue.Direction;
					newMount.Hue = (int)statue.Material;
					newMount.Rider = statue;
				}

				success = true;
			}
			catch { success = false; }

			return success;
		}
コード例 #8
0
		public override void OnDoubleClick( Mobile from )
		{
			if( IsChildOf( from ) && IsAccessibleTo( from ) )
			{
				BaseHouse house = BaseHouse.FindHouseAt( from );

				if( ValidateHouse( house, from ) || from.AccessLevel >= AccessLevel.Counselor )
				{
					PlayercastStatue statue = new PlayercastStatue( from );
					statue.Direction = from.Direction;

					if( CloneMobile( from, statue ) )
					{
						statue.MoveToWorld( new Point3D( from.Location ), from.Map );
						statue.HasPlinth = m_HasPlinth;
						statue.Material = MaterialType.GrayMarble;

						this.Delete();
					}
					else
					{
						from.SendMessage( "Statue construction failed. Please contact your administrator." );

						statue.Delete();
					}
				}
				else
					from.SendLocalizedMessage( 502092 ); //You must be in your house to do this.
			}
			else
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
		}
コード例 #9
0
ファイル: Plinth.cs プロジェクト: greeduomacro/hubroot
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			#region v0
			m_Statue = reader.ReadMobile() as PlayercastStatue;

			m_Engraving = reader.ReadString();
			#endregion
		}
コード例 #10
0
        public PlayercastStatueGump(Mobile owner, PlayercastStatue statue)
            : base(10, 10)
        {
            m_Owner  = owner;
            m_Statue = statue;

            Closable   = true;
            Disposable = true;
            Dragable   = true;

            int i = 0, j = 0;
            int x = 20, y = 55;

            #region Page 1 //Main
            AddPage(1);
            AddDefaultBackround(170, 245);

            string[] labels0 = new string[] { "Adjust Pose", "Change Material", "Engrave", "Turn", "Change Name" };

            for (i = 0, j = 0; i < labels0.Length; i++, j += 30)
            {
                if (i == 2 || i == 4)
                {
                    AddButton(x, y + j, 2103, 2104, i + 1, GumpButtonType.Reply, 0);
                }
                else
                {
                    AddButton(x, y + j, 2103, 2104, i + 1, GumpButtonType.Page, i < 2 ? i + 2 : i + 1);
                }

                AddLabel(x + 20, (y - 5) + j, LabelHue, (string)labels0[i]);
            }

            AddButton(20, 215, 3, 4, 6, GumpButtonType.Reply, 0);
            AddLabel(45, 210, LabelHue, "Re-deed");
            #endregion

            #region Page 2 //Adjust Pose
            AddPage(2);
            AddDefaultBackround(170, 250);

            string[] labels1 = new string[] { "All Praise Me", "Casting", "Fighting", "Hands on Hips", "Ready", "Salute" };

            for (i = 0, j = 0; i < labels1.Length; i++, j += 30)
            {
                AddButton(x, y + j, 2103, 2104, i + 10, GumpButtonType.Reply, 0);
                AddLabel(x + 20, (y - 5) + j, LabelHue, (string)labels1[i]);
            }

            AddButton(125, 215, 4014, 4016, 101, GumpButtonType.Page, 1);
            #endregion

            #region Page 3 //Change Material
            AddPage(3);
            AddDefaultBackround(325, 480);

            SortedDictionary <string, int> materialTable = new SortedDictionary <string, int>(StringComparer.CurrentCulture);

            foreach (int v in Enum.GetValues(typeof(MaterialType)))
            {
                if (!materialTable.ContainsValue(v) && v != 0)
                {
                    materialTable.Add(Enum.GetName(typeof(MaterialType), v), v);
                }
            }

            i = j = 0;
            int k = 0;

            foreach (KeyValuePair <string, int> kvp in materialTable)
            {
                if (i <= (materialTable.Count / 2))
                {
                    AddButton(x, y + j, 2103, 2104, kvp.Value, GumpButtonType.Reply, 0);
                    AddLabel(x + 20, (y - 5) + j, LabelHue, Util.SplitString(kvp.Key));

                    j += 30;
                }
                else
                {
                    AddButton(x + 145, y + k, 2103, 2104, kvp.Value, GumpButtonType.Reply, 0);
                    AddLabel(x + 145 + 20, (y - 5) + k, LabelHue, Util.SplitString(kvp.Key));

                    k += 30;
                }

                i++;
            }

            AddButton(280, 445, 4014, 4016, 101, GumpButtonType.Page, 1);
            #endregion

            #region Page 4 //Turn
            AddPage(4);
            AddDefaultBackround(185, 280);

            AddButton(65, 55, 4500, 4500, 450, GumpButtonType.Reply, 0);
            AddButton(100, 80, 4501, 4501, 451, GumpButtonType.Reply, 0);
            AddButton(120, 115, 4502, 4502, 452, GumpButtonType.Reply, 0);
            AddButton(100, 150, 4503, 4503, 453, GumpButtonType.Reply, 0);
            AddButton(65, 165, 4504, 4504, 454, GumpButtonType.Reply, 0);
            AddButton(30, 150, 4505, 4505, 455, GumpButtonType.Reply, 0);
            AddButton(15, 115, 4506, 4506, 456, GumpButtonType.Reply, 0);
            AddButton(30, 80, 4507, 4507, 457, GumpButtonType.Reply, 0);

            AddButton(140, 245, 4014, 4016, 101, GumpButtonType.Page, 1);
            #endregion
        }
コード例 #11
0
 public StatueRenamePrompt(PlayercastStatue s)
 {
     m_Statue = s;
 }
コード例 #12
0
 public EngraveStatuePrompt(PlayercastStatue s)
 {
     m_Statue = s;
 }
コード例 #13
0
        public PlayercastStatueGump( Mobile owner, PlayercastStatue statue )
            : base(10, 10)
        {
            m_Owner = owner;
            m_Statue = statue;

            Closable = true;
            Disposable = true;
            Dragable = true;

            int i = 0, j = 0;
            int x = 20, y = 55;

            #region Page 1 //Main
            AddPage(1);
            AddDefaultBackround(170, 245);

            string[] labels0 = new string[] { "Adjust Pose", "Change Material", "Engrave", "Turn", "Change Name" };

            for( i = 0, j = 0; i < labels0.Length; i++, j += 30 )
            {
                if( i == 2 || i == 4 )
                    AddButton(x, y + j, 2103, 2104, i + 1, GumpButtonType.Reply, 0);
                else
                    AddButton(x, y + j, 2103, 2104, i + 1, GumpButtonType.Page, i < 2 ? i + 2 : i + 1);

                AddLabel(x + 20, (y - 5) + j, LabelHue, (string)labels0[i]);
            }

            AddButton(20, 215, 3, 4, 6, GumpButtonType.Reply, 0);
            AddLabel(45, 210, LabelHue, "Re-deed");
            #endregion

            #region Page 2 //Adjust Pose
            AddPage(2);
            AddDefaultBackround(170, 250);

            string[] labels1 = new string[] { "All Praise Me", "Casting", "Fighting", "Hands on Hips", "Ready", "Salute" };

            for( i = 0, j = 0; i < labels1.Length; i++, j += 30 )
            {
                AddButton(x, y + j, 2103, 2104, i + 10, GumpButtonType.Reply, 0);
                AddLabel(x + 20, (y - 5) + j, LabelHue, (string)labels1[i]);
            }

            AddButton(125, 215, 4014, 4016, 101, GumpButtonType.Page, 1);
            #endregion

            #region Page 3 //Change Material
            AddPage(3);
            AddDefaultBackround(325, 480);

            SortedDictionary<string, int> materialTable = new SortedDictionary<string, int>(StringComparer.CurrentCulture);

            foreach( int v in Enum.GetValues(typeof(MaterialType)) )
            {
                if( !materialTable.ContainsValue(v) && v != 0 )
                    materialTable.Add(Enum.GetName(typeof(MaterialType), v), v);
            }

            i = j = 0;
            int k = 0;

            foreach( KeyValuePair<string, int> kvp in materialTable )
            {
                if( i <= (materialTable.Count / 2) )
                {
                    AddButton(x, y + j, 2103, 2104, kvp.Value, GumpButtonType.Reply, 0);
                    AddLabel(x + 20, (y - 5) + j, LabelHue, Util.SplitString(kvp.Key));

                    j += 30;
                }
                else
                {
                    AddButton(x + 145, y + k, 2103, 2104, kvp.Value, GumpButtonType.Reply, 0);
                    AddLabel(x + 145 + 20, (y - 5) + k, LabelHue, Util.SplitString(kvp.Key));

                    k += 30;
                }

                i++;
            }

            AddButton(280, 445, 4014, 4016, 101, GumpButtonType.Page, 1);
            #endregion

            #region Page 4 //Turn
            AddPage(4);
            AddDefaultBackround(185, 280);

            AddButton(65, 55, 4500, 4500, 450, GumpButtonType.Reply, 0);
            AddButton(100, 80, 4501, 4501, 451, GumpButtonType.Reply, 0);
            AddButton(120, 115, 4502, 4502, 452, GumpButtonType.Reply, 0);
            AddButton(100, 150, 4503, 4503, 453, GumpButtonType.Reply, 0);
            AddButton(65, 165, 4504, 4504, 454, GumpButtonType.Reply, 0);
            AddButton(30, 150, 4505, 4505, 455, GumpButtonType.Reply, 0);
            AddButton(15, 115, 4506, 4506, 456, GumpButtonType.Reply, 0);
            AddButton(30, 80, 4507, 4507, 457, GumpButtonType.Reply, 0);

            AddButton(140, 245, 4014, 4016, 101, GumpButtonType.Page, 1);
            #endregion
        }
コード例 #14
0
        private bool CloneMobile(Mobile m, PlayercastStatue statue)
        {
            bool success = false;

            try
            {
                statue.Body    = m.Body;
                statue.Female  = m.Female;
                statue.Hue     = m.Hue;
                statue.RawName = String.Format("a statue of {0}", m.RawName);

                statue.RawDex = m.RawDex;
                statue.RawInt = m.RawInt;
                statue.RawStr = m.RawStr;

                statue.Hits = statue.HitsMax;
                statue.Mana = statue.ManaMax;
                statue.Stam = statue.StamMax;

                statue.HairItemID       = m.HairItemID;
                statue.FacialHairItemID = m.FacialHairItemID;

                statue.HairHue       = m.HairHue;
                statue.FacialHairHue = m.FacialHairHue;

                for (int i = 0; i < m.Items.Count; i++)
                {
                    Item item = m.Items[i];

                    if (item != null && !item.Deleted)
                    {
                        if (item.RootParent == m && item != m.Backpack && item != m.BankBox && item.Layer != Layer.Mount)
                        {
                            Item newItem = new Item(item.ItemID);
                            newItem.Hue     = item.Hue;
                            newItem.Layer   = item.Layer;
                            newItem.Movable = false;
                            newItem.Name    = item.Name;

                            statue.AddItem(newItem);
                        }
                    }
                }

                for (int i = 0; i < SkillInfo.Table.Length; i++)
                {
                    statue.Skills[i].Cap = statue.Skills[i].Base = m.Skills[i].Cap;
                }

                if (m.Mount != null && m.Mount is BaseMount)
                {
                    BaseMount newMount = (BaseMount)Activator.CreateInstance(((BaseMount)m.Mount).GetType());

                    newMount.Direction = statue.Direction;
                    newMount.Hue       = (int)statue.Material;
                    newMount.Rider     = statue;
                }

                success = true;
            }
            catch { success = false; }

            return(success);
        }
コード例 #15
0
ファイル: StatuePrompts.cs プロジェクト: greeduomacro/hubroot
		public StatueRenamePrompt( PlayercastStatue s )
		{
			m_Statue = s;
		}
コード例 #16
0
ファイル: StatuePrompts.cs プロジェクト: greeduomacro/hubroot
		public EngraveStatuePrompt( PlayercastStatue s )
		{
			m_Statue = s;
		}