Server.Mobiles.BaseCreature.OnBeforeDeath C# (CSharp) Méthode

OnBeforeDeath() public méthode

public OnBeforeDeath ( ) : bool
Résultat bool
        public override bool 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 && 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 ( !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();
        }
BaseCreature