From 9bab3ea7a687a30ad5c792f70f54a274dc1de049 Mon Sep 17 00:00:00 2001 From: xavier Date: Mon, 19 Sep 2011 22:42:19 +0000 Subject: [PATCH] fix for spiritspeak and animatedead to ensure they consume corpses as appropriate. --- Scripts/Skills/SpiritSpeak.cs | 2 +- Scripts/Spells/Necromancy/AnimateDeadSpell.cs | 47 ++++++++++--------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/Scripts/Skills/SpiritSpeak.cs b/Scripts/Skills/SpiritSpeak.cs index 021544ae9..51db6a5f9 100644 --- a/Scripts/Skills/SpiritSpeak.cs +++ b/Scripts/Skills/SpiritSpeak.cs @@ -138,7 +138,7 @@ namespace Server.SkillHandlers foreach ( Item item in Caster.GetItemsInRange( 3 ) ) { - if( item is Corpse && !( (Corpse)item ).Channeled && !( (Corpse)item ).Animated ) + if( item is Corpse && !( (Corpse)item ).Channeled ) { toChannel = (Corpse)item; break; diff --git a/Scripts/Spells/Necromancy/AnimateDeadSpell.cs b/Scripts/Spells/Necromancy/AnimateDeadSpell.cs index 63c0ac955..3cce576b4 100644 --- a/Scripts/Spells/Necromancy/AnimateDeadSpell.cs +++ b/Scripts/Spells/Necromancy/AnimateDeadSpell.cs @@ -193,34 +193,39 @@ namespace Server.Spells.Necromancy { Type type = null; - if ( c.Owner != null ) + if( c.Owner != null ) + { type = c.Owner.GetType(); - - if ( c.ItemID != 0x2006 || c.Channeled || type == typeof( PlayerMobile ) || type == null || ( c.Owner != null && c.Owner.Fame < 100 ) || ( ( c.Owner != null ) && ( c.Owner is BaseCreature ) && ( ((BaseCreature)c.Owner).Summoned || ((BaseCreature)c.Owner).IsBonded)) ) - { - Caster.SendLocalizedMessage( 1061085 ); // There's not enough life force there to animate. } - else + + if( c.ItemID != 0x2006 && !c.Animated ) { - CreatureGroup group = FindGroup( type ); - - if ( group != null ) + if( type == typeof( PlayerMobile ) || type == null || ( c.Owner != null && c.Owner.Fame < 100 ) || ( ( c.Owner != null ) && ( c.Owner is BaseCreature ) && ( ( ( BaseCreature )c.Owner ).Summoned || ( ( BaseCreature )c.Owner ).IsBonded ) ) ) { - if ( group.m_Entries.Length == 0 || type == typeof( DemonKnight ) ) - { - Caster.SendLocalizedMessage( 1061086 ); // You cannot animate undead remains. - } - else if ( CheckSequence() ) - { - Point3D p = c.GetWorldLocation(); - Map map = c.Map; + Caster.SendLocalizedMessage( 1061085 ); // There's not enough life force there to animate. + } + else + { + CreatureGroup group = FindGroup( type ); - if ( map != null ) + if( group != null ) + { + if( group.m_Entries.Length == 0 || type == typeof( DemonKnight ) ) { - Effects.PlaySound( p, map, 0x1FB ); - Effects.SendLocationParticles( EffectItem.Create( p, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 ); + Caster.SendLocalizedMessage( 1061086 ); // You cannot animate undead remains. + } + else if( CheckSequence() ) + { + Point3D p = c.GetWorldLocation(); + Map map = c.Map; - Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( SummonDelay_Callback ), new object[]{ Caster, c, p, map, group } ); + if( map != null ) + { + Effects.PlaySound( p, map, 0x1FB ); + Effects.SendLocationParticles( EffectItem.Create( p, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 ); + + Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( SummonDelay_Callback ), new object[] { Caster, c, p, map, group } ); + } } } }