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


C# BaseCreature.MoveToWorld方法代码示例

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


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

示例1: SpawnAnt

		public void SpawnAnt( BaseCreature ant )
		{
			m_Spawned.Add( ant );

			Map map = Map;
			Point3D p = Location;

			for ( int i = 0; i < 5; i++ )
				if ( SpellHelper.FindValidSpawnLocation( map, ref p, false ) )
					break;

			ant.MoveToWorld( p, map );
			ant.Home = Location;
			ant.RangeHome = 10;
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:15,代码来源:SolenAntHole.cs

示例2: EndClaimList

        public void EndClaimList(Mobile from, BaseCreature pet)
        {
            if (pet == null || pet.Deleted || from.Map != this.Map || !from.InRange(this, 14) || !from.Stabled.Contains(pet) || !from.CheckAlive())
                return;

            if ((from.Followers + pet.ControlSlots) <= from.FollowersMax)
            {
                pet.SetControlMaster(from);

                if (pet.Summoned)
                    pet.SummonMaster = from;

                pet.ControlTarget = from;
                pet.ControlOrder = OrderType.Follow;

                pet.MoveToWorld(from.Location, from.Map);

                pet.IsStabled = false;
                from.Stabled.Remove(pet);

                from.SendLocalizedMessage(1042559); // Here you go... and good day to you!
            }
            else
            {
                from.SendLocalizedMessage(1049612, pet.Name); // ~1_NAME~ remained in the stables because you have too many followers.
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:27,代码来源:HitchingPost.cs

示例3: 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 );

			m_Summoning = false;

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

示例4: DoClaim

		private void DoClaim(Mobile from, BaseCreature pet)
		{
			pet.SetControlMaster(from);

			if (pet.Summoned)
			{
				pet.SummonMaster = from;
			}

			pet.ControlTarget = from;
			pet.ControlOrder = OrderType.Follow;

			pet.MoveToWorld(from.Location, from.Map);

			pet.IsStabled = false;

			pet.Loyalty = MaxLoyalty; // Wonderfully Happy
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:18,代码来源:AnimalTrainer.cs

示例5: 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:ITLongwell,项目名称:ServUO,代码行数:30,代码来源:SpecialFishingNet.cs

示例6: SpawnCreature

		protected bool SpawnCreature( BaseCreature creature )
		{
			for ( int i = 0; i < 5; i++ ) // Try 5 times
			{
				int x = Location.X + Utility.RandomMinMax( -1, 1 );
				int y = Location.Y + Utility.RandomMinMax( -1, 1 );
				int z = Map.GetAverageZ( x, y );

				if ( Map.CanSpawnMobile( x, y, Location.Z ) )
				{
					creature.MoveToWorld( new Point3D( x, y, Location.Z ), Map );
					creature.Combatant = From;
					return true;
				}
				else if ( Map.CanSpawnMobile( x, y, z ) )
				{
					creature.MoveToWorld( new Point3D( x, y, z ), Map );
					creature.Combatant = From;
					return true;
				}
			}

			return false;
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:24,代码来源:GreenThorns.cs

示例7: 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;

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

            if ( controlled )
                creature.SetControlMaster( caster );

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

            double hitsScalar = 1.0 + ( ArcaneEmpowermentSpell.GetSummonHitsBonus( caster ) / 100 );

            if ( hitsScalar != 1.0 )
                creature.SetHits( (int) ( creature.HitsMax * hitsScalar ) );

            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 EnergyVortex || creature is BladeSpirits )
                SpellHelper.CheckSummonLimits( creature );

            m_Summoning = false;

            return true;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:51,代码来源:BaseCreature.cs

示例8: Summon

        public static void Summon( Mobile caster, BaseCreature summoned, int duration, int sound, bool cooldown )
        {
            summoned.Controlled = true;
            summoned.ControlMaster = caster;
            Map map = caster.Map;
            bool validLocation = false;
            Point3D loc = caster.Location;

            for ( int j = 0; !validLocation && j < 10; ++j )
            {
                int x = caster.X + Utility.Random( 3 ) - 1;
                int y = caster.Y + Utility.Random( 3 ) - 1;
                int z = map.GetAverageZ( x, y );

                if ( validLocation = map.CanFit( x, y, caster.Z, 16, false, false ) )
                    loc = new Point3D( x, y, caster.Z );
                else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
                    loc = new Point3D( x, y, z );
            }

            summoned.MoveToWorld( loc, map );
            summoned.VanishTime = DateTime.Now + TimeSpan.FromHours( 1 );
            caster.PlaySound( sound );

            if( caster is PlayerMobile && cooldown )
                ((PlayerMobile)caster).NextSummoningAllowed = DateTime.Now + TimeSpan.FromMinutes( duration );

            else if( caster is BaseCreature )
                ((BaseCreature)caster).NextFeatUse = DateTime.Now + TimeSpan.FromMinutes( 1 );

            summoned.m_SummoningTimer = new SummoningTimer( summoned, duration );
            summoned.m_SummoningTimer.Start();
            summoned.Lives = -100;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:34,代码来源:BaseCustomSpell.cs

示例9: UnStablePet

        public static void UnStablePet(Mobile from, BaseCreature pet, Mobile gm)
        {
            if (from == null || from.Deleted || pet == null || pet.Deleted || gm == null || gm.Deleted)
            {
                return;
            }

            if (from.Stabled.Contains(pet))
            {
                gm.SendMessage("Warning: This is a force claiming. Followers count will not be checked!");

                pet.SetControlMaster(from);
                if (pet.Summoned)
                {
                    pet.SummonMaster = from;
                }

                pet.ControlTarget = from;
                pet.ControlOrder = OrderType.Follow;

                if (from.Map == Map.Internal)
                {
                    gm.MoveToWorld(from.Location, from.Map);
                }
                else
                {
                    pet.MoveToWorld(from.Location, from.Map);
                }

                pet.IsStabled = false;
                from.Stabled.Remove(pet);
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:33,代码来源:ShowFollowers.cs

示例10: Spawn

		protected static 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) ) && !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 AncientLich && 0.1 > Utility.RandomDouble() )
				spawn.PackItem( new MysticFishingNet() );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:30,代码来源:MysticFishingNet.cs

示例11: SpawnHelper

        public void SpawnHelper(BaseCreature helper, Point3D location)
        {
            if (helper == null)
                return;

            helper.Home = location;
            helper.RangeHome = 4;
		
            if (this.m_Altar != null)
                this.m_Altar.AddHelper(helper);
				
            helper.MoveToWorld(location, this.Map);			
        }
开发者ID:m309,项目名称:ForkUO,代码行数:13,代码来源:BasePeerless.cs

示例12: DoClaim

		private void DoClaim( Mobile from, BaseCreature pet )
		{
			pet.SetControlMaster( from );

			if ( pet.Summoned )
				pet.SummonMaster = from;

			pet.ControlTarget = from;
			pet.ControlOrder = OrderType.Follow;

			pet.MoveToWorld( from.Location, from.Map );

			pet.IsStabled = false;
			pet.StabledBy = null;
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:15,代码来源:AnimalTrainer.cs


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