UOGamers 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!

  • To obtain new Razor updates, please reinstall Razor from our new website.

[COMPLETE] Parry / Bushido [Fix] negative parry.

Status
Not open for further replies.

Kiluad

Sorceror
[COMPLETE] Parry / Bushido [Fix] negative parry.

wrong/missing math && missing skill based parrychance bump of 5% (GM bushido).

fixed - while using a shield with parry and bushido, if parry is lower, it would return a negative number in certain situations. this fix's that.

also, i added that if you have GM bushido to the list of skills at gm that gives you a minimum of 5% parry, as that is the case on EA. so if bushido OR parry are at 100+, you will have a minimum of 5% skill in parry.

Code:
Index: BaseWeapon.cs
===================================================================
--- BaseWeapon.cs	(revision 319)
+++ BaseWeapon.cs	(working copy)
@@ -1058,9 +1058,12 @@
 			{
 				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 over 100 grants a 5% bonus.
-				if ( parry >= 100.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.

Link: http://uo.stratics.com/content/skills/parrying.php

Note: It's not tested, but it doesn't prevent the server from loading. i didn't see a reason to test it, i tested to make sure it would throw a negative number at me before the fix though.
 

Kiluad

Sorceror
Re: Parry / Bushido [Fix] negative parry.

i think i need to edit it, shouldn't it be 5.0 not 0.05? for parry%

i didn't notice that till now. are percentages done with fractions of 1 cause i thought they were done with whole numbers? either way i have to edit it, back to 400 where i put it down to 4 or up to 5.0 where it says 0.05
 

Kiluad

Sorceror
Re: Parry / Bushido [Fix] negative parry.

osd, if you patched that when i first posted it, you need to fix the file, i edited something i shouldn't have, and put a proper patch up since.

I switched 400 to 4

it needs to be back at 400.

double chance = (parry - bushidoNonRacial) / 400.0;

wish i realized it used fractions to get percentages sooner.
 
Re: Parry / Bushido [Fix] negative parry.

Kiluad;558610 said:
osd, if you patched that when i first posted it, you need to fix the file, i edited something i shouldn't have, and put a proper patch up since.

I switched 400 to 4

it needs to be back at 400.

double chance = (parry - bushidoNonRacial) / 400.0;

wish i realized it used fractions to get percentages sooner.

for the truth I have not patched: I have so many patches on my RunUO I had to revert everything and now I am patching only about things I'm working on (and for now... only the skinning knife bug :p )
 

Kiluad

Sorceror
Re: Parry / Bushido [Fix] negative parry.

K good, cause if you used the one i had up before it would have really messed up your parrying ability :p

(120 - 20) / 4 = 25

2500% to block.


was just making sure. :)
 

Kiluad

Sorceror
Re: Parry / Bushido [Fix] negative parry.

Here's another baseweapon.cs fix i believe needs to be done. i can't put it in patch format, im not at home.

ORIGINAL baseweapon.cs
Code:
// 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;


I believe dex has to come before the evasion chance calculation, as i've never seen evasion mention dex as a factor. so it should be set up like this.


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



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

psz

Administrator
Re: Parry / Bushido [Fix] negative parry.

Is this part of the other Evasion thread now?

If so, I will close this one and mark it as such.
 
Re: Parry / Bushido [Fix] negative parry.

psz;566545 said:
Is this part of the other Evasion thread now?

If so, I will close this one and mark it as such.

Nope, but you can flag it as fixed, since it's implemented in the last SVN
 
Status
Not open for further replies.
Top