Server.Mobiles.BaseCreature.OnDeath C# (CSharp) Метод

OnDeath() публичный Метод

public OnDeath ( Container c ) : void
c Container
Результат void
        public override void OnDeath( Container c )
        {
            MeerMage.StopEffect( this, false );

            if ( IsBonded )
            {
                int sound = this.GetDeathSound();

                if ( sound >= 0 )
                    Effects.PlaySound( this, this.Map, sound );

                Warmode = false;

                Poison = null;
                Combatant = null;

                Hits = 0;
                Stam = 0;
                Mana = 0;

                IsDeadPet = true;
                ControlTarget = ControlMaster;
                ControlOrder = OrderType.Follow;

                ProcessDeltaQueue();
                SendIncomingPacket();
                SendIncomingPacket();

                List<AggressorInfo> aggressors = this.Aggressors;

                for ( int i = 0; i < aggressors.Count; ++i )
                {
                    AggressorInfo info = aggressors[i];

                    if ( info.Attacker.Combatant == this )
                        info.Attacker.Combatant = null;
                }

                List<AggressorInfo> aggressed = this.Aggressed;

                for ( int i = 0; i < aggressed.Count; ++i )
                {
                    AggressorInfo info = aggressed[i];

                    if ( info.Defender.Combatant == this )
                        info.Defender.Combatant = null;
                }

                Mobile owner = this.ControlMaster;

                if ( owner == null || owner.Deleted || owner.Map != this.Map || !owner.InRange( this, 12 ) || !this.CanSee( owner ) || !this.InLOS( owner ) )
                {
                    if ( this.OwnerAbandonTime == DateTime.MinValue )
                        this.OwnerAbandonTime = DateTime.Now;
                }
                else
                {
                    this.OwnerAbandonTime = DateTime.MinValue;
                }

                GiftOfLifeSpell.HandleDeath( this );

                CheckStatTimers();
            }
            else
            {
                if ( !Summoned && !m_NoKillAwards )
                {
                    int totalFame = Fame / 100;
                    int totalKarma = -Karma / 100;
                    if (Map == Map.Felucca)
                    {
                        totalFame += ((totalFame/10)*3);
                        totalKarma += ((totalKarma/10)*3);
                    }

                    List<DamageStore> list = GetLootingRights( this.DamageEntries, this.HitsMax );
                    List<Mobile> titles = new List<Mobile>();
                    List<int> fame = new List<int>();
                    List<int> karma = new List<int>();

                    bool givenQuestKill = false;
                    bool givenFactionKill = false;
                    bool givenToTKill = false;

                    for ( int i = 0; i < list.Count; ++i )
                    {
                        DamageStore ds = list[i];

                        if ( !ds.m_HasRight )
                            continue;

                        Party party = Engines.PartySystem.Party.Get( ds.m_Mobile );

                        if ( party != null )
                        {
                            int divedFame = totalFame / party.Members.Count;
                            int divedKarma = totalKarma / party.Members.Count;

                            for ( int j = 0; j < party.Members.Count; ++j )
                            {
                                PartyMemberInfo info = party.Members[ j ] as PartyMemberInfo;

                                if ( info != null && info.Mobile != null )
                                {
                                    int index = titles.IndexOf( info.Mobile );

                                    if ( index == -1 )
                                    {
                                        titles.Add( info.Mobile );
                                        fame.Add( divedFame );
                                        karma.Add( divedKarma );
                                    }
                                    else
                                    {
                                        fame[ index ] += divedFame;
                                        karma[ index ] += divedKarma;
                                    }
                                }
                            }
                        }
                        else
                        {
                            titles.Add( ds.m_Mobile );
                            fame.Add( totalFame );
                            karma.Add( totalKarma );
                        }

                        OnKilledBy( ds.m_Mobile );

                        if ( !givenFactionKill )
                        {
                            givenFactionKill = true;
                            Faction.HandleDeath( this, ds.m_Mobile );
                        }

                        Region region = ds.m_Mobile.Region;

                        if( !givenToTKill && ( Map == Map.Tokuno || region.IsPartOf( "Yomotsu Mines" ) || region.IsPartOf( "Fan Dancer's Dojo" ) ))
                        {
                            givenToTKill = true;
                            TreasuresOfTokuno.HandleKill( this, ds.m_Mobile );
                        }

                        if ( givenQuestKill )
                            continue;

                        PlayerMobile pm = ds.m_Mobile as PlayerMobile;

                        if ( pm != null )
                        {
                            QuestSystem qs = pm.Quest;

                            if ( qs != null )
                            {
                                qs.OnKill( this, c );
                                givenQuestKill = true;
                            }
                        }
                    }
                    for ( int i = 0; i < titles.Count; ++i )
                    {
                        Titles.AwardFame( titles[ i ], fame[ i ], true );
                        Titles.AwardKarma( titles[ i ], karma[ i ], true );
                    }
                }

                base.OnDeath( c );

                if ( DeleteCorpseOnDeath )
                    c.Delete();
            }
        }
BaseCreature