Go Back   RunUO - Ultima Online Emulation > RunUO > New Join Forum

New Join Forum So your new to RunUO and looking to work with people that are new, this is the place.

Reply
 
Thread Tools Display Modes
Old 09-13-2004, 11:41 PM   #1 (permalink)
 
Join Date: Nov 2003
Location: Terre Haute, IN
Age: 23
Posts: 24
Send a message via ICQ to RenderOne Send a message via AIM to RenderOne
Default Adding Strength Requirment to clothing

I've been trying to find a way to add 10 Str Requirement to clothing like OSI does. Does anybody know of a way to do this? I've looked through BaseClothing.cs and I found this area:

Code:
		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );

			if ( m_Crafter != null )
				list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~

			if ( m_Quality == ClothingQuality.Exceptional )
				list.Add( 1060636 ); // exceptional

			base.AddResistanceProperties( list );
		}
And I didnt know if it was possible to add a str req property to the list. This area of code here is where it finds to add resist to the reward cloak and robe.
RenderOne is offline   Reply With Quote
Old 09-14-2004, 12:15 AM   #2 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

I think you could just overload the OnEquip method then do a check in there for from.str == 10 and if not just return and not allow the equip. Post again if you need any help scripting

EDIT:

Sorry, I believe that would be CanEquip, not OnEquip
Sep102 is offline   Reply With Quote
Old 09-14-2004, 12:32 AM   #3 (permalink)
 
Join Date: Nov 2003
Location: Terre Haute, IN
Age: 23
Posts: 24
Send a message via ICQ to RenderOne Send a message via AIM to RenderOne
Default

Sorry to say i'm not really good at writing scripts i'm just able to read them and somewhat understand it. Could you show me how to put that in there or something to test with?
RenderOne is offline   Reply With Quote
Old 09-14-2004, 12:40 AM   #4 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

Try this, right after the Deserialize method in the cs file put this method
Code:
public override bool CanEquip( Mobile m )
{
	if( m.Str < 10 )
		return false;
			
	return true;
}
It'll not allow anyone with a str under 10 to equip it

Only problem might be is that it gives no visible indication that it doesn't let you equip it based on strength. If you want it to tell them they don't have the strength to equip it, make it this
Code:
public override bool CanEquip( Mobile m )
{
	if( m.Str < 10 )
	{
		if( m is PlayerMobile )
			m.SendMessage( "You do not have the strength to equip this" );
		       	return false;
	}	
			
	return true;
}
Sep102 is offline   Reply With Quote
Old 09-14-2004, 01:12 AM   #5 (permalink)
 
Join Date: Nov 2003
Location: Terre Haute, IN
Age: 23
Posts: 24
Send a message via ICQ to RenderOne Send a message via AIM to RenderOne
Default

Okay well I put this code in right after the Deserialization part:

Code:
public override bool CanEquip( Mobile m )
{
	if( m.Str < 10 )
		return false;
			
	return true;
}
And it works so that you need atleast 10 str requirement to wear them now how can I set it so that it show's Strength Requiremtn 10 on the clothing's props?
RenderOne is offline   Reply With Quote
Old 09-14-2004, 11:34 AM   #6 (permalink)
 
Join Date: Feb 2004
Location: Canada
Age: 34
Posts: 123
Default

The answer to your question lies in part in your first post in this thread.
__________________
Bizbol
bizbol is offline   Reply With Quote
Old 09-14-2004, 03:32 PM   #7 (permalink)
 
Join Date: Nov 2003
Location: Terre Haute, IN
Age: 23
Posts: 24
Send a message via ICQ to RenderOne Send a message via AIM to RenderOne
Default

Well I know that much I just dont know what the actual code is to put in there
RenderOne is offline   Reply With Quote
Old 09-14-2004, 09:05 PM   #8 (permalink)
 
Join Date: Sep 2004
Age: 25
Posts: 4
Default

I think your best bet would be to take a look at the script for items that already have a strength requirement, for example, plate armor all has a strength requirement

learn from that and it should give you a direction you need
Urizen is offline   Reply With Quote
Old 09-14-2004, 09:23 PM   #9 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

You mean basearmor.cs, right? All the ones derived off of it (like plate armor) just overrides the virtual function, he needs to look in basearmor.cs to see how its done.
Sep102 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5