public override bool OnBeforeDeath()
{
{
Mobile m = this.LastKiller;
switch (Utility.Random(100))
{
case 0: m.AddToBackpack(new SkillBall(1)); m.SendMessage (" You have captured a fragment of this creature's soul "); break;
}
return base.OnBeforeDeath();
}
int treasureLevel = TreasureMapLevel;
if ( treasureLevel == 1 && this.Map == Map.Trammel && TreasureMap.IsInHavenIsland( this ) )
{
Mobile killer = this.LastKiller;
if ( killer is BaseCreature )
killer = ((BaseCreature)killer).GetMaster();
if ( killer is PlayerMobile && ((PlayerMobile)killer).Young )
treasureLevel = 0;
}
if ( !Summoned && !NoKillAwards && !IsBonded )
{
if ( treasureLevel >= 0 )
{
if ( m_Paragon && Paragon.ChestChance > Utility.RandomDouble() )
PackItem( new ParagonChest( this.Name, treasureLevel ) );
else if ( (Map == Map.Felucca || Map == Map.Trammel) && TreasureMap.LootChance >= Utility.RandomDouble() )
PackItem( new TreasureMap( treasureLevel, Map ) );
}
if ( m_Paragon && Paragon.ChocolateIngredientChance > Utility.RandomDouble() )
{
switch ( Utility.Random( 4 ) )
{
case 0: PackItem( new CocoaButter() ); break;
case 1: PackItem( new CocoaLiquor() ); break;
case 2: PackItem( new SackOfSugar() ); break;
case 3: PackItem( new Vanilla() ); break;
}
}
}
if ( !Summoned && !NoKillAwards && !m_HasGeneratedLoot )
{
m_HasGeneratedLoot = true;
GenerateLoot( false );
}
if ( !NoKillAwards && Region.IsPartOf( "Doom" ) )
{
int bones = Engines.Quests.Doom.TheSummoningQuest.GetDaemonBonesFor( this );
if ( bones > 0 )
PackItem( new DaemonBone( bones ) );
}
if ( IsAnimatedDead )
Effects.SendLocationEffect( Location, Map, 0x3728, 13, 1, 0x461, 4 );
InhumanSpeech speechType = this.SpeechType;
if ( speechType != null )
speechType.OnDeath( this );
if ( m_ReceivedHonorContext != null )
m_ReceivedHonorContext.OnTargetKilled();
return base.OnBeforeDeath();
}