RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Colored item name with Extended Localizer Package

if you used my code, then none is adding props for skills

if you want to add props for skills, then in each one need to do a check like this:

if(this.SkillBonuses.Skill_1_Value > 0) ++props;
same with numbers 2-5
 

Nockar

Sorceror
Lord_Greywolf;841940 said:
if you used my code, then none is adding props for skills

if you want to add props for skills, then in each one need to do a check like this:

if(this.SkillBonuses.Skill_1_Value > 0) ++props;
same with numbers 2-5

That worked like a charm thanks!
 

Nockar

Sorceror
Another question.

Is there a way to give an item a “no resource” type? I have some items that drop that take on baseJewel properties. But they are not made of metal. For example I have books that you can equip. But I don’t want them to say Iron Book, or Dull Iron Book. I know that I can change the resource type to wood on the script it’s self and till get rid of the name. But then they have a chance to at coming one of the rare wood types.

So is there a way to give those scripts a resource type of none, yet still retain the color name? Or by doing it in some other fashion? A check in the props scrip or in that section some where.
 

Nockar

Sorceror
Hey I found a little problem with crafting items. Maybe some one knows what it is?

It happens to most, but Not all, crafted items with armor & shields. Does not seem to matter if the item is exceptional or normal (as far as I can tell) but not totally sure on that.

All regular GM placed items, sold items, and drops all get named properly.

Its just the crafting part.

I tried one of my blank servers builds that do not have all these script changes and all crafting items retain the proper name with no problems. So it has something to do with this new code.

Any idea why?

Code:
		public override void AddNameProperty( ObjectPropertyList list )
		{

//Colored Item Name Mod Start
			BaseArmor arm = this;

			//AddNamePropertiey Code
			string oreType = CraftResources.GetName( m_Resource );

			if ( oreType.ToLower() == "none" || oreType.ToLower() == "normal" )
				oreType = null;

			if ( m_Quality == ArmorQuality.Exceptional )
			{
				if ( oreType != null )
					list.Add( 1053100, "#{0}\t{1}", oreType, GetNameString() ); // exceptional ~1_oretype~ ~2_armortype~
				else
					list.Add( 1050040, GetNameString() ); // exceptional ~1_ITEMNAME~
			}
			else
			{

				int props = 0;
				foreach( int i in Enum.GetValues(typeof( AosAttribute ) ) )
				{
					if ( arm != null && arm.Attributes[ (AosAttribute)i ] > 0 ) ++props;
				}
				if ( arm != null ) foreach( int i in Enum.GetValues(typeof( AosArmorAttribute ) ) ) {if ( arm.ArmorAttributes[ (AosArmorAttribute)i ] > 0 ) ++props;}
				if(this.SkillBonuses.Skill_1_Value > 0) ++props;
				if(this.SkillBonuses.Skill_2_Value > 0) ++props;
				if(this.SkillBonuses.Skill_3_Value > 0) ++props;
				if(this.SkillBonuses.Skill_4_Value > 0) ++props;
				if(this.SkillBonuses.Skill_5_Value > 0) ++props;

				// Props code display
				if( props == 0  ) 		//  No color (Common)
				{
					list.Add(1053099, "{0}\t{1}", oreType, GetNameString());
				}
				if( props >= 1 && props <= 2 ) 	// Green (Uncommon)
				{
					list.Add(1053099, "<BASEFONT COLOR=#1EFF00>{0}\t{1}<BASEFONT COLOR=#FFFFFF>", oreType, GetNameString());
				}
				if( props >= 3 && props <= 4 ) 	// Blue (Rare)
				{
					list.Add(1053099, "<BASEFONT COLOR=#0070FF>{0}\t{1}<BASEFONT COLOR=#FFFFFF>", oreType, GetNameString());
				}
				if( props >= 5 && props <= 6 ) 	// Purple (Epic)
				{
					list.Add(1053099, "<BASEFONT COLOR=#A335EE>{0}\t{1}<BASEFONT COLOR=#FFFFFF>", oreType, GetNameString());
				}
				if( props >= 7 && props <= 8 ) 	// Orange (Legendary)
				{
					list.Add(1053099, "<BASEFONT COLOR=#FF8000>{0}\t{1}<BASEFONT COLOR=#FFFFFF>", oreType, GetNameString());
				}
				if( props >= 9 ) 		// Golden (Artifact)
				{
					list.Add(1053099, "<BASEFONT COLOR=#E6CC80>{0}\t{1}<BASEFONT COLOR=#FFFFFF>", oreType, GetNameString());
				}
			}
//Colored Item Name Mod End
		}
 

Attachments

  • image001.jpg
    image001.jpg
    77.8 KB · Views: 13

Vorspire

Knight
Could it be anything to do with the # character on this line:
Code:
list.Add( 1053100, "[B][COLOR="Red"]#[/COLOR][/B]{0}\t{1}", oreType, GetNameString() ); // exceptional ~1_oretype~ ~2_armortype~

I'm guessing by "token" they mean an alpha-numeric character.
 

Nockar

Sorceror
Vorspire;843424 said:
Could it be anything to do with the # character on this line:
Code:
list.Add( 1053100, "[B][COLOR="Red"]#[/COLOR][/B]{0}\t{1}", oreType, GetNameString() ); // exceptional ~1_oretype~ ~2_armortype~

I'm guessing by "token" they mean an alpha-numeric character.

Does not look like it’s the # thing. I checked a old version of BaseArmor.cs from a old install that never got these code changes and it has that same symbol in it. Bet yours has it as well.

New code
Code:
					list.Add( 1053100, "#{0}\t{1}", oreType, GetNameString() ); // exceptional ~1_oretype~ ~2_armortype~

way old code with out changes
Code:
					list.Add( 1053100, "#{0}\t{1}", oreType, GetNameString() ); // exceptional ~1_oretype~ ~2_armortype~
 

Nockar

Sorceror
Vorspire;843424 said:
Could it be anything to do with the # character on this line:
Code:
list.Add( 1053100, "[B][COLOR="Red"]#[/COLOR][/B]{0}\t{1}", oreType, GetNameString() ); // exceptional ~1_oretype~ ~2_armortype~

I'm guessing by "token" they mean an alpha-numeric character.

I went and removed that symbol to give it a try and that fixed it. HAHA you were right!

Thanks!
 

Nockar

Sorceror
I have another question for you fine people!

I have discovered that any items that drop off of monsters as loot (weapons, armor, etc) can not be smelted or sold to vendors.

I just installed Daat99 so I am not sure if it has to do with the data thing or if it has to do with the code that I am using in this post.

If I had to pick one I would say its probably the code form this post that is doing it. Any ideas how to go about fixing that?


Can I no long smelt items and vendor sell them becase the name is no longer null?
 

Nockar

Sorceror
Anyone have any ideas about this?

Can not spelt magic weapon or armor drops and can not sell them to vendors.

If i manually create a item I am able to do both those. IE give it a name and magic props.
 

Vorspire

Knight
I don't think it does, the Extended Localizer was designed to decompile ObjectPropertyList packets, ObjectPropertyLists did not exist pre-AoS.
 
Top