SSI?

Anything regarding UO or Age of Valor
Locked
Shaggy
Posts: 94
Joined: Wed May 28, 2008 1:34 pm

SSI?

Post by Shaggy »

Just wondering the formual for swing speed.

Archived topic from AOV, old topic ID:3186, old post ID:20271
Image
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

SSI?

Post by Red Squirrel »

Theres lot of calculations that go into SSI so theres not a set formula per say, so here is the entire function. This returns a time span to the next shot.

Code: Select all

public virtual TimeSpan GetDelay( Mobile m )
		{
			int penalty=0; 			
			int bonus = AosAttributes.GetValue( m, AosAttribute.WeaponSpeed );

			//calculate bonuses/penalties
			
			if ( Spells.Chivalry.DivineFurySpell.UnderEffect( m ) )
				bonus += 10;

			// Bonus granted by successful use of Honorable Execution.
			bonus += HonorableExecution.GetSwingBonus( m );

			if( DualWield.Registry.Contains( m ) )
				bonus = 70;

			//feint penalty
			if( Feint.Registry.Contains( m ) )
			penalty += ((Feint.FeintTimer)Feint.Registry[m]).SwingSpeedReduction;
			
			//spellweaving - reaper form bonus
			bonus += ReaperFormSpell.GetSwingBonus(m);
			
			//spellweaving - essence of wind penalty
			penalty += EssenceOfWindSpell.GetSwingMalus(m);			
			

			int discordanceEffect = 0;

			// Discordance gives a malus of -0/-28% to swing speed.
			if ( SkillHandlers.Discordance.GetEffect( m, ref discordanceEffect ) )
				penalty += discordanceEffect;

			//calculate bonus cap
			if ( bonus > 75 )
				bonus = 75;
				
			int stam = m.Stam;
			if(stam>170)stam=170; //cap stam in calculation (already capped in playermobile, but this is to ensure all calculations are acurate, including for mobs)
			
			bonus-=penalty;
			if(bonus<0)bonus=0;
			
			int divider=((170-stam)/15)+15;
			if(divider<1)divider=1;
			
			double FinalDelay = (((SpeedSecs*4)-((double)m.Stam/divider))*(100/(double)(100+bonus)))/4; //calculate actual speed (formula slightly differs from osi)
			
			if(FinalDelay<(MinTicks*0.25))FinalDelay=(MinTicks*0.25); //apply final speed cap
			
			double mutescalar=GetMutedDelayScalar(m); //mute used by various special abilities such as melissande aura
			FinalDelay*=mutescalar;
			
			//m.SendMessage("Speed: {0}  Pen: {1} bonus: {2}  mutescalar: {3}",FinalDelay,penalty,bonus,mutescalar); //debug 

			return TimeSpan.FromSeconds( FinalDelay );
		}
Archived topic from AOV, old topic ID:3186, old post ID:20272
Honk if you love Jesus, text if you want to meet Him!
Locked