Been messing with converting over an Old RunUO script I have with over 200+ Monster Statuettes and Im having a problem trying to add them to the MonsterStatuettes.cs File as I need to enter them as TextStrings not Clilcs but I'm not quiet sure how or if it's even possible to get around using Clilcs for such a script. I know for custom RewardRobes Custom Clilcs needed added.
Code:
Errors:
+ Items/Decorative/MonsterStatuette.cs:
    CS1502: Line 136: The best overloaded method match for 'Server.Items.Monster
StatuetteInfo.MonsterStatuetteInfo(int, int, int)' has some invalid arguments
    CS1503: Line 136: Argument 1: cannot convert from 'string' to 'int'
    CS1503: Line 136: Argument 2: cannot convert from 'Server.Items.MonsterStatu
etteType' to 'int'
Scripts: One or more scripts failed to compile or no script files were found.

Code:
DarkFather,
        PlatinumDragon,
        //Custom
        Male //Line 70
    }


Code:
/* Dark Father */       new MonsterStatuetteInfo(1155748, 0x2632, 0x165),
/* Platinum Dragon */   new MonsterStatuetteInfo(1155745, 0x2635, new int[] { 0x2C1, 0x2C3 }),
/* Male */                new MonsterStatuetteInfo( "Male", MonsterStatuetteType.Male, 340),    // Line 136
 
Could someone point me in the correct direction so I can convert the new file types into an editable format so I can add Clilcs?
 
You need to make a custom constructor for MonsterStatuetteInfo:

Code:
        private readonly int m_LabelNumber;
        private readonly int m_ItemID;
        private readonly int[] m_Sounds;
	private string Name;

        public MonsterStatuetteInfo(string name, int itemID, int baseSoundID)
        {
            m_Name = name;
            m_ItemID = itemID;
            m_Sounds = new int[] { baseSoundID, baseSoundID + 1, baseSoundID + 2, baseSoundID + 3, baseSoundID + 4 };
        }

	
	public MonsterStatuetteInfo(int labelNumber, int itemID, int baseSoundID)
        {
            m_LabelNumber = labelNumber;
            m_ItemID = itemID;
            m_Sounds = new int[] { baseSoundID, baseSoundID + 1, baseSoundID + 2, baseSoundID + 3, baseSoundID + 4 };
        }

        public MonsterStatuetteInfo(int labelNumber, int itemID, int[] sounds)
        {
            m_LabelNumber = labelNumber;
            m_ItemID = itemID;
            m_Sounds = sounds;
        }

        public int LabelNumber { get { return m_LabelNumber; } }
        public int ItemID { get { return m_ItemID; } }
        public int[] Sounds { get { return m_Sounds; } }
	pubic string Name { get { return m_Name; } }

You'll need to add this in MonsterStatuette:

Code:
	public override string DefaultName
	{
		get
		{
			string name = MonsterStatuetteInfo.GetInfo(m_Type).Name;

			return String.IsNullOrEmpty(name) ? base.DefaultName : name;
		} 	}
 
Code:
		/* Male */				new MonsterStatuetteInfo( "Male", MonsterStatuetteType.Male, 340),
        };

        private readonly int m_LabelNumber;
        private readonly int m_ItemID;
        private readonly int[] m_Sounds;
		private string Name;

        public MonsterStatuetteInfo(string name, int itemID, int baseSoundID)
        {
            m_Name = name;
            m_ItemID = itemID;
            m_Sounds = new int[] { baseSoundID, baseSoundID + 1, baseSoundID + 2, baseSoundID + 3, baseSoundID + 4 };
        }


		public MonsterStatuetteInfo(int labelNumber, int itemID, int baseSoundID)
        {
            m_LabelNumber = labelNumber;
            m_ItemID = itemID;
            m_Sounds = new int[] { baseSoundID, baseSoundID + 1, baseSoundID + 2, baseSoundID + 3, baseSoundID + 4 };
        }

        public MonsterStatuetteInfo(int labelNumber, int itemID, int[] sounds)
        {
            m_LabelNumber = labelNumber;
            m_ItemID = itemID;
            m_Sounds = sounds;
        }

        public int LabelNumber { get { return m_LabelNumber; } }
        public int ItemID { get { return m_ItemID; } }
        public int[] Sounds { get { return m_Sounds; } }
		public string Name { get { return m_Name; } } // Line 171
		
		public static MonsterStatuetteInfo GetInfo(MonsterStatuetteType type)
        {
            int v = (int)type;

            if (v < 0 || v >= m_Table.Length)
                v = 0;

            return m_Table[v];
        }
		
		public override string DefaultName  //Line 183
		{
			get
			{
				string name = MonsterStatuetteInfo.GetInfo(m_Type).Name;

				return String.IsNullOrEmpty(name) ? base.DefaultName : name;
			}
		}
    }
Code:
Errors:
+ Items/Decorative/MonsterStatuette.cs:
    CS0115: Line 183: 'Server.Items.MonsterStatuetteInfo.DefaultName': no suitab
le method found to override
Scripts: One or more scripts failed to compile or no script files were found.

Errors:
 + Items/Decorative/MonsterStatuette.cs:
    CS0102: Line 171: The type 'Server.Items.MonsterStatuetteInfo' already conta
ins a definition for 'Name'
Scripts: One or more scripts failed to compile or no script files were found.
 
Last edited:
Back