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!

[RunUO 2.0 RC1] ItemID is usefull again

theaxiom

Wanderer
Grashopr;704957 said:
I've been waiting patiently for some sort of assistance on the problem, no word yet. I built a 100% clean RC1 shard and followed the install instructions and got the failure. Pity, I really liked the idea of the script.

I fixed the issue; With 2.0 RC1 there is no ML support, and in his reference scripts I noticed he has some ML stuff in the baseJewel that is not part of the RC1 distro, so what I did is bypassed that by doing the following:

BaseJewel.cs

Where it says to do this:

Code:
Now go to Deser. and add the lines:

					#region ItemID_Mods
				                case (#+1):
				                    {
				                        m_Identified = reader.ReadBool();
				                        goto case 3;
				                    }
					#endregion

Change the "goto case 3" to "goto case 2", as you don't have a case 3 on 2.0 RC1 until you add this case, and if you leave it as 3 it will cause an infinite loop and cause the de-serialization errors.

I hope that helps you, it works perfectly for me. :)
 

Grashopr

Wanderer
Thankfully theaxiom solved the crash problem, but I"m still getting the

Errors:
+ Engines/Craft/Core/CraftItem.cs:
CS0103: Line 120: The name 'from' does not exist in the current context
CS0103: Line 121: The name 'from' does not exist in the current context


errors...
 

Grashopr

Wanderer
GOT IT!

In the Installation Doc, at the end in the Optional part, it says to look for

Code:
	if ( item != null )
	{[CODE]

code.  Using Visual C# 2005, it found that code in the ItemIDOf class, but the Installation Doc should tell you to find that code in the CompleteCraft class.



Also, none of my weapons were showing 'unidentified' on any vendors or corpses, they were just showing the name of the item, so I removed all of this from the bottom of the baseweapon.cs 

Also, my pickaxes weren't showing the number of uses remaining, so I moved the following code outside the region (moved it above the region beginning)

[CODE]            if (this is IUsesRemaining && ((IUsesRemaining)this).ShowUsesRemaining)
                list.Add(1060584, ((IUsesRemaining)this).UsesRemaining.ToString()); // uses remaining: ~1_val~


Changed This:
Code:
	   					    }
					            else if ((ArtifactRarity) > 0 || (m_AosAttributes.WeaponDamage) != 0 || (m_AosAttributes.DefendChance) != 0 ||
					                    (m_AosAttributes.BonusDex) != 0 || (m_AosAttributes.EnhancePotions) != 0 || (m_AosAttributes.CastRecovery) != 0 ||
					                    (m_AosAttributes.CastSpeed) != 0 || (m_AosAttributes.AttackChance) != 0 || (m_AosAttributes.BonusHits) != 0 ||
					                    (m_AosAttributes.BonusInt) != 0 || (m_AosAttributes.LowerManaCost) != 0 || (m_AosAttributes.LowerRegCost) != 0 ||
					                    (m_AosAttributes.BonusMana) != 0 || (m_AosAttributes.RegenMana) != 0 || (m_AosAttributes.NightSight) != 0 ||
					                    (m_AosAttributes.ReflectPhysical) != 0 || (m_AosAttributes.RegenStam) != 0 || (m_AosAttributes.RegenHits) != 0 ||
					                    (m_AosAttributes.SpellChanneling) != 0 || (m_AosAttributes.SpellDamage) != 0 ||
					                    (m_AosAttributes.BonusStam) != 0 || (m_AosAttributes.BonusStr) != 0 || (m_AosAttributes.WeaponSpeed) != 0 ||
					                    (ComputeStatReq(StatType.Str)) > 0 || (m_HitPoints >= 0 && m_MaxHitPoints > 0))
					                list.Add(1038000); // Unidentified
						#endregion


To This:

Code:
       }
 else list.Add(1038000); // Unidentified
                                    #endregion
 

Grashopr

Wanderer
Another problem fixed:

For some reason I wasn't able to ID Clothing or Jewel items, only Armor and Weapons. Another addition to the 'Instructions' needs to be the following alteration to skills/ItemIdentification.cs: (Add red text)

Code:
		private class InternalTarget : Target
		{
			public InternalTarget() :  base ( 8, false, TargetFlags.None )
			{
				AllowNonlocal = true;
			}

			protected override void OnTarget( Mobile from, object o )
			{
				if ( o is Item )
				{
					if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
					{
						if ( o is BaseWeapon )
							((BaseWeapon)o).Identified = true;
						else if ( o is BaseArmor )
							((BaseArmor)o).Identified = true;
[COLOR="Red"]                                                         else if (o is BaseClothing)
                                                                                          ((BaseClothing)o).Identified = true;
                                                           else if (o is BaseJewel)
                                                                   ((BaseJewel)o).Identified = true;[/COLOR]

						if ( !Core.AOS )
							((Item)o).OnSingleClick( from );
					}
					else
					{
						from.SendLocalizedMessage( 500353 ); // You are not certain...
					}
				}
                else if (o is Mobile)
                {
                    ((Mobile)o).OnSingleClick(from);
                }
                else
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                }
                //allows the identify skill to reveal attachments
                Server.Engines.XmlSpawner2.XmlAttach.RevealAttachments(from, o);
			}
		}
 

theaxiom

Wanderer
Okay, next order of business. I would like to make it so that all standard clothing/weapons/armor are identified by default. Would anyone know how to go about doing that? It does not make sense to make newbie stuff unidentified, and stuff you buy from the vendors...thanks. :)
 

Grashopr

Wanderer
Yeah, just look at the bottom of the Installation ReadMe. You need to make a change around line 1109ish of Craft/Core/CraftItem.cs:

Should look like this when you're done:

Code:
				if ( item != null )
				{

                    double chance = ((from.Skills[SkillName.ItemID].Value - 10) * 0.01);
                    chance += (from.Skills[SkillName.ArmsLore].Value * 0.001);
                    if (chance >= Utility.RandomDouble())
                    {
[COLOR="Red"]                        if (item is BaseWeapon)
                            ((BaseWeapon)item).Identified = true;
                        if (item is BaseArmor)
                            ((BaseArmor)item).Identified = true;[/COLOR]
                    }

					if( item is ICraftable )
						endquality = ((ICraftable)item).OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, this, resHue );
					else if ( item.Hue == 0 )
						item.Hue = resHue;

					if ( maxAmount > 0 )
					{
						if ( !item.Stackable && item is IUsesRemaining )
							((IUsesRemaining)item).UsesRemaining *= maxAmount;
						else
							item.Amount = maxAmount;
					}

					from.AddToBackpack( item );

					//from.PlaySound( 0x57 );
				}
 

Grashopr

Wanderer
You would need to build a limiting table (or alter the current one that is included in the script) to allow items with properties below whatever you think is low enough to show identified...

Code:
	   					    }
					            else if ((ArtifactRarity) > 0 || (m_AosAttributes.WeaponDamage) != 0 || (m_AosAttributes.DefendChance) != 0 ||
					                    (m_AosAttributes.BonusDex) != 0 || (m_AosAttributes.EnhancePotions) != 0 || (m_AosAttributes.CastRecovery) != 0 ||
					                    (m_AosAttributes.CastSpeed) != 0 || (m_AosAttributes.AttackChance) != 0 || (m_AosAttributes.BonusHits) != 0 ||
					                    (m_AosAttributes.BonusInt) != 0 || (m_AosAttributes.LowerManaCost) != 0 || (m_AosAttributes.LowerRegCost) != 0 ||
					                    (m_AosAttributes.BonusMana) != 0 || (m_AosAttributes.RegenMana) != 0 || (m_AosAttributes.NightSight) != 0 ||
					                    (m_AosAttributes.ReflectPhysical) != 0 || (m_AosAttributes.RegenStam) != 0 || (m_AosAttributes.RegenHits) != 0 ||
					                    (m_AosAttributes.SpellChanneling) != 0 || (m_AosAttributes.SpellDamage) != 0 ||
					                    (m_AosAttributes.BonusStam) != 0 || (m_AosAttributes.BonusStr) != 0 || (m_AosAttributes.WeaponSpeed) != 0 ||
					                    (ComputeStatReq(StatType.Str)) > 0 || (m_HitPoints >= 0 && m_MaxHitPoints > 0))
					                list.Add(1038000); // Unidentified
						#endregion
 

Mexifoo

Wanderer
I found out that win a new Chr starts there starting amor and robe cant be equipt and there naked is there a fixs to pervent that from happening?
 

Grashopr

Wanderer
Yes, alter the attributes of the equipment given to new characters, give out 'newbie' clothes that have lower requirements or raise the initial stats of the new characters.
 
Suggestion:
Make an interface and inherit from it
This way you just need to check if an item belongs to the interface and you can get rid of the many casts :)
 

Mexifoo

Wanderer
Grashopr;709291 said:
Yes, alter the attributes of the equipment given to new characters, give out 'newbie' clothes that have lower requirements or raise the initial stats of the new characters.


how do you lower the requirement for newbie clothes and i also dont understand the raiseing the initial stats are you talking about like STR and DEx int?

And another Thing no Newbie amor and cloths get handing out most of the CHrs just get there backpack items but not leater amor and robe and shirt
 

XenoNeo

Sorceror
jingz2k2;700472 said:
How to make it so that artifacts won't have to be identified?

Or if this is not possible, could we hide the artifacts' name and hue before identifying it?

And lastly, would it be better to make it that all unidentified items cannot be equipped or can be equipped but mods won't take effect(better).

^_^

For that I would think you'd have to go through all artys and add a if in it's constructable?
 

Overflow

Wanderer
mmm, how i can obtain the items added by .add command already identified, and the items obtained by loot unidentified?
 

mithos

Wanderer
Sorry I didn't read through all the pages but, are crafted items id'd already, and if not, is there a quick fix to change that?

Trying to give a bit of incentive to my crafters for putting in this system.
 

corbingene01

Wanderer
ok this script rox, but i have a few questions? how do you get these to be automatically identified?


1) artifacts/ minor artifacts

2) quest reward items

3) newbie items

4) tools that have weapon id's

5) newbie items of anykind

also would like to have [add items be auto i'd'd

to make the "unidentified" blue i just changed the (below) if you don't like the blue hue i use this site has a nice chart. Web Color Chart - Hexadecimal - by VisiBone
Code:
list.Add(1038000); // Unidentified
to
Code:
					list.Add(1060847, "<CENTER><BASEFONT COLOR=#0000FF>unidentifiedt</BASEFONT></CENTER>" );
 
Top