当前位置: 首页>>代码示例>>C#>>正文


C# Container.Delete方法代码示例

本文整理汇总了C#中Server.Items.Container.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# Container.Delete方法的具体用法?C# Container.Delete怎么用?C# Container.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Items.Container的用法示例。


在下文中一共展示了Container.Delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDeath

        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            if (!c.Deleted)
            {
                while (c.Items.Count > 0)
                    c.Items[0].MoveToWorld(c.Location, c.Map);
                c.Delete();
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:11,代码来源:BloodElemental.cs

示例2: OnDeath

        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();

                ArrayList aggressors = this.Aggressors;

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

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

                ArrayList aggressed = this.Aggressed;

                for ( int i = 0; i < aggressed.Count; ++i )
                {
                    AggressorInfo info = (AggressorInfo)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;
                }

                CheckStatTimers();
            }
            else
            {
                if ( !Summoned && !m_NoKillAwards )
                {
                    int totalFame = Fame / 100;
                    int totalKarma = -Karma / 100;

                    ArrayList list = GetLootingRights( this.DamageEntries, this.HitsMax );

                    bool givenQuestKill = false;
                    bool givenFactionKill = false;

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

                        if ( !ds.m_HasRight )
                            continue;

                        Titles.AwardFame( ds.m_Mobile, totalFame, true );
                        Titles.AwardKarma( ds.m_Mobile, totalKarma, true );

                        if ( m_Paragon )
                            if ( Paragon.CheckArtifactChance( ds.m_Mobile, this ) )
                                Paragon.GiveArtifactTo( ds.m_Mobile );

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

                        if ( givenQuestKill )
                            continue;

                        PlayerMobile pm = ds.m_Mobile as PlayerMobile;

                        if ( pm != null )
//.........这里部分代码省略.........
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:101,代码来源:BaseCreature.cs

示例3: OnDeath

        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            List<Item> list = new List<Item>();
            foreach (Item item in c.Items)
                list.Add(item);

            foreach (Item item in list)
                item.MoveToWorld(c.Location, c.Map);

            c.Delete();
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:13,代码来源:PoisonElemental.cs

示例4: OnDeath

		public override void OnDeath( Container c )
		{
			base.OnDeath( c );

			c.Delete();
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:6,代码来源:SpawnedOrcishLord.cs

示例5: OnAfterDeath

        protected override void OnAfterDeath( Container c )
        {
            MeerMage.StopEffect( this, false );

            ArcaneEmpowermentSpell.StopBuffing( this, false );

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

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

                Warmode = false;

                Poison = null;
                Combatant = null;

                BleedAttack.EndBleed( this, false );
                Spells.Necromancy.StrangleSpell.RemoveCurse( this );

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

                IsDeadPet = true;

                ProcessDeltaQueue();
                this.SendIncomingPacket();
                this.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;
                }

                CheckStatTimers();
            }
            else
            {
                if ( !Summoned && !m_NoKillAwards )
                {
                    int totalFame = Fame / 100;
                    int totalKarma = -Karma / 100;

                    for ( int i = 0; i < this.DamageEntries.Count; i++ )
                    {
                        DamageEntry entry = this.DamageEntries[i];

                        if ( !entry.HasExpired && entry.DamageGiven > ( this.HitsMax / 10 ) )
                        {
                            if ( entry.Damager is VoidCreature )
                                ( (VoidCreature) entry.Damager ).OnKill( this );
                        }
                    }

                    List<DamageStore> list = GetLootingRights( this.DamageEntries, this.HitsMax );

                    bool givenQuestKill = false;
                    bool givenFactionKill = false;

                    bool givesLoyaltyAward = ( LoyaltyPointsAward > 0 );
                    LoyaltyGroupInfo loyaltyGroup = LoyaltyGroupInfo.GetInfo( LoyaltyGroupEnemy );

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

                        if ( !ds.HasRight )
                            continue;

                        Titles.AwardFame( ds.Mobile, totalFame, true );
                        Titles.AwardKarma( ds.Mobile, totalKarma, true );
//.........这里部分代码省略.........
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:101,代码来源:BaseCreature.cs

示例6: OnDeath

        public override void OnDeath(Container c)
        {
            MeerMage.StopEffect(this, false);

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

                if (sound >= 0)
                {
                    Effects.PlaySound(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();

                var aggressors = Aggressors;

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

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

                var aggressed = Aggressed;

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

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

                Mobile owner = ControlMaster;

                if (owner == null || owner.Deleted || owner.Map != Map || !owner.InRange(this, 12) || !CanSee(owner) ||
                    !InLOS(owner))
                {
                    if (OwnerAbandonTime == DateTime.MinValue)
                    {
                        OwnerAbandonTime = DateTime.UtcNow;
                    }
                }
                else
                {
                    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);
                    }

                    var list = GetLootingRights();
                    var titles = new List<Mobile>();
                    var fame = new List<int>();
                    var karma = new List<int>();

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

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

//.........这里部分代码省略.........
开发者ID:Ravenwolfe,项目名称:ServUO,代码行数:101,代码来源:BaseCreature.cs

示例7: OnAfterDeath

        protected override void OnAfterDeath( Container c )
        {
            base.OnAfterDeath( c );

            c.Delete();
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:6,代码来源:BaseFactionGuard.cs

示例8: OnDeath

        public override void OnDeath( Container c )
        {
            if ( !Summoned && !m_NoKillAwards )
            {
                // note creatures with neg karma GIVE us karma, so these numbers are negated
                ArrayList list = GetLootingRights( this.DamageEntries );
                for ( int i = 0; i < list.Count; ++i )
                {
                    DamageStore ds = (DamageStore)list[i];
                    if ( !ds.m_HasRight )
                        continue;
                    Mobile mob = ds.m_Mobile;

                    if ( mob is BaseCreature )
                    {
                        BaseCreature bc = (BaseCreature)mob;
                        if ( bc.Controled && bc.ControlMaster != null )
                            mob = bc.ControlMaster;
                        else if ( bc.Summoned && bc.SummonMaster != null )
                            mob = bc.SummonMaster;
                    }

                    int noto = Notoriety.Compute( mob, this );
                    if ( noto == Notoriety.Innocent )
                        Titles.AlterNotoriety( mob, -8 );
                    else if ( noto == Notoriety.Murderer )
                        Titles.AlterNotoriety( mob, 1 );
                    // cap the gain/loss at the npc's karma?? (so killing a 0 karma npc only takes you to 0)
                }
            }

            base.OnDeath( c );
            if ( DeleteCorpseOnDeath )
            {
                c.Delete();
            }
            else if ( this is WaterElemental || this is FireElemental || this is AirElemental || this is PoisonElemental || this is BloodElemental )
            {
                Backpack pack = new Backpack();
                this.Corpse = pack;
                pack.MoveToWorld( c.Location, c.Map );
                while ( c.Items.Count > 0 )
                    pack.DropItem( (Item)c.Items[0] );
                c.Delete();
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:46,代码来源:BaseCreature.cs

示例9: OnDeath

        public override void OnDeath( Container c )
        {
            if( this.VanishTime == DateTime.MinValue )
                AwardXPnCP();

            Lives--;

            if( Lives >= 0 )
            {
                m_TimeOfDeath = DateTime.Now;
                BeginRess( m_DefaultRessTime, c );
            }

            else
                this.IsBonded = false;

            if ( IsBonded && WaitForRess )
            {
                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;
                }

                CheckStatTimers();
            }
            else
            {
                Mobile killer = this.FindMostRecentDamager( true );

                if( killer != null )
                {
                    OnKilledBy( killer );
                    OnXMLEvent( XMLEventType.OnDeathInvokeOnMobile, killer );
                }

                base.OnDeath( c );

                if( DeleteCorpseOnDeath )
                    c.Delete();

                else
                    OnXMLEvent( XMLEventType.OnDeathInvokeOnItem, c );

                OnXMLEvent( XMLEventType.OnDeath );
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:95,代码来源:BaseCreature.cs

示例10: OnDeath

		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();

				SetGhostDeletionTimer( true );
			}
			else
			{
				if ( !Summoned && !m_NoKillAwards )
				{
					int totalFame = Fame / 100;
					int totalKarma = -Karma / 100;

					List<DamageStore> list = GetLootingRights( this.DamageEntries, this.HitsMax );

					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;

						Titles.AwardFame( ds.m_Mobile, totalFame, true );
						Titles.AwardKarma( ds.m_Mobile, totalKarma, true );

						OnKilledBy( ds.m_Mobile );

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

						if( !givenToTKill )
						{
							givenToTKill = true;
//.........这里部分代码省略.........
开发者ID:ITLongwell,项目名称:mondains-legacy,代码行数:101,代码来源:BaseCreature.cs

示例11: OnDeath


//.........这里部分代码省略.........
    
                                //List<Aggressors> list = Aggressors;
				//List list = List<Aggressors>;//Aggressors;
                                for ( int i = 0; i < /*Attacker.*/Aggressors.Count; ++i )
				//for ( int i = 0; i < list.Count; ++i )
				{
					//List<AggressorInfo> info = (AggressorInfo)list[i];
                                        AggressorInfo info = (AggressorInfo)/*Attacker.*/Aggressors[i];
                                        //List<AggressorInfo> info = (AggressorInfo)list[i];//controlMaster.Aggressors;
                                        
					if ( (DateTime.Now - info.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( info.Attacker ) )
						toGive.Add( info.Attacker );
				}

				//list = Aggressed;
				//for ( int i = 0; i < list.Count; ++i )
                                for ( int i = 0; i < /*owner.*/Aggressors.Count; ++i )
				{
					//AggressorInfo info = (AggressorInfo)list[i];
                                        AggressorInfo info = (AggressorInfo)/*Defender.*/Aggressors[i];
                                        
					if ( (DateTime.Now - info.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( info.Defender ) )
						toGive.Add( info.Defender );
				}

				for ( int i = 0; i < toGive.Count; ++i )
				{
					Mobile m = (Mobile)toGive[i];

					int karmaToGive = totalKarma;
					int fameToGive = totalFame;

					if ( m.Karma < 0 )
					{
						if ( Karma > 0 && m.Karma <= -Karma )
							karmaToGive = 0;
					}
					else if ( m.Karma > 0 )
					{
						if ( Karma < 0 && m.Karma >= -Karma )
							karmaToGive = 0;
					}

					if ( m.Fame > Fame )
						fameToGive = 0;

					if ( (m.Karma + karmaToGive) > 10000 )
						karmaToGive = 10000 - m.Karma;
					else if ( (m.Karma + karmaToGive) < -10000 )
						karmaToGive = -10000 - m.Karma;

					if ( (m.Fame + fameToGive) > 10000 )
						fameToGive = 10000 - m.Fame;
					else if ( (m.Fame + fameToGive) < 0 )
						fameToGive = -m.Fame;

					m.Karma += karmaToGive;
					m.Fame += fameToGive;

					if ( fameToGive >= 40 )
						m.SendLocalizedMessage( 1019054 ); // You have gained a lot of fame.
					else if ( fameToGive >= 25 )
						m.SendLocalizedMessage( 1019053 ); // You have gained a good amount of fame.
					else if ( fameToGive >= 10 )
						m.SendLocalizedMessage( 1019052 ); // You have gained some fame.
					else if ( fameToGive >= 1 )
						m.SendLocalizedMessage( 1019051 ); // You have gained a little fame.
					else if ( fameToGive <= -40 )
						m.SendLocalizedMessage( 1019058 ); // You have lost a lot of fame.
					else if ( fameToGive <= -25 )
						m.SendLocalizedMessage( 1019057 ); // You have lost a good amount of fame.
					else if ( fameToGive <= -10 )
						m.SendLocalizedMessage( 1019056 ); // You have lost some fame.
					else if ( fameToGive <= -1 )
						m.SendLocalizedMessage( 1019055 ); // You have lost a little fame.

					if ( karmaToGive >= 40 )
						m.SendLocalizedMessage( 1019062 ); // You have gained a lot of karma.
					else if ( karmaToGive >= 25 )
						m.SendLocalizedMessage( 1019060 ); // You have gained some karma.
					else if ( karmaToGive >= 10 )
						m.SendLocalizedMessage( 1019060 ); // You have gained some karma.
					else if ( karmaToGive >= 1 )
						m.SendLocalizedMessage( 1019059 ); // You have gained a little karma.
					else if ( karmaToGive <= -40 )
						m.SendLocalizedMessage( 1019066 ); // You have lost a lot of karma.
					else if ( karmaToGive <= -25 )
						m.SendLocalizedMessage( 1019065 ); // You have lost a good amount of karma.
					else if ( karmaToGive <= -10 )
						m.SendLocalizedMessage( 1019064 ); // You have lost some karma.
					else if ( karmaToGive <= -1 )
						m.SendLocalizedMessage( 1019063 ); // You have lost a little karma.
				}
			}

			base.OnDeath( c );

			if ( Crafted )
				c.Delete();
	}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:101,代码来源:BaseAssembly.cs

示例12: OnDeath

        public override void OnDeath(Container c)
        {
            Grandma2 s2 = new Grandma2();
            s2.Map = this.Map;
            s2.Location = this.Location;

            base.OnDeath(c);
            c.Delete();
        }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:9,代码来源:Grandma.cs

示例13: OnDeath

 public override void OnDeath(Container c)
 {
     Talon4 t4 = new Talon4();
     t4.Map = this.Map;
     t4.Location = this.Location;
     
     base.OnDeath(c);
     c.Delete();
 }
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:9,代码来源:TalonQM3.cs

示例14: OnDeath


//.........这里部分代码省略.........
			{
				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;

				//Bonded pet will take statloss until this time
				// initially 3.0 hours from death.
				m_StatLossTime = DateTime.Now + TimeSpan.FromHours(3.0);

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

				ArrayList aggressors = this.Aggressors;

				for ( int i = 0; i < aggressors.Count; ++i )
				{
					AggressorInfo info = (AggressorInfo)aggressors[i];
					if ( info.Attacker is BaseGuard )
						c.Delete();

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

				ArrayList aggressed = this.Aggressed;

				for ( int i = 0; i < aggressed.Count; ++i )
				{
					AggressorInfo info = (AggressorInfo)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;
				}
			}
			else
			{
				if ( !Summoned && !m_NoKillAwards )
				{
					int totalFame = Fame / 100;
开发者ID:zerodowned,项目名称:angelisland,代码行数:67,代码来源:BaseCreature.cs

示例15: OnDeath

        public override void OnDeath( Container c )
        {
            BodyMod = 0;

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

                CheckStatTimers();
            }
            else
            {
                if( !Summoned && !m_NoKillAwards )
                {
                    int totalFame = Fame / 100;
                    int totalKarma = -Karma / 100;

                    List<DamageStore> list = GetLootingRights(this.DamageEntries, this.HitsMax);

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

                        if( !ds.m_HasRight )
                            continue;

                        Titles.AwardFame(ds.m_Mobile, totalFame, true);
                        Titles.AwardKarma(ds.m_Mobile, totalKarma, true);

                        OnKilledBy(ds.m_Mobile);
                    }
                }

                if (AreSurroundingPlayers)
                    DeleteCorpseOnDeath = false;

                if (!(AreSurroundingPlayers))
                    DeleteCorpseOnDeath = true;

                base.OnDeath(c);

                if( DeleteCorpseOnDeath )
                    c.Delete();
            }
        }
开发者ID:ITLongwell,项目名称:Ulmeta,代码行数:97,代码来源:BaseCreature.cs


注:本文中的Server.Items.Container.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。