fix for spiritspeak and animatedead to ensure they consume corpses as appropriate.

This commit is contained in:
xavier 2011-09-19 22:42:19 +00:00
parent e4a82bf11f
commit 9bab3ea7a6
2 changed files with 27 additions and 22 deletions

View file

@ -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;

View file

@ -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 } );
}
}
}
}