From 67c6503f8ddb031553b2633155ce1337b72b6075 Mon Sep 17 00:00:00 2001 From: xavier Date: Mon, 4 Feb 2013 00:11:31 +0000 Subject: [PATCH] animation fixes. --- Scripts/Items/Weapons/BaseWeapon.cs | 5 ++++- Scripts/Mobiles/BaseCreature.cs | 27 +++++++++++++++++++-------- Scripts/Mobiles/PlayerMobile.cs | 7 ++++++- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Scripts/Items/Weapons/BaseWeapon.cs b/Scripts/Items/Weapons/BaseWeapon.cs index 2404e9fc3..d1c32672e 100644 --- a/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Scripts/Items/Weapons/BaseWeapon.cs @@ -2386,7 +2386,10 @@ namespace Server.Items if ( from.Mounted ) return; - from.Animate( action, frames, 1, true, false, 0 ); + if( !from.Mounted ) + { + from.Animate( action, frames, 1, true, false, 0 ); + } } public virtual void PlaySwingAnimation( Mobile from ) diff --git a/Scripts/Mobiles/BaseCreature.cs b/Scripts/Mobiles/BaseCreature.cs index 69035c201..2a44b8c8a 100644 --- a/Scripts/Mobiles/BaseCreature.cs +++ b/Scripts/Mobiles/BaseCreature.cs @@ -3532,25 +3532,25 @@ namespace Server.Mobiles { switch ( Utility.Random( 2 ) ) { - case 0: Animate( 5, 5, 1, true, true, 1 ); break; - case 1: Animate( 6, 5, 1, true, false, 1 ); break; + case 0: CheckedAnimate( 5, 5, 1, true, true, 1 ); break; + case 1: CheckedAnimate( 6, 5, 1, true, false, 1 ); break; } } else if ( Body.IsAnimal ) { switch ( Utility.Random( 3 ) ) { - case 0: Animate( 3, 3, 1, true, false, 1 ); break; - case 1: Animate( 9, 5, 1, true, false, 1 ); break; - case 2: Animate( 10, 5, 1, true, false, 1 ); break; + case 0: CheckedAnimate( 3, 3, 1, true, false, 1 ); break; + case 1: CheckedAnimate( 9, 5, 1, true, false, 1 ); break; + case 2: CheckedAnimate( 10, 5, 1, true, false, 1 ); break; } } else if ( Body.IsMonster ) { switch ( Utility.Random( 2 ) ) { - case 0: Animate( 17, 5, 1, true, false, 1 ); break; - case 1: Animate( 18, 5, 1, true, false, 1 ); break; + case 0: CheckedAnimate( 17, 5, 1, true, false, 1 ); break; + case 1: CheckedAnimate( 18, 5, 1, true, false, 1 ); break; } } @@ -3558,7 +3558,13 @@ namespace Server.Mobiles return true; // entered idle state } - public override void Animate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) + /* + this way, due to the huge number of locations this will have to be changed + Perhaps we can change this in the future when fixing game play is not the + major issue. + */ + + public virtual void CheckedAnimate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) { if( !Mounted ) { @@ -3566,6 +3572,11 @@ namespace Server.Mobiles } } + public override void Animate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) + { + base.Animate( action, frameCount, repeatCount, forward, repeat, delay ); + } + private void CheckAIActive() { Map map = Map; diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index 5392dc870..4bf5d59ac 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -3414,7 +3414,7 @@ namespace Server.Mobiles return base.CanSee( m ); } - public override void Animate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) + public virtual void CheckedAnimate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) { if( !Mounted ) { @@ -3422,6 +3422,11 @@ namespace Server.Mobiles } } + public override void Animate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) + { + base.Animate( action, frameCount, repeatCount, forward, repeat, delay ); + } + public override bool CanSee( Item item ) { if ( m_DesignContext != null && m_DesignContext.Foundation.IsHiddenToCustomizer( item ) )