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


C# BaseCreature.Delete方法代码示例

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


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

示例1: DonatePet

		public virtual void DonatePet( PlayerMobile player, BaseCreature pet )
		{
			for ( int i = 0; i < m_Donations.Count; i ++ )
				if ( m_Donations[ i ].Type == pet.GetType() )
				{
					pet.Delete();
					Donate( player, m_Donations[ i ], 1 );
					return;
				}
				
			player.SendLocalizedMessage( 1073113 ); // This Collection is not accepting that type of creature.
		}
开发者ID:nydehi,项目名称:runuomondains,代码行数:12,代码来源:BaseCollectionMobile.cs

示例2: Eject

		public void Eject(BaseCreature bc, bool teleportOrStable)
		{
			if (bc == null || bc.Deleted)
			{
				return;
			}

			if (!teleportOrStable)
			{
				bc.Delete();
				return;
			}

			if (bc.ControlMaster is PlayerMobile)
			{
				bc.Stable();
			}
			else
			{
				Teleport(bc, Options.Locations.Eject, Options.Locations.Eject.Map);
			}
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:22,代码来源:Battle_Membership.cs

示例3: Spawn

		protected void Spawn( Point3D p, Map map, BaseCreature spawn )
		{
			if ( map == null )
			{
				spawn.Delete();
				return;
			}

			int x = p.X, y = p.Y;

			for ( int j = 0; j < 20; ++j )
			{
				int tx = p.X - 2 + Utility.Random( 5 );
				int ty = p.Y - 2 + Utility.Random( 5 );

				LandTile t = map.Tiles.GetLandTile( tx, ty );

				if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
				{
					x = tx;
					y = ty;
					break;
				}
			}

			spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );

			if ( spawn is Kraken && 0.2 > Utility.RandomDouble() )
				spawn.PackItem( new MessageInABottle( map == Map.Felucca ? Map.Felucca : Map.Trammel ) );
		}
开发者ID:Godkong,项目名称:Origins,代码行数:30,代码来源:SpecialFishingNet.cs

示例4: Summon

        public static bool Summon( BaseCreature creature, bool controled, Mobile caster, Point3D p, int sound, TimeSpan duration )
        {
            if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
            {
                caster.SendAsciiMessage( "You have too many followers to summon that creature." );
                creature.Delete();
                return false;
            }

            m_Summoning = true;

            if ( controled )
                creature.SetControlMaster( caster );

            creature.RangeHome = 10;
            creature.Summoned = true;

            creature.SummonMaster = caster;

            Container pack = creature.Backpack;

            if ( pack != null )
            {
                for ( int i = pack.Items.Count - 1; i >= 0; --i )
                {
                    if ( i >= pack.Items.Count )
                        continue;

                    ((Item)pack.Items[i]).Delete();
                }
            }

            new UnsummonTimer( caster, creature, duration ).Start();
            creature.m_SummonEnd = DateTime.Now + duration;

            creature.MoveToWorld( p, caster.Map );

            Effects.PlaySound( p, creature.Map, sound );

            m_Summoning = false;

            return true;
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:43,代码来源:BaseCreature.cs

示例5: Summon

		public static void Summon( BaseCreature creature, Mobile caster, int sound, TimeSpan duration, bool scaleDuration, bool scaleStats )
		{
			Map map = caster.Map;

			if( map == null )
				return;

			double scale = 1.0 + ((caster.Skills[SkillName.Magery].Value - 100.0) / 200.0);

			if( scaleDuration )
				duration = TimeSpan.FromSeconds( duration.TotalSeconds * scale );

			if( scaleStats )
			{
				creature.RawStr = (int)(creature.RawStr * scale);
				creature.Hits = creature.HitsMax;

				creature.RawDex = (int)(creature.RawDex * scale);
				creature.Stam = creature.StamMax;

				creature.RawInt = (int)(creature.RawInt * scale);
				creature.Mana = creature.ManaMax;
			}

			Point3D p = new Point3D( caster );

			if( SpellHelper.FindValidSpawnLocation( map, ref p, true ) )
			{
				BaseCreature.Summon( creature, caster, p, sound, duration );
				return;
			}


			/*
			int offset = Utility.Random( 8 ) * 2;

			for( int i = 0; i < m_Offsets.Length; i += 2 )
			{
				int x = caster.X + m_Offsets[(offset + i) % m_Offsets.Length];
				int y = caster.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

				if( map.CanSpawnMobile( x, y, caster.Z ) )
				{
					BaseCreature.Summon( creature, caster, new Point3D( x, y, caster.Z ), sound, duration );
					return;
				}
				else
				{
					int z = map.GetAverageZ( x, y );

					if( map.CanSpawnMobile( x, y, z ) )
					{
						BaseCreature.Summon( creature, caster, new Point3D( x, y, z ), sound, duration );
						return;
					}
				}
			}
			 * */

			creature.Delete();
			caster.SendLocalizedMessage( 501942 ); // That location is blocked.
		}
开发者ID:brodock,项目名称:genova-project,代码行数:62,代码来源:SpellHelper.cs

示例6: Spawn

        //25JUL2008 Lord_Greywolf fix for bad X *** START ***
        //        protected void Spawn( Point2D p, Map map, BaseCreature spawn )
        //        {
        //            if ( map == null )
        //            {
        //                spawn.Delete();
        //                return;
        //            }

        //            int x = p.X, y = p.Y;

        ////			for ( int j = 0; j < 5; ++j )
        ////			{
        ////				int tx = p.X - 2 + Utility.Random( 5 );
        ////				int ty = p.Y - 2 + Utility.Random( 5 );
        ////			}

        //            spawn.MoveToWorld( new Point3D( x, y, 0 ), map );
        //            spawn.PackItem( new TreasureMessageChest() );
        //}
        protected void Spawn(Point2D p, Map map, BaseCreature spawn)
        {
            if (map == null) { spawn.Delete(); return; }

            int x = p.X, y = p.Y;

            if (map.CanSpawnMobile(x, y, 0))
            {
                spawn.MoveToWorld(new Point3D(x, y, 0), map);
            }
            else
            {
                int z = map.GetAverageZ(x, y);
                if (map.CanSpawnMobile(x, y, z))
                {
                    spawn.MoveToWorld(new Point3D(x, y, z), map);
                }
                else if (map.CanSpawnMobile(x, y, z + 10))
                {
                    spawn.MoveToWorld(new Point3D(x, y, z + 10), map);
                }
                else if (map.CanSpawnMobile(x + 1, y + 1, z))
                {
                    spawn.MoveToWorld(new Point3D(x + 1, y + 1, z), map);
                }
                else if (map.CanSpawnMobile(x + 1, y + 1, z + 10))
                {
                    spawn.MoveToWorld(new Point3D(x + 1, y + 1, z + 10), map);
                }
                else
                {
                    spawn.MoveToWorld(new Point3D(x - 1, y - 1, 100), map);
                }
            }
            spawn.PackItem(new TreasureMessageChest(Utility.RandomMinMax((((m_Level - 1) * 400) + 100), (((m_Level - 1) * 400) + 500))));
        }
开发者ID:greeduomacro,项目名称:annox,代码行数:56,代码来源:TreasureMessage.cs

示例7: Spawn

		protected void Spawn( Point3D p, Map map, BaseCreature spawn )
		{
			if ( map == null )
			{
				spawn.Delete();
				return;
			}

			int x = p.X, y = p.Y;

			for ( int j = 0; j < 20; ++j )
			{
				int tx = p.X - 2 + Utility.Random( 5 );
				int ty = p.Y - 2 + Utility.Random( 5 );

				Tile t = map.Tiles.GetLandTile( tx, ty );

				if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
				{
					x = tx;
					y = ty;
					break;
				}
			}

			spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:27,代码来源:FishingNet.cs

示例8: Summon

		public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
		{
			if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
			{
				caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
				creature.Delete();
				return false;
			}

			m_Summoning = true;

			if ( controlled )
				creature.SetControlMaster( caster );

			creature.RangeHome = 10;
			creature.Summoned = true;

			creature.SummonMaster = caster;

			Container pack = creature.Backpack;

			if ( pack != null )
			{
				for ( int i = pack.Items.Count - 1; i >= 0; --i )
				{
					if ( i >= pack.Items.Count )
						continue;

					pack.Items[i].Delete();
				}
			}

			#region Mondain's Legacy
			creature.SetHits((int)Math.Floor(creature.HitsMax * (1 + ArcaneEmpowermentSpell.GetSpellBonus(caster, false) / 100.0)));
			#endregion

			new UnsummonTimer( caster, creature, duration ).Start();
			creature.m_SummonEnd = DateTime.Now + duration;

			creature.MoveToWorld( p, caster.Map );

			Effects.PlaySound( p, creature.Map, sound );

			m_Summoning = false;

			return true;
		}
开发者ID:nydehi,项目名称:runuomondains,代码行数:47,代码来源:BaseCreature.cs

示例9: Summon

        public static void Summon( BaseCreature creature, Mobile caster, int sound, TimeSpan duration, bool scaleDuration, bool scaleStats )
        {
            Map map = caster.Map;

            if ( map == null )
                return;

            double scale = 1.0 + ( ( caster.Skills[SkillName.Magery].Value - 100.0 ) / 200.0 );

            if ( scaleDuration )
                duration = TimeSpan.FromSeconds( duration.TotalSeconds * scale );

            if ( scaleStats )
            {
                creature.RawStr = (int) ( creature.RawStr * scale );
                creature.Hits = creature.HitsMax;

                creature.RawDex = (int) ( creature.RawDex * scale );
                creature.Stam = creature.StamMax;

                creature.RawInt = (int) ( creature.RawInt * scale );
                creature.Mana = creature.ManaMax;
            }

            Point3D p = new Point3D( caster );

            if ( SpellHelper.FindValidSpawnLocation( map, ref p, true ) )
            {
                BaseCreature.Summon( creature, caster, p, sound, duration );
                return;
            }

            creature.Delete();
            caster.SendLocalizedMessage( 501942 ); // That location is blocked.
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:35,代码来源:SpellHelper.cs

示例10: SellPetForGold

	//RUFO beginfunction
	private void SellPetForGold(Mobile from, BaseCreature pet, int goldamount)
	{
               		Item gold = new Gold(goldamount);
               		pet.ControlTarget = null; 
               		pet.ControlOrder = OrderType.None; 
               		pet.Internalize(); 
               		pet.SetControlMaster( null ); 
               		pet.SummonMaster = null;
               		pet.Delete();
               		
               		Container backpack = from.Backpack;
               		if ( backpack == null || !backpack.TryDropItem( from, gold, false ) ) 
            		{ 
            			gold.MoveToWorld( from.Location, from.Map );           			
            		}

	}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:18,代码来源:SantaClaus.cs

示例11: Summon

        public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
        {
            if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
            {
                caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
                creature.Delete();
                return false;
            }

            m_Summoning = true;

            if ( controlled )
                creature.SetControlMaster( caster );

            creature.RangeHome = 10;
            creature.Summoned = true;

            creature.SummonMaster = caster;

            Container pack = creature.Backpack;

            if ( pack != null )
            {
                for ( int i = pack.Items.Count - 1; i >= 0; --i )
                {
                    if ( i >= pack.Items.Count )
                        continue;

                    pack.Items[i].Delete();
                }
            }

            new UnsummonTimer( caster, creature, duration ).Start();
            creature.m_SummonEnd = DateTime.Now + duration;

            creature.MoveToWorld( p, caster.Map );

            Effects.PlaySound( p, creature.Map, sound );

            if (creature is BladeSpirits)
            {
                new BSTimer(creature).Start();
                Effects.SendLocationParticles(EffectItem.Create(creature.Location, creature.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
            }

            m_Summoning = false;

            return true;
        }
开发者ID:Godkong,项目名称:Origins,代码行数:49,代码来源:BaseCreature.cs

示例12: SpawnMobile

        public void SpawnMobile(BaseCreature bc)
        {
            if(this.Map == null || bc == null)
            {
                if(bc != null)
                    bc.Delete();
                return;
            }

            int x = this.X;
            int y = this.Y;
            int z = this.Z;
            Point3D p = new Point3D(x, y, z);

            for(int i = 0; i < 25; i++)
            {
                x = Utility.RandomMinMax(this.X - 15, this.X + 15);
                y = Utility.RandomMinMax(this.Y - 15, this.Y + 15);
                z = this.Map.GetAverageZ(x, y);

                if (this.Map.CanSpawnMobile(x, y, z))
                {
                    p = new Point3D(x, y, z);
                    break;
                }
            }

            bc.MoveToWorld(p, this.Map);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:29,代码来源:CorgulTheSoulbinder.cs

示例13: Summon

        public static bool Summon( BaseCreature creature, bool controlled, Mobile caster, Point3D p, int sound, TimeSpan duration )
        {
            if ( caster.Followers + creature.ControlSlots > caster.FollowersMax )
            {
                caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
                creature.Delete();
                return false;
            }

            m_Summoning = true;

            if ( controlled )
                creature.SetControlMaster( caster );

            creature.RangeHome = 10;
            creature.Summoned = true;
            creature.SummonMaster = caster;

            #region Kaltar, OnSummon

            if (caster is Jogador)
            {
                SummonUtil.Instance.OnSummon((Jogador)caster, creature, ref p, ref duration);
            }

            #endregion

            #region DeletarItensDaMochila

            Container pack = creature.Backpack;

            if ( pack != null )
            {
                for ( int i = pack.Items.Count - 1; i >= 0; --i )
                {
                    if ( i >= pack.Items.Count )
                        continue;

                    pack.Items[i].Delete();
                }
            }

            #endregion

            #region Duracao do summon

            new UnsummonTimer( caster, creature, duration ).Start();
            creature.m_SummonEnd = DateTime.Now + duration;

            #endregion

            creature.MoveToWorld( p, caster.Map );
            Effects.PlaySound( p, creature.Map, sound );

            m_Summoning = false;

            return true;
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:58,代码来源:BaseCreature.cs


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