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!

Adding armor qualities to footwear.

eidolon

Sorceror
Adding armor qualities to footwear.

Basically, I'm interested in adding the ability for footwear to have armor-like qualities (i.e. resistances). I played around with it tonight a bit, adding in a new piece of leather armor, and giving shoes an entry in the bit of BaseArmor.cs that decides layers. Naturally, it didn't work, and I suspect I'm way off, since it's not mentioned in there which graphic the item uses or anything, missing a lot of the stuff that to me should be going into the creation of a new item. So, on looking further, it seems to me the items found in the /scripts/items/* are the base items which others are based off of, correct? Are aspects of these hardcoded, or can it all be done through scripts? How might I approach making a new armor type which functions as footwear?

Any help is greatly appreciated, and I'll post whatever I manage to cobble together if it ends up working (or maybe even if it doesn't :p )
 

Dracarys

Wanderer
Create i.e. some plate legs ingame, set their ItemID to the ItemID of sandals, set their layer correctly ([props) and voila, platemail sandals. :)

In a script you would just make new shoes derived from BaseArmor i believe.
 

Dracarys

Wanderer
Or just create new shoes based on BaseShoes or whatever the base class is and use this:

Code:
public override int ColdResistance{ get{ return 10; } } 
public override int FireResistance{ get{ return 5; } }
 

eidolon

Sorceror
So it would involve basearmor... Okay. I think I'll lay it out in some more detail, for the benefit of anyone who's trying to figure out what the hell I'm trying to do : )

What I want to do is create a new piece of armor, lets call it Banded Leather Boots. It will have resistances, and capable of being twiddled to have all the other armor properties. I want it to use the basic leather boots graphic, maybe with a different hue or something. It should be player craftable, and able to use the different leathers in it's creation.

What I've done so far is, copy/pasted a gorget, and changed the class to sub-class to BandedLeatherBoots. I've also created a new Body Layer in BaseArmor.cs for armor of the Boots type. I've now got an object I can place by the name banded leather boots, but shows up as a leather gorget. Obviously, I'm missing something big, so if anyone could enlighten me as to what my next step might be, I would be most greatful.
 

eidolon

Sorceror
Dracarys said:
Or just create new shoes based on BaseShoes or whatever the base class is and use this:

Code:
public override int ColdResistance{ get{ return 10; } } 
public override int FireResistance{ get{ return 5; } }

I was thinking that over, but isn't it impossible to add those properties to an object based off of BaseShoes?
 

eidolon

Sorceror
Okay, got it to work, heres the code for ReinforcedLeatherBoots.cs:

Code:
using System;
using Server.Items;

namespace Server.Items
{
	public class ReinforcedLeatherBoots : BaseArmor
	{
		public override int BasePhysicalResistance{ get{ return 2; } }
		public override int BaseFireResistance{ get{ return 4; } }
		public override int BaseColdResistance{ get{ return 3; } }
		public override int BasePoisonResistance{ get{ return 3; } }
		public override int BaseEnergyResistance{ get{ return 3; } }

		public override int InitMinHits{ get{ return 30; } }
		public override int InitMaxHits{ get{ return 40; } }

		public override int AosStrReq{ get{ return 20; } }
		public override int OldStrReq{ get{ return 10; } }

		public override int ArmorBase{ get{ return 13; } }

		public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Leather; } }
		public override CraftResource DefaultResource{ get{ return CraftResource.RegularLeather; } }

		public override ArmorMeditationAllowance DefMedAllowance{ get{ return ArmorMeditationAllowance.All; } }

		[Constructable]
		public ReinforcedLeatherBoots() : base( 0x170b )
		{
			Weight = 3.0;
			Name = "Reinforced Leather Boots";
		}

		public ReinforcedLeatherBoots( Serial serial ) : base( serial )
		{
		}
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}
		
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
}

You'll also need to stick this little snippit into BaseArmor.cs under the rest of the case layer things for the armored boots to work in the right item slot.

Code:
case Layer.Shoes:		return ArmorBodyType.Boots;
 

eidolon

Sorceror
Now... To make it craftable. I see theres some sort of unique number to each of the craftable items, this would be the item ID I suppose. So, now I wonder how I might set a new ID number up for the Reinforced Boots? And, I'm still wondering where the graphic a given item will display is set, I'm not seeing it in any of the scripts I'm playing with, so I have the horrible feeling that it's hardcoded.
 

Dracarys

Wanderer
eidolon said:
And, I'm still wondering where the graphic a given item will display is set, I'm not seeing it in any of the scripts I'm playing with, so I have the horrible feeling that it's hardcoded.

You mean the graphic on the paperdoll? Yes this is hardcoded into the client (!) files. You can add new items to the client verdata and also create a new paerdoll/animation for them.
 

eidolon

Sorceror
Hmm..... Well, thats a bit beyond what I want to be doing. Also, it looks like you might have misinterpreted me, I want to choose which of the preset graphics to use for a given object, if not, disregard that. Anyway, if it's hardcoded as to what uses a given graphic, how do I get an item using the boots as it's base as above to have a different item ID, or if I've inadvertantly given it one already, how do I find it?
 

Dracarys

Wanderer
eidolon said:
Hmm..... Well, thats a bit beyond what I want to be doing. Also, it looks like you might have misinterpreted me, I want to choose which of the preset graphics to use for a given object, if not, disregard that. Anyway, if it's hardcoded as to what uses a given graphic, how do I get an item using the boots as it's base as above to have a different item ID, or if I've inadvertantly given it one already, how do I find it?


Errrrrr.... What??

You got me a BIT confused.

To choose what is being displayed to the client, you edit this:

Code:
public ReinforcedLeatherBoots() : base( [B]0x170b[/B] )

The 0x170b is the itemID which can be found with InsideUO. It determines a) the item graphic inside a backpack or on the ground b) the graphic on the gump and c) the animation shown on your character.
 

eidolon

Sorceror
Okay, so that base thingy does the graphic. Theres one question down. I guess I didn't explain myself very clearly :p What I need is the ID, or serial, or whatever that is used with regards to the tailoring craft menu and such, the one which is used to determine which item to craft, or what any given item is, etc...
 

Dracarys

Wanderer
Code:
AddCraft( typeof( YourItemName), "Sub Menu", "Displayed Text", MinSkill, MaxSkill, typeof( YourCraftResource ), "YourCraftResourceString", AmountOfResourceTaken, ClilocNumberForNotEnoughResource);

this is put into DefBlacksmithing or DefTailoring or wherever you want your new item. :) Look at the other entries there to figure out what you will use.
 

nix4

Wanderer
Instead of editing basearmor.cs have you tried this?

[Constructable]
public ReinforcedLeatherBoots() : base( 0x170b )
{
Weight = 3.0;
Name = "Reinforced Leather Boots";
Layer = Layer.Shoes;
}

No, idea if that will work but I have seen this on the two handed axe code that comes with RunUO.
 

eidolon

Sorceror
Dracarys said:
Code:
AddCraft( typeof( YourItemName), "Sub Menu", "Displayed Text", MinSkill, MaxSkill, typeof( YourCraftResource ), "YourCraftResourceString", AmountOfResourceTaken, ClilocNumberForNotEnoughResource);

this is put into DefBlacksmithing or DefTailoring or wherever you want your new item. :) Look at the other entries there to figure out what you will use.

Here's what I've got in there. Now, theres a number in place of the displayed text part. I assume this points to a string of some sort, any idea where those are stored? Or should I just punch in some text there?

Code:
AddCraft( typeof( ReinforcedLeatherBoots ), 1015293, 1025068, 51.8, 76.8, typeof( Leather ), 1044462, 6, 1044463 );
 

eidolon

Sorceror
I tried putting text in where that little explanation of the syntax for these lines said it should be able to go. All I got from that was an error saying that it had to be an integer. So, where do I define the text that these integers in the craft menu code point to?
 
Top