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


C# BaseCreature.SetControlMaster方法代码示例

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


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

示例1: MiniaturePet

 public MiniaturePet( int itemid, BaseCreature creature, Mobile owner )
     : base(itemid)
 {
     m_Creature = creature;
     creature.IsStabled = true;
     creature.ControlTarget = null;
     creature.ControlOrder = OrderType.Stay;
     creature.StabledOwner = owner;
     creature.Internalize();
     creature.SetControlMaster( null );
     creature.SummonMaster = null;
     creature.Loyalty = BaseCreature.MaxLoyalty;
     Weight = 10;
     Name = creature.Name;
     Movable = false;
 }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:16,代码来源:MiniaturePet.cs

示例2: MobileStatuette

		/// <summary>
		/// Creates a new MobileStatuette object - for internal use only
		/// </summary>
		private MobileStatuette( BaseCreature creature )
		{
			m_Creature = creature;
			ItemID = ShrinkTable.Lookup( m_Creature );
			Hue = m_Creature.Hue;

			m_Creature.ControlTarget = null;
			m_Creature.ControlOrder = OrderType.Stay;
			m_Creature.Internalize();
			m_Creature.SetControlMaster( null );
			m_Creature.SummonMaster = null;
			m_Creature.IsStabled = true;

			// Set the type of the creature as the name for this item
			Name = InsertSpaces( creature.GetType().Name );
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:19,代码来源:MobileStatuette.cs

示例3: MobileStatuette

		/// <summary>
		/// Creates a new MobileStatuette object - for internal use only
		/// </summary>
		private MobileStatuette( BaseCreature creature )
		{
			m_Creature = creature;
			ItemID = ShrinkTable.Lookup( m_Creature );
			Hue = m_Creature.Hue;

			m_Creature.ControlTarget = null;
			m_Creature.ControlOrder = OrderType.Stay;
			m_Creature.Internalize();
			m_Creature.SetControlMaster( null );
			m_Creature.SummonMaster = null;
			m_Creature.IsStabled = true;

			// Set the type of the creature as the name for this item
			Name = Xanthos.Utilities.Misc.GetFriendlyClassName( creature.GetType().Name );
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:19,代码来源:MobileStatuette.cs

示例4: EndStable

        public void EndStable( Mobile from, BaseCreature pet )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

            if ( !pet.Controlled || pet.ControlMaster != from )
            {
                SayTo( from, 1042562 ); // You do not own that pet!
            }
            else if ( pet.IsDeadPet )
            {
                SayTo( from, 1049668 ); // Living pets only, please.
            }
            else if ( pet.Summoned || pet.VanishTime != DateTime.MinValue )
            {
                SayTo( from, 502673 ); // I can not stable summoned creatures.
            }
            else if ( pet.Body.IsHuman )
            {
                SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
            }
            else if ( ( pet is WorkHorse || pet is GiantScarab) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
            {
                SayTo( from, 1042563 ); // You need to unload your pet.
            }
            else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
            {
                SayTo( from, 1042564 ); // I'm sorry.  Your pet seems to be busy.
            }
            else
            {
                Container bank = from.BankBox;

                if ( bank != null && bank.ConsumeTotal( typeof( Copper ), 1 ) )
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder = OrderType.Stay;
                    pet.StabledOwner = from;
                    pet.Internalize();
                    pet.SetControlMaster( null );
                    pet.SummonMaster = null;
                    pet.IsStabled = true;
                    pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy
                    this.Stabled.Add( pet );
                    SayTo( from, "Thy pet has been stabled. I will charge you one copper piece every six hours [OOC: two real-life hours]." );
                    SayTo( from, "Here is your ticket. Hand it back to me when you wish to get your animal back, or say just tell me you wish to claim your pets." );
                    StableTicket ticket = new StableTicket();
                    ticket.StabledPet = pet;
                    pet.StableTicket = ticket;

                    if( from.Backpack != null )
                        from.AddToBackpack( ticket );
                }
                else
                {
                    SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
                }
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:59,代码来源:AnimalTrainer.cs

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

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

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

示例7: EndStable

		public void EndStable( Mobile from, BaseCreature pet )
		{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( pet.Body.IsHuman )
			{
				SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
			}
			else if ( !pet.Controlled )
			{
				SayTo( from, 1048053 ); // You can't stable that!
			}
			else if ( pet.ControlMaster != from )
			{
				SayTo( from, 1042562 ); // You do not own that pet!
			}
			else if ( pet.IsDeadPet )
			{
				SayTo( from, 1049668 ); // Living pets only, please.
			}
			else if ( pet.Summoned )
			{
				SayTo( from, 502673 ); // I can not stable summoned creatures.
			}
            /*
			else if ( pet.Allured )
			{
				SayTo( from, 1048053 ); // You can't stable that!
			}
*/
			else if ( (pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
			{
				SayTo( from, 1042563 ); // You need to unload your pet.
			}
			else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
			{
				SayTo( from, 1042564 ); // I'm sorry.  Your pet seems to be busy.
			}
			else if ( from.Stabled.Count >= GetMaxStabled( from ) )
			{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
			}
			else
			{
				Container bank = from.FindBankNoCreate();

				if ( ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( Gold ), 30 ) ) || ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) ) )
				{
					pet.ControlTarget = null;
					pet.ControlOrder = OrderType.Stay;
					pet.Internalize();

					pet.SetControlMaster( null );
					pet.SummonMaster = null;

					pet.IsStabled = true;
                    pet.StabledBy = from;

					if ( Core.SE )	
						pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy

					from.Stabled.Add( pet );

					SayTo( from, Core.AOS ? 1049677 : 502679 ); // [AOS: Your pet has been stabled.] Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
				}
				else
				{
					SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
				}
			}
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:72,代码来源:AnimalTrainer.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;

            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

示例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);
				//break;
			}
        }
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:30,代码来源:Followers.cs

示例10: SendAway

        private static void SendAway( BaseCreature b )
        {
            b.Controlled = true;	//To make it so It won't still be a part of a spawner.
            b.SetControlMaster( null );
            b.SummonMaster = null;
            b.Internalize();

            if ( ShrinkConfig.ResetBondingStatus )
                b.IsBonded = false;

            if( !ShrinkConfig.RetainBondingTimer )
                b.BondingBegin = DateTime.MinValue;

            b.OwnerAbandonTime = DateTime.MinValue;

            b.IsStabled = true;
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:17,代码来源:Shrink.cs

示例11: EndStable

        public void EndStable( Mobile from, BaseCreature pet )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

            int maxStabled = GetMaxStabled( from );
            int newCount = GetNumStabled( from ) + GetStableSlotsFor( from, pet );

            if ( !pet.Controled || pet.ControlMaster != from )
            {
                SayTo( from, 1042562 ); // You do not own that pet!
            }
            else if ( pet.IsDeadPet )
            {
                SayTo( from, 1049668 ); // Living pets only, please.
            }
            else if ( pet.Summoned )
            {
                SayTo( from, 502673 ); // I can not stable summoned creatures.
            }
            else if ( pet.Body.IsHuman )
            {
                SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
            }
            else if ( (pet is PackLlama || pet is PackHorse) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
            {
                SayTo( from, 1042563 ); // You need to unload your pet.
            }
            else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
            {
                SayTo( from, 1042564 ); // I'm sorry.  Your pet seems to be busy.
            }
            else if ( newCount > maxStabled )
            {
                //SayTo( from, 1042565 ); // You have too many pets in the stables!
                SayTo( from, "There is not enough room in the stable for that!  Claim some of your other animals first." );
            }
            else
            {
                Container bank = from.BankBox;

                if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) )
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster( null );
                    pet.SummonMaster = null;

                    pet.IsStabled = true;
                    from.Stabled.Add( pet );

                    SayTo( from, 502679 ); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
                }
                else
                {
                    SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
                }
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:61,代码来源:AnimalTrainer.cs

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

            pet.SetControlMaster( from );

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

            if ( pet.AIObject != null )
                pet.AIObject.NumCommands = 0;
            pet.ControlTarget = from;
            pet.ControlOrder = OrderType.Follow;

            pet.Location = from.Location;
            pet.Map = from.Map;

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

            SayTo( from, 1042559 ); // Here you go... and good day to you!
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:23,代码来源:AnimalTrainer.cs

示例13: Target

        public void Target( BaseCreature bc )
        {
            if ( !Caster.CanSee( bc ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            if ( !Caster.InRange( bc, 6 ) )
            {
                Caster.SendLocalizedMessage( 500643 ); // Target is too far away.
            }
            else if ( !Caster.CanBeHarmful( bc ) || !bc.CanBeDamaged() )
            {
                Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
            }
            else if ( bc.Controlled || bc.Name == null )
            {
                Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
            }
            else if ( bc is BaseChampion || bc.IsParagon || bc is Medusa || bc is Lurg || !SlayerGroup.GetEntryByName( SlayerName.Repond ).Slays( bc ) )
            {
                Caster.SendLocalizedMessage( 1074379 ); // You cannot charm that!
            }
            else if ( CheckSequence() )
            {
                double chance = Caster.Skills[SkillName.Spellweaving].Fixed / 1000;

                chance += ( SpellweavingSpell.GetFocusLevel( Caster ) * 2 ) / 100;

                if ( chance > Utility.RandomDouble() )
                {
                    SpellHelper.Turn( Caster, bc );

                    bc.ControlSlots = 3;

                    bc.ActiveSpeed = 2;
                    bc.PassiveSpeed = 2;

                    bc.Owners.Add( Caster );

                    bc.SetControlMaster( Caster );

                    bc.IsBonded = false;

                    Caster.SendLocalizedMessage( 1072527 ); // You allure the humanoid to follow and protect you.

                    Caster.PlaySound( 0x5C4 );
                }
                else
                {
                    bc.Combatant = Caster;

                    Caster.SendLocalizedMessage( 1072528 ); // The humanoid becomes enraged by your charming attempt and attacks you.

                    Caster.PlaySound( 0x5C5 );
                }
            }

            FinishSequence();
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:59,代码来源:DryadAllure.cs

示例14: EndClaimList

        public void EndClaimList(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive() || !m_Stored.ContainsKey(from))
                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;

                if (m_Stored[from].Contains(pet))
                    m_Stored[from].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,代码行数:29,代码来源:ChickenCoop.cs

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


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