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!

cant be repair

Phantom

Knight
seltor said:
Can he not just add this inside the tinkering check? Or will it still return because it is a cleaver?

Code:
!( weapon is ColdBlood );


He could do that, I perhaps miss understood what the following code did:
Code:
if ( m_CraftSystem.CraftItems.SearchForSubclass( weapon.GetType() ) == null && !IsSpecialWeapon( weapon ) )
					{
						number = 1044277; // That item cannot be repaired.
					}

What he needs to do is, write code to make the above statement true, doesn't matter what he actually does.
 

egemen

Wanderer
Code:
if ( m_CraftSystem is DefTinkering )
				{
					return 
						 ( weapon is Hatchet )
						|| ( weapon is Pickaxe )
							|| !( weapon is ColdBlood )
						|| ( weapon is ButcherKnife )
						|| ( weapon is SkinningKnife );
				}


I have tried this but it repairs :( :( :(
 

seltor

Sorceror
Well I could be understanding completely wrong. This is my 3 in the morning time LOL. I think he wants to make it so Coldblood can NOT be repaired and he is playing around in the not craftable but IS repairable part of the script. So I just figured if he checked to make sure it WASN'T Coldblood it should eliminate its repairability.... Though I do not know for sure cause it would still be a cleaver
 

seltor

Sorceror
Or maybe something like this in on target method??? I really do not know I am just trying ideas like I would if I were trying to do this on my server. I always spend a few hours trying things myself before I go for help because it is the best way to learn... Anyhow might this work for him?
Code:
if ( m_CraftSystem is DefTinkering && targeted is ColdBlood )
	{
		number = 500426; // You can't repair that.
	}

Or maybe put the Cleaver back in the tinkering check for repairable like this???

Code:
( weapon is Cleaver && weapon is !ColdBlood )
 

egemen

Wanderer
Phantom said:
He could do that, I perhaps miss understood what the following code did:
Code:
if ( m_CraftSystem.CraftItems.SearchForSubclass( weapon.GetType() ) == null && !IsSpecialWeapon( weapon ) )
					{
						number = 1044277; // That item cannot be repaired.
					}

What he needs to do is, write code to make the above statement true, doesn't matter what he actually does.
ok for this i write IsNotSpecialWeapon and add cold blood in it but it doesnt work in addtion you asked that why are you write this?
 

seltor

Sorceror
Maybe what he means egemen is that you might try editting the Coldblood script to define it as a special weapon??? I am not sure mate, like I said just tossing out ideas to try to get you over the hump while learning myself :)

And another thing you might try would be something like this

Code:
if ( m_CraftSystem is DefTinkering && weapon !ColdBlood )

where is is checking for the repairable but not craftable.... That way it will skip the rest of the check and not return a Cleaver???
 

Phantom

Knight
seltor said:
Maybe what he means egemen is that you might try editting the Coldblood script to define it as a special weapon??? I am not sure mate, like I said just tossing out ideas to try to get you over the hump while learning myself :)

And another thing you might try would be something like this

Code:
if ( m_CraftSystem is DefTinkering && weapon !ColdBlood )

where is is checking for the repairable but not craftable.... That way it will skip the rest of the check and not return a Cleaver???

I have explained what he needs to do, and your suggestion is not it, as it would have to be using the Tinkering skill which makes no sense. I am going to guess that the Item is a weapon not a tool.

If the code I have said to modify, those items cannot be repaired, all he has to do is return his weapon so it fails and won't allow the user to repair the item.

ok for this i write IsNotSpecialWeapon and add cold blood in it but it doesnt work in addtion you asked that why are you write this?

You created a method, never called it, thus why I asked you wrote it.
 

egemen

Wanderer
You said that show cold blood is not special weapon i said that i catogorized cold weapon on İsNotSpecial item and it wasnt work too
 

seltor

Sorceror
I wasn't saying it was a tool but I thought the cleaver was one of the default returns for tinkering. And I also suggested that he try defining the weapon as a special weapon in the ColdBlood.cs but I am only a little less lost than he is. I am just trying to help him work through it. but thanks for letting us all know that my suggestion won't work :) Hopefully he sees it before wasting time trying it.
 

Phantom

Knight
egemen said:
You said that show cold blood is not special weapon i said that i catogorized cold weapon on İsNotSpecial item and it wasnt work too

I never said not to make it not a special weapon, infact thats what you want to do, you want to make the statement I said needs to be true to make it non-repairable.

You created a method, called it IsNotSpecial yet you never actually used the method, which is why it didn't work.
 

egemen

Wanderer
ok i understand what do you mean but are you beawere of that i dont know how can i make unreapairable .You only say that write code; i have written codes in here which i can do My capacity is this.
 

seltor

Sorceror
Okay mate... here you.... Scroll down to where it begins the target is BaseWeapon checks and change it to this....
Code:
else if ( targeted is BaseWeapon && !ColdBlood)

Might be the long way to do it if you need to do it for alot of weapons but it works :)
 

egemen

Wanderer
Code:
	private bool IsNotSpecialWeapon( BaseWeapon weapon )
			{

				if ( m_CraftSystem is DefTinkering  )
				{
					return ( weapon is ColdBlood);
				}
				
				return false;
			}


Code:
if ( m_CraftSystem.CraftItems.SearchForSubclass( weapon.GetType() ) == null && !IsSpecialWeapon( weapon ) )
					{
						number = 1044277; // That item cannot be repaired.
					}
					if ( m_CraftSystem.CraftItems.SearchForSubclass( weapon.GetType() ) == null && IsNotSpecialWeapon( weapon ) )
					{
						number = 1044277; // That item cannot be repaired.
					}

it doesnt work too
 

egemen

Wanderer
seltor said:
Okay mate... here you.... Scroll down to where it begins the target is BaseWeapon checks and change it to this....
Code:
else if ( targeted is BaseWeapon && !ColdBlood)

Might be the long way to do it if you need to do it for alot of weapons but it works :)
else if ( targeted is ColdBlood )
{
BaseWeapon weapon = (BaseWeapon)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;

if ( Core.AOS )
{
toWeaken = 1;
}
else if ( skill != SkillName.Tailoring )
{
double skillLevel = from.Skills[skill].Base;

if ( skillLevel >= 90.0 )
toWeaken = 1;
else if ( skillLevel >= 70.0 )
toWeaken = 2;
else
toWeaken = 3;
}

if ( m_CraftSystem.CraftItems.SearchForSubclass( weapon.GetType() ) == null && !IsSpecialWeapon( weapon ) )
{
number = 1044277; // That item cannot be repaired.
}
if ( m_CraftSystem.CraftItems.SearchForSubclass( weapon.GetType() ) == null && IsNotSpecialWeapon( weapon ) )
{
number = 1044277; // That item cannot be repaired.
}
else if ( !weapon.IsChildOf( from.Backpack ) )
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if ( weapon.MaxHits <= 0 || weapon.Hits == weapon.MaxHits )
{
number = 1044281; // That item is in full repair
}
else if ( weapon.MaxHits <= toWeaken )
{
number = 500424; // You destroyed the item.
m_CraftSystem.PlayCraftEffect( from );
weapon.Delete();
}
else if ( from.CheckSkill( skill, -285.0, 100.0 ) )
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect( from );
weapon.MaxHits -= toWeaken;
weapon.Hits = weapon.MaxHits;
}
else
{
number = 1044280; // You fail to repair the item.
m_CraftSystem.PlayCraftEffect( from );
weapon.MaxHits -= toWeaken;

if ( weapon.Hits - toWeaken < 0 )
weapon.Hits = 0;
else
weapon.Hits -= toWeaken;
}

if ( weapon.MaxHits <= toWeaken )
from.SendLocalizedMessage( 1044278 ); // That item has been repaired many times, and will break if repairs

are attempted again.
}
 

egemen

Wanderer
seltor said:
Okay mate... here you.... Scroll down to where it begins the target is BaseWeapon checks and change it to this....
Code:
else if ( targeted is BaseWeapon && !ColdBlood)

Might be the long way to do it if you need to do it for alot of weapons but it works :)
It doesnt work too :(
 

seltor

Sorceror
I just tried it and it worked fine. Returned This item cannot be repaired in my blacksmith window....

[edit]
Nevermind mate. It is cause you are using the tinkers kit.... Give me a few I am still working on it for you :)
 

seltor

Sorceror
OKay so maybe the way to do this if it is critical and we cannot figure out how to get it to return true for the IsSpecialWeapon... Then we can always remove the option to reapir from Tinkering because with the last edit we did it will not allow it to be repaired though blacksmith
 

Phantom

Knight
What kind of item is this ColdBlood, would help alot, I got a feeling my suggestion is not working is because of a user error.

Infact I know it is, but I can't just end this conversation, unless I know what type of Item it is
 
Top