Hello guys!Getting strange error when a player kill custom enemie.
It die well,if the chance is correct,it drops well,but when it die,invisible enemie is alive,then the players pet fight vs this invisible enemie,when it die,a new body appears in floor,and a new invisible enemie,same enemie without body.
Any idea?
Here the full script.
(Body crimson dragon).
using System;
using Server;
using Server.Items;
using Server.Network;


namespace Server.Mobiles
{
[CorpseName( "Holocaust corpse" )]
public class Holocaust : BaseCreature
{
[Constructable]
public Holocaust() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "Holocaust";
Body = 197;
BaseSoundID = 357;

SetStr( 396, 625 );
SetDex( 86, 105 );
SetInt( 436, 475 );

SetHits( 478, 495 );

SetDamage( 13, 18 );

SetDamageType( ResistanceType.Physical, 100 );

SetResistance( ResistanceType.Physical, 55, 65 );
SetResistance( ResistanceType.Fire, 60, 70 );
SetResistance( ResistanceType.Cold, 30, 40 );
SetResistance( ResistanceType.Poison, 25, 35 );
SetResistance( ResistanceType.Energy, 35, 45 );

//SetSkill( SkillName.EvalInt, 80.1, 100.0 );
//SetSkill( SkillName.Magery, 80.1, 100.0 );
//SetSkill( SkillName.Meditation, 52.5, 75.0 );
SetSkill( SkillName.MagicResist, 100.3, 130.0 );
SetSkill( SkillName.Tactics, 97.6, 100.0 );
SetSkill( SkillName.Wrestling, 97.6, 100.0 );

Fame = 22500;
Karma = -22500;

VirtualArmor = 70;
}

///////////////////////////////
///////////////////////////////
public override void OnDeath( Container c )
{
if ( Utility.RandomDouble() < 0.03 )
{
c.PublicOverheadMessage( MessageType.Regular, 15, 1066090 );
switch ( Utility.Random( 3 ) )
{
case 0: c.DropItem( new YoungEgg() ); break;
case 1: c.DropItem( new MinorChest() ); break;
case 2: c.DropItem( new MinorTokunoChest() ); break;

}
}
}
/////////////////////////////////////////
/////////////////////////////////////////

public override void GenerateLoot()
{
AddLoot( LootPack.FilthyRich, 3 );
AddLoot( LootPack.Gems, 5 );
}

public override int GetIdleSound()
{
return 0x2D5;
}

public override int GetHurtSound()
{
return 0x2D1;
}


public override bool ReacquireOnMovement{ get{ return true; } }
public override bool HasBreath{ get{ return true; } } // fire breath enabled
public override bool AutoDispel{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override Poison HitPoison{ get{ return Poison.Deadly; } }
public override int TreasureMapLevel{ get{ return 5; } }

public override int Meat{ get{ return 19; } }
public override int Hides{ get{ return 20; } }
public override int Scales{ get{ return 10; } }
public override ScaleType ScaleType{ get{ return ScaleType.Black; } }
public override HideType HideType{ get{ return HideType.Barbed; } }

public Holocaust( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
Thank you so much!!!
 
change
Code:
public override void OnDeath( Container c )
{
if ( Utility.RandomDouble() < 0.03 )
{
c.PublicOverheadMessage( MessageType.Regular, 15, 1066090 );
switch ( Utility.Random( 3 ) )
{
case 0: c.DropItem( new YoungEgg() ); break;
case 1: c.DropItem( new MinorChest() ); break;
case 2: c.DropItem( new MinorTokunoChest() ); break;

}
}
}

to
Code:
public override void OnDeath( Container c )
{
     base.OnDeath(c);  // ADDED LINE
if ( Utility.RandomDouble() < 0.03 )
{
c.PublicOverheadMessage( MessageType.Regular, 15, 1066090 );
switch ( Utility.Random( 3 ) )
{
case 0: c.DropItem( new YoungEgg() ); break;
case 1: c.DropItem( new MinorChest() ); break;
case 2: c.DropItem( new MinorTokunoChest() ); break;

}
}
}
 
Testing now!!!
[doublepost=1519966673][/doublepost]Working.Thank you so much for your help and your time. :D
 
Back