How does Parry + Bushido really work?

Name says it all
NewPlayer241
Expert Scribe
Posts: 38
Joined: Tue Dec 01, 2009 11:02 pm

How does Parry + Bushido really work?

Post by NewPlayer241 »

Well, I talked to two GMs on the subject today and they were just as unsure as I was. My question is if anyone knows how does having parry + bushido and using a 1 handed weapon + shield really work on this server.

I have heard it both ways from players, that sword + shield will allow you to perform the 1 handed weapon block, while other players insist that equipping a shield removes your ability to perform the 1 handed weapon blocks.

Based on my own testing, surrounding myself with 9 earth elementals and using confidence to count the number parried, the block rate for a 1 handed weapon + shield isn’t as high as a 2 handed weapon, but still seemed uite a bit higher then the 7% listed on stratics for if the 1 handed weapon block wasn’t applied with the shield equipped.

Current skills are 120 Bushido and 130 Parry. The reason I ask if I have a gem of completion now and have been considering the lv 70 shield since I already have the boots, sleeves and tunic. So if someone knows for sure on the above question I would be very greatful since it would help me determine if I want to get the shield, or just sell the gem.
Llexa
Legendary Scribe
Posts: 294
Joined: Mon May 08, 2006 3:42 pm

Re: How does Parry + Bushido really work?

Post by Llexa »

Short answer: Yes it works. (I use it)


love,
Llexa
"We push and we push away,
For fear of facing our mistakes.
So we call it judgment,
And watch our friends, our world, ourselves... go comatose, inside."
User avatar
BlaZe
Legendary Scribe
Posts: 402
Joined: Thu Dec 25, 2008 12:54 am
Location: Ann Arbor, MI; USA

Re: How does Parry + Bushido really work?

Post by BlaZe »

I paged about this question one night and +Colibri came to assist me. He said, after looking through the code, that once a shield is equipped it completely ignores your weapon-block chance. So to sport a one-handed weapon with Bushido, you'd have to give up the shield for better survivability.
EasyUO Devotee
Download
My Popular ScripZ
Pet FightR | Doorman | TrainR: Lockpicking | HealR
NewPlayer241
Expert Scribe
Posts: 38
Joined: Tue Dec 01, 2009 11:02 pm

Re: How does Parry + Bushido really work?

Post by NewPlayer241 »

Awesome Blaze, thanks for answering. That was exactly what I was looking for, now I just need to figure out if I want to drop bushdio so I can equip that artifact shield or not.
User avatar
Calan Caitin
Elder Scribe
Posts: 162
Joined: Tue Feb 03, 2009 2:02 am

Re: How does Parry + Bushido really work?

Post by Calan Caitin »

Rayne told me that at 120 Bushido and 130 Parry, it works as it was suppose to. It was at less on either skill or both that made it not work.
NewPlayer241
Expert Scribe
Posts: 38
Joined: Tue Dec 01, 2009 11:02 pm

Re: How does Parry + Bushido really work?

Post by NewPlayer241 »

Okay, so two conflicting answers from two reputable community members with two different GMs as a reference, the mystery deepens. :)
User avatar
BlaZe
Legendary Scribe
Posts: 402
Joined: Thu Dec 25, 2008 12:54 am
Location: Ann Arbor, MI; USA

Re: How does Parry + Bushido really work?

Post by BlaZe »

I know very little C#, but I dug around and found the blocking code (buried in BaseWeapon.cs). Note that this is from RunUO 2.0, which I don't think our shard is on, so it could be a little different. Maybe someone with the right knowledge could enlighten us. :D

Code: Select all

		public static bool CheckParry( Mobile defender )
		{
			if ( defender == null )
				return false;

			BaseShield shield = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield;

			double parry = defender.Skills[SkillName.Parry].Value;
			double bushidoNonRacial = defender.Skills[SkillName.Bushido].NonRacialValue;
			double bushido = defender.Skills[SkillName.Bushido].Value;

			if ( shield != null )
			{
				double chance = (parry - bushidoNonRacial) / 400.0;	// As per OSI, no negitive effect from the Racial stuffs, ie, 120 parry and '0' bushido with humans

				if ( chance < 0 ) // chance shouldn't go below 0
					chance = 0;				

				// Parry/Bushido over 100 grants a 5% bonus.
				if ( parry >= 100.0 || bushido >= 100.0)
					chance += 0.05;

				// Evasion grants a variable bonus post ML. 50% prior.
				if ( Evasion.IsEvading( defender ) )
                    chance *= Evasion.GetParryScalar( defender );

				// Low dexterity lowers the chance.
				if ( defender.Dex < 80 )
					chance = chance * (20 + defender.Dex) / 100;

				return defender.CheckSkill( SkillName.Parry, chance );
			}
			else if ( !(defender.Weapon is Fists) && !(defender.Weapon is BaseRanged) )
			{
				BaseWeapon weapon = defender.Weapon as BaseWeapon;

				double divisor = (weapon.Layer == Layer.OneHanded) ? 48000.0 : 41140.0;

				double chance = (parry * bushido) / divisor;

				double aosChance = parry / 800.0;

				// Parry or Bushido over 100 grant a 5% bonus.
				if( parry >= 100.0 )
				{
					chance += 0.05;
					aosChance += 0.05;
				}
				else if( bushido >= 100.0 )
				{
					chance += 0.05;
				}

                // Evasion grants a variable bonus post ML. 50% prior.
                if( Evasion.IsEvading( defender ) )
                    chance *= Evasion.GetParryScalar( defender );

				// Low dexterity lowers the chance.
				if( defender.Dex < 80 )
					chance = chance * (20 + defender.Dex) / 100;

				if ( chance > aosChance )
					return defender.CheckSkill( SkillName.Parry, chance );
				else
					return (aosChance > Utility.RandomDouble()); // Only skillcheck if wielding a shield & there's no effect from Bushido
			}

			return false;
		}
EDIT -
Breaking it down a bit.. this is what executes when a shield is equipped:

Code: Select all

if ( shield != null )
			{
				double chance = (parry - bushidoNonRacial) / 400.0;	// As per OSI, no negitive effect from the Racial stuffs, ie, 120 parry and '0' bushido with humans

				if ( chance < 0 ) // chance shouldn't go below 0
					chance = 0;				

				// Parry/Bushido over 100 grants a 5% bonus.
				if ( parry >= 100.0 || bushido >= 100.0)
					chance += 0.05;

				// Evasion grants a variable bonus post ML. 50% prior.
				if ( Evasion.IsEvading( defender ) )
                    chance *= Evasion.GetParryScalar( defender );

				// Low dexterity lowers the chance.
				if ( defender.Dex < 80 )
					chance = chance * (20 + defender.Dex) / 100;

				return defender.CheckSkill( SkillName.Parry, chance );
			}
And here is what is executed when the character isn't using fists or a ranged weapon (after the shield check):

Code: Select all

else if ( !(defender.Weapon is Fists) && !(defender.Weapon is BaseRanged) )
			{
				BaseWeapon weapon = defender.Weapon as BaseWeapon;

				double divisor = (weapon.Layer == Layer.OneHanded) ? 48000.0 : 41140.0;

				double chance = (parry * bushido) / divisor;

				double aosChance = parry / 800.0;

				// Parry or Bushido over 100 grant a 5% bonus.
				if( parry >= 100.0 )
				{
					chance += 0.05;
					aosChance += 0.05;
				}
				else if( bushido >= 100.0 )
				{
					chance += 0.05;
				}

                // Evasion grants a variable bonus post ML. 50% prior.
                if( Evasion.IsEvading( defender ) )
                    chance *= Evasion.GetParryScalar( defender );

				// Low dexterity lowers the chance.
				if( defender.Dex < 80 )
					chance = chance * (20 + defender.Dex) / 100;

				if ( chance > aosChance )
					return defender.CheckSkill( SkillName.Parry, chance );
				else
					return (aosChance > Utility.RandomDouble()); // Only skillcheck if wielding a shield & there's no effect from Bushido
			}
So if you have a shield, the first part of the code runs. If not, the second part does. This line in the 'shield' section is what confirms that having a shield equipped will hurt your block rate when you have high Bushido:

Code: Select all

double chance = (parry - bushidoNonRacial) / 400.0
I'm curious as to where ranged weapons fit in to this equation though, I know I've blocked with a bow plenty of times.
Last edited by BlaZe on Fri Feb 12, 2010 9:30 pm, edited 1 time in total.
EasyUO Devotee
Download
My Popular ScripZ
Pet FightR | Doorman | TrainR: Lockpicking | HealR
KnitePrince
Legendary Scribe
Posts: 233
Joined: Wed Jan 14, 2009 2:20 pm

Re: How does Parry + Bushido really work?

Post by KnitePrince »

Code: Select all

public static bool CheckParry( Mobile defender )
		{
			if ( defender == null )
				return false;

			BaseShield shield = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield;

			double parry = defender.Skills[SkillName.Parry].Value;
			double parryNonRacial = defender.Skills[SkillName.Parry].NonRacialValue;
			double bushido = defender.Skills[SkillName.Bushido].Value;

			if ( shield != null )
			{
				double chance = (parryNonRacial - bushido) / 400.0;	//As per OSI, no negitive effect from the Racial stuffs, ie, 120 bushido and '0' parry with humans

				// Parry over 100 grants a 5% bonus.
				if ( parry >= 100.0 )
					chance += 0.05;

				// Evasion grants a 50% bonus.
				if ( Evasion.IsEvading( defender ) )
					chance *= 1.5;

				// Low dexterity lowers the chance.
				if ( defender.Dex < 80 )
					chance = chance * (20 + defender.Dex) / 100;

				return defender.CheckSkill( SkillName.Parry, chance );
			}
			else if ( !(defender.Weapon is Fists) && !(defender.Weapon is BaseRanged) )
			{
				BaseWeapon weapon = defender.Weapon as BaseWeapon;

				double divisor = (weapon.Layer == Layer.OneHanded) ? 48000.0 : 41140.0;

				double chance = (parry * bushido) / divisor;

				double aosChance = parry / 800.0;

				// Parry or Bushido over 100 grant a 5% bonus.
				if( parry >= 100.0 )
				{
					chance += 0.05;
					aosChance += 0.05;
				}
				else if( bushido >= 100.0 )
				{
					chance += 0.05;
				}

				// Evasion grants a 50% bonus.
				if( Evasion.IsEvading( defender ) )
					chance *= 1.5;

				// Low dexterity lowers the chance.
				if( defender.Dex < 80 )
					chance = chance * (20 + defender.Dex) / 100;

				if ( chance > aosChance )
					return defender.CheckSkill( SkillName.Parry, chance );
				else
					return (aosChance > Utility.RandomDouble()); // Only skillcheck if wielding a shield & there's no effect from Bushido
			}

			return false;
		}


thats 1.0 RC2 not sure if Coli runs 1.0 / 1.0 RC1 or 1.0 RC2 each version was "slightly" Different, but should be closer than the 2.0.
Knite

Edit; with just a quick look i see a few minor differences, but should still work the same.. if someone has win merge might compare them and see for sure.
KnitePrince
Legendary Scribe
Posts: 233
Joined: Wed Jan 14, 2009 2:20 pm

Re: How does Parry + Bushido really work?

Post by KnitePrince »

else if ( !(defender.Weapon is Fists) && !(defender.Weapon is BaseRanged) )
{
BaseWeapon weapon = defender.Weapon as BaseWeapon;

double divisor = (weapon.Layer == Layer.OneHanded) ? 48000.0 : 41140.0;

double chance = (parry * bushido) / divisor;

Hmm, as swell as I am with C# i can only guess that if its fists or baseranged, meaning bows crossbows etc it is still doubling the chance to parry depending on the divisor / minus anything like low dex etc...
Anyone better than i am with C# Feel free to cut in on this dance anytime.
amadman
Elder Scribe
Posts: 122
Joined: Sun Dec 14, 2008 10:27 am

Re: How does Parry + Bushido really work?

Post by amadman »

I think the '!' may mean 'not'

if so then the code in that else if would be for not shield, not ranged and not fist.
KnitePrince
Legendary Scribe
Posts: 233
Joined: Wed Jan 14, 2009 2:20 pm

Re: How does Parry + Bushido really work?

Post by KnitePrince »

yep, think your right. || = or < less than > greater than <= less than or equal to >= greater than or equal to == equal true or does equal and ! not!!!

so if defender is not using fists or base ranged then double divisor chance to block.
NewPlayer241
Expert Scribe
Posts: 38
Joined: Tue Dec 01, 2009 11:02 pm

Re: How does Parry + Bushido really work?

Post by NewPlayer241 »

Thanks for posting code, it does clear up a lot especially since I have a pretty extensive background in C#. Also for the above posts "double" is a variable type (one which allows decimal values, stands for double percision) rather then a part of the equation.

It still strikes me as strange since if that code from either snippet is the one running on the server, then all those veterans who relayer their bows to one-handed weapons to equip a shield are really hurting themselves if they have bushido since the "if ( shield != null )
" is checked before the "else if ( !(defender.Weapon is Fists) && !(defender.Weapon is BaseRanged) )" and if that first one is true then it doesn't get to the second which would give the better parry rate.

To answer Blaze's question more in depth about the section on bows I'll break it down line by line:

"double divisor = (weapon.Layer == Layer.OneHanded) ? 48000.0 : 41140.0;"
This line sees if the weapon is 1 handed or 2 handed. If it's 1 handed then divisor value is 48000, if 2 handed 41140

"double chance = (parry * bushido) / divisor;"
This says your chance to parry is equal to the values of your parry skill multiplied by your bushido skill, then divided by the value we gave divisor above.

"double aosChance = parry / 800.0;"
This is pretty simply we define aosChance to be equal to parry divide by 800

"// Parry or Bushido over 100 grant a 5% bonus.
if( parry >= 100.0 )
{
chance += 0.05;
aosChance += 0.05;
}
else if( bushido >= 100.0 )
{
chance += 0.05;
}
"
This part of the code boosts the aosChance and chance if your parry or bushido skills are above 100.

"// Evasion grants a 50% bonus.
if( Evasion.IsEvading( defender ) )
chance *= 1.5;
"
Checks if evasion is on, if it is increase the chance variable further.

"// Low dexterity lowers the chance.
if( defender.Dex < 80 )
chance = chance * (20 + defender.Dex) / 100;
"
Checks if you have low dex above 80, if you do then your chance to block is reduced.

"if ( chance > aosChance )
return defender.CheckSkill( SkillName.Parry, chance );
else
return (aosChance > Utility.RandomDouble()); // Only skillcheck if wielding a shield & there's no effect from Bushido
"
This checks which is higher your chance or aosChance and returns the value. The reason it checks this is for if someone has a higher bushido or parry values it will affect how they block differently.

Hope that clears up the code a bit.

Edit: Added in examples:

1-handed bow without shield example:
parry 130
bushido 120

Divisor = 48000

Chance = (130 * 120)/48000 = .325

aosChance = 130 / 800 = .1625

chance = (.325[old chance value] + .05) = .330
aosChance = (.1625[old aosChance value] + .05) = .2125

Since our chance is higher then aosChance, our chance to block returned for combat would be .33 or 33%.

2-handed bow without shield example:
parry 130
bushido 120


Divisor = 41140

Chance = (130 * 120)/41140 = .379

aosChance = 130 / 800 = .1625

chance = (.325[old chance value] + .05) = .429
aosChance = (.1625[old aosChance value] + .05) = .2125

Since our chance is higher then aosChance, our chance to block returned for combat would be .429 or 42.9%.


2-handed bow without shield or bushido:
parry 130
bushido 0

Divisor = 41140

Chance = (130)/41140 = .003

aosChance = 130 / 800 = .1625

chance = (.325[old chance value] + .05) = .053
aosChance = (.1625[old aosChance value] + .05) = .2125

Since our aosChance is higher then chance, our chance to block returned for combat would be .2125 or 21.25%
Cyric
Adept Scribe
Posts: 47
Joined: Sun Sep 13, 2009 1:29 pm

Re: How does Parry + Bushido really work?

Post by Cyric »

Just wanted to chime in here and say, it is not easy to read code when you've been drinking most of the evening. :shock:
-Malakai, he who is no longer young but not yet old
Rune
Elder Scribe
Posts: 108
Joined: Wed Jan 14, 2009 6:11 pm

Re: How does Parry + Bushido really work?

Post by Rune »

its still working this way?
<<< legendary slacker
User avatar
Melkor
Legendary Scribe
Posts: 1042
Joined: Sun Feb 14, 2010 1:30 pm

Re: How does Parry + Bushido really work?

Post by Melkor »

All I know, on this shard, 130 parry and 120 bushido (and max DCI) is your best way not to get hit, doesn't matter if you have a 1 handed or 2 handed weapon. However, some high end players don't like being so hard to hit because it makes RPD less effective.
Image
TDC Guild
Locked