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] Bushido's Evasion to evade something!

Status
Not open for further replies.

Kiluad

Sorceror
Re: Bushido's Evasion to evade something!

gilgamash;558360 said:
Maybe we should just change the factor from 1.5 to 15?

1 = the percentage of the first number (parry). ".number" (.5/evasion bonus) = percentage of second number. times each other = combination of the %'s.

if it's 15 * (parry chance) you could end up with 450% chance of parrying. someone would kill us.


plus all numbers are variables, based on skills
 

gilgamash

Knight
Re: Bushido's Evasion to evade something!

It looks, however,, that we have to change the values somehow, maybe come up with a new formula to match this.Should be easy...

Orinig playguide:
Evasion
Mana Cost: 10
Minimum Skill Needed: 60 (Also requires minimum 50 skill with the weapon being wielded.)
For a short duration after activating this ability, the Samurai can attempt to parry any attack (including attacks like dragon breath and lightning bolts). The chance to parry is increased by between 16-40% of the Samurai's normal chance to parry an attack, with a 10% bonus for Bushido above 100 AND both Tactics and Anatomy that are 100 or better.

G.
 

tam

Bug Hunter
Re: Bushido's Evasion to evade something!

The Fix

use
if( IsEvading( defender ) && 0.50 > Utility.RandomDouble() )

instead of
if( IsEvading( defender ) && VerifyCast( defender, false ) && BaseWeapon.CheckParry( defender ) ) //As per OSI, uses the exact same parry code

VerifyCast should not be there because once the defender is evading or in cool down, it always returns false. i.e. if it is there you will never evade spells

I used 0.50 because an archer should be able to evade as well, as an archer has zero parry and BaseWeapon.CheckParry will always return false for an archer.

Works for dexers and archers.

Note: Evading direct damage spells is different from the extra parry bonus to "evade" melee or arrows.
 

Kiluad

Sorceror
Re: Bushido's Evasion to evade something!

Hey tam, how do i convert a double to a string so i can make sure the right value is being pumped out? do you know, cause it's slowing me down trying to figure this out.
 

tam

Bug Hunter
Re: Bushido's Evasion to evade something!

double doublevar = 12.12;
If
Console.WriteLine ( doublevar );
doesnt work, then try
Console.WriteLine ( doublevar.ToString() );
 

tam

Bug Hunter
Re: Bushido's Evasion to evade something!

http://update.uo.com/design_530.html
# Evasion duration will scale with your Bushido skill. Range is 3-6 second duration, with a 2 second bonus if your bushido is above GM and both tactics and anatomy are GM or better
# Evasion parry modifier will scale with your Bushido skill. Range is 16-40%, with a 10% bonus if your bushido is above GM and both tactics and anatomy are GM or better
# Chance to parry is now penalized if dex is below 80
# Fixed a bug that was preventing Paladins to be capped at FC2 if they have 70 or more Magery skill as was originally intended

Note the above doesnt say anything about evasion spell evade modifier, so I assume it is still 50%.
 

gilgamash

Knight
Re: Bushido's Evasion to evade something!

you can also outprint message directly into UO, using

Code:
xxx.SendMessage(String.Format("blablabla {0} {1} ...", varName0, varName1, ...))

Kiluad;558380 said:
Hey tam, how do i convert a double to a string so i can make sure the right value is being pumped out? do you know, cause it's slowing me down trying to figure this out.
 

Kiluad

Sorceror
Re: Bushido's Evasion to evade something!

gilgamash;558388 said:
you can also outprint message directly into UO, using

Code:
xxx.SendMessage(String.Format("blablabla {0} {1} ...", varName0, varName1, ...))

varname can be a double? then? i totally gave up on trying to do that, couldn't get a double to come out as a string so i could have my player emote what evade% was being calculated at. and i really want to do it before i post a simple, but probably extremely important fix. just to make sure im right. i also want to know what it does with certain numbers.
 
Re: Bushido's Evasion to evade something!

tam;558374 said:
The Fix

use
if( IsEvading( defender ) && 0.50 > Utility.RandomDouble() )

instead of
if( IsEvading( defender ) && VerifyCast( defender, false ) && BaseWeapon.CheckParry( defender ) ) //As per OSI, uses the exact same parry code

VerifyCast should not be there because once the defender is evading or in cool down, it always returns false. i.e. if it is there you will never evade spells


If this is true, I don't understand why I reached to evade with 700 bushido and parrying. If it reports always a false bool, I should not reach to evade, despite every value I could set in Bushido and Parrying
I believe VerifyCast is there to avoid, for example, you evade a spell while you are casting something. The problem, if there is one there, is to let it know the Evasion activated is not a "casting in progress".
 

tam

Bug Hunter
Re: Bushido's Evasion to evade something!

osd_daedalus;558438 said:
If this is true, I don't understand why I reached to evade with 700 bushido and parrying. If it reports always a false bool, I should not reach to evade, despite every value I could set in Bushido and Parrying
I believe VerifyCast is there to avoid, for example, you evade a spell while you are casting something. The problem, if there is one there, is to let it know the Evasion activated is not a "casting in progress".

Sorry, I should have typed "The 2nd check VerifyCast( defender, false ) is always coming back false regardless of archer or dexer, so there is currently a 0% chance to evade." ... a spell if you have <= 120 Bushido when you are in the 20 second cool down period after successfully casting the Evasion spell because of this line
Code:
				if ( !Caster.CanBeginAction( typeof( Evasion ) ) )
				{
					Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
					return false;
				}

If you have 700 bushido (which you are not suppose to have).
The code
Code:
		public static TimeSpan GetEvadeDuration( Mobile m )
		{

			/* Evasion duration now scales with Bushido skill
			 * 
			 * If the player has higher than GM Bushido, and GM Tactics and Anatomy, they get a 1 second bonus
			 * Evasion duration range:
			 * o 3-6 seconds w/o tactics/anatomy
			 * o 6-7 seconds w/ GM+ Bushido and GM tactics/anatomy 
			 */

			if( !Core.ML )
				return TimeSpan.FromSeconds( 8.0 );

			double seconds = 3;

			if( m.Skills.Bushido.Value > 60 )
				seconds += (m.Skills.Bushido.Value - 60) / 20;

			if( m.Skills.Anatomy.Value >= 100.0 && m.Skills.Tactics.Value >= 100.0 &&  m.Skills.Bushido.Value > 100.0 )	//Bushido being HIGHER than 100 for bonus is intended
				seconds++;

			return TimeSpan.FromSeconds( (int)seconds );
		}
will return something like 36 seconds for the Evasion.
So in the 16 seconds after the 20 second cool down, you will then be able to evade spells (i.e. >20 seconds and <36 seconds after first casting Evasion). But if you Bushido <= 120 you will have max duration of 7 seconds, and this weird occurence wont happen.

... something like that anyway.

btw
if( IsEvading( defender ) && ( ( GetParryScalar( defender ) - 1 ) > Utility.RandomDouble() ) )
is another alternative fix if you would like dont think its a flat 50% chance to evade a spell.

I have attached my Evasion.cs file that has test lines that you can try out with difference test senarios.
 

Attachments

  • Evasion_test.txt
    6.1 KB · Views: 0

Kiluad

Sorceror
Re: Bushido's Evasion to evade something!

tam;558374 said:
I used 0.50 because an archer should be able to evade as well, as an archer has zero parry and BaseWeapon.CheckParry will always return false for an archer.

shouldn't be able to evade

Does Archery Work with Bushido?
This is a trick question. Yes, Archery works with Bushido, however specific Bushido moves will not work without parry skill. In this case, Counter Attack and Evasion both will not work without parry, and the secondary aspects of Confidence will not either. Momentum Strike also will require the archer to be next to two opponents to get it to work effectively and the parry stipulation of a failed honorable execution will not work with archery either. The reason these do not work with archery is because you cannot ever parry with a bow, and the likelihood of this changing is pretty low
- UO site


It does work though, because if the archer has 100 bushido or parry they have 5% parry chance.
 

tam

Bug Hunter
Re: Bushido's Evasion to evade something!

The Fix to evade spells

if( IsEvading( defender ) && 0.50 > Utility.RandomDouble() )
or
if( IsEvading( defender ) && ( ( GetParryScalar( defender ) - 1 ) > Utility.RandomDouble() ) )

if you dont think it is still a flat 50% chance to evade a spell.

Archers used to have a flat 50% chance to evade a spell, so there is no way EA would nerf it to <=5%.
 

Kiluad

Sorceror
Re: Bushido's Evasion to evade something!

tam;558906 said:
if you dont think it is still a flat 50% chance to evade a spell.

Archers used to have a flat 50% chance to evade a spell, so there is no way EA would nerf it to <=5%.

That's not what people say on the Stratics forum.

http://vboards.stratics.com/showthread.php?p=1225453

http://vboards.stratics.com/showthread.php?p=357344

which is making me thing you lose the 5% if you're using a bow. but i doubt anyone would care too much, it's only a 7.5% chance to evade with evasion and archery.

archers by nature aren't defensive fighters, it makes complete sense they wouldn't get high defense abilities, especially considering they have ranged attacks, making them better offensively.
 

crackhead

Knight
Re: Bushido's Evasion to evade something!

i havnt played osi for a few years but back then archers couldnt evade and everything ive read on stratics says the same.
 
Re: Bushido's Evasion to evade something!

Just updated links and code sections in first post.

Hmmm... we did many attempt to fix this, but nothing as OSI.

For the truth, I'm asking myself if Evasion was correct before (bug invalid) and if the matter was caused by the associated bug.

Later I'll do some tests about.
 

tam

Bug Hunter
Re: Bushido's Evasion to evade something!

osd_daedalus;559697 said:
Just updated links and code sections in first post.

Hmmm... we did many attempt to fix this, but nothing as OSI.

For the truth, I'm asking myself if Evasion was correct before (bug invalid) and if the matter was caused by the associated bug.

Later I'll do some tests about.

The bug was introduced when the 20 second cool down timer was implemented.

This code
Code:
if ( !Caster.CanBeginAction( typeof( Evasion ) ) )
				{
					Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
					return [B]false[/B];
				}

was added to VerifyCast. So when you call VerifyCast again when someone is already evading, VerifyCast will return false.

So when you have

Code:
			if( IsEvading( defender ) && VerifyCast( defender, false ) && BaseWeapon.CheckParry( defender ) ) //As per OSI, uses the exact same parry code
			{
[COLOR="Blue"]				defender.Emote( "*evades*" );	//Yes.  Eew.  Blame OSI.
				defender.FixedEffect( 0x37B9, 10, 16 );
				return true;[/COLOR]
			}

when someone is already evading, it wont get into the blue bit to evade a spell, and hence you wont evade anything [if bushido <= 120].
 

Kiluad

Sorceror
Re: Bushido's Evasion to evade something!

Here's some more accurate math for evasion.cs

I think that will work, can't test it or put it in patch format (im not at home), all i can do is calculate the math which is correct and write the code. the old math seemed to give me screwy numbers. with my math it was going from 16% evasion bonus at 60 skill, to 28% at 60.1 skill..... check it out and tell me if im wrong. but doesn't m.Skills.Bushido.Value return the players skill?

Evasion.cs
Code:
*/
			
			
			if( !Core.ML )
				return 1.5;

			[COLOR="Red"]double bonus = 0;

			if ( m.Skills.Bushido.Value >= 60 )
				bonus += ( (m.Skills.Bushido.Value - 60) * .004 ) + 0.16;[/COLOR]



			if( m.Skills.Anatomy.Value >= 100 && m.Skills.Tactics.Value >= 100 &&  m.Skills.Bushido.Value > 100 )	//Bushido being HIGHER than 100 for bonus is intended
				[COLOR="Red"]bonus += 0.10;[/COLOR]

			[COLOR="Red"]return 1.0 + bonus;[/COLOR]
		}

		public static void BeginEvasion( Mobile m )
 
Re: Bushido's Evasion to evade something!

Kiluad;559814 said:
so is there a proper patch for getting evasion working yet?

I am confused too... I have also reverted that patch for negative values to "ready but needs testing more"

But looks like tam has right. The formula should be correct, that delay coded in that way is ruining all
 
Status
Not open for further replies.
Top