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


C# Mobile.CriminalAction方法代码示例

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


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

示例1: OnProfanityDetected

        private static bool OnProfanityDetected( Mobile from, string speech )
        {
            switch ( Action )
            {
                case ProfanityAction.None:
                    return true;
                case ProfanityAction.Disallow:
                    return false;
                case ProfanityAction.Criminal:
                    from.Criminal = true;
                    return true;
                case ProfanityAction.CriminalAction:
                    from.CriminalAction( false );
                    return true;
                case ProfanityAction.Disconnect:
                    {
                        GameClient ns = from.Client;

                        if ( ns != null )
                            ns.Dispose();

                        return false;
                    }
                default:
                case ProfanityAction.Other: // TODO: Provide custom implementation if this is chosen
                    {
                        return true;
                    }
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:30,代码来源:ProfanityProtection.cs

示例2: Carve

        public void Carve( Mobile from, Item item )
        {
            Mobile dead = m_Owner;

            if ( m_Carved || dead == null )
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
            else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 )
            {
                new Blood( 0x122D ).MoveToWorld( Location, Map );

                new Torso().MoveToWorld( Location, Map );
                new LeftLeg().MoveToWorld( Location, Map );
                new LeftArm().MoveToWorld( Location, Map );
                new RightLeg().MoveToWorld( Location, Map );
                new RightArm().MoveToWorld( Location, Map );
                new Head( String.Format( "the head of {0}", dead.Name ) ).MoveToWorld( Location, Map );

                m_Carved = true;

                ProcessDelta();
                SendRemovePacket();
                ItemID = Utility.Random( 0xECA, 9 ); // bone graphic
                Hue = 0;
                ProcessDelta();

                if ( IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
            else if ( dead is BaseCreature )
            {
                ((BaseCreature)dead).OnCarve( from, this );
            }
            else
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:39,代码来源:Corpse.cs

示例3: Carve


//.........这里部分代码省略.........
                            ow.Maimings = 666; // Set Maimings to 666, so it doesn't re-maim them if they've PDed
                            dead.Kill();
                            new Blood().MoveToWorld( Location, Map );
                            new Blood().MoveToWorld( Location, Map );
                            new Blood().MoveToWorld( Location, Map );
                            new Torso().MoveToWorld( Location, Map );
                            new LeftLeg().MoveToWorld( Location, Map );
                            new LeftArm().MoveToWorld( Location, Map );
                            new RightLeg().MoveToWorld( Location, Map );
                            new RightArm().MoveToWorld( Location, Map );
                            new Head( dead.Name ).MoveToWorld( Location, Map );
                            m_Carved = true;
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random( 0xECA, 9 ); // bone graphic
                            Hue = 0;
                            ProcessDelta();
                        }
                }

                if (ow.Maimings < 666) //Do our check to make sure the dude aint dead already!
                {
                    //If maim count is below 2, or if the lucky dog passed his chance to DIE...

                    from.SendMessage( 32, "You inflict a grievous finishing wound upon " + dead.Name + "!" );
                    from.Emote( "*{0} inflicts a grievous wound upon {1}*",from.Name ,dead.Name );
                    UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1));
                    dead.SendMessage( 32, "You have been dealt a grievous finishing wound! Your wound count has increased by 1!" );

                    if (HealthAttachment.HasHealthAttachment(dead))
                    {
                        HealthAttachment.GetHA(dead).HCWound(from);
                    }

                    ow.Maimings += 1;
                    ow.HCWound = DateTime.Now;
                    new Blood().MoveToWorld( Location, Map );
                    new Blood().MoveToWorld( Location, Map );
                    new Blood().MoveToWorld( Location, Map );

                    //Blow through our checks to see if we should lower stats!
                    if (ow.RawHits > 25 && ow.Maimings + 1 > Utility.Random(10))
                        {
                        ow.RawHits -= Utility.RandomList(5,10);
                        dead.SendMessage( 32, "You have lost some hit points permenantly due to the wound you've sustained!" );
                        }
                    if (ow.RawStam > 25 && ow.Maimings + 1 > Utility.Random(10))
                        {
                        ow.RawStam -= Utility.RandomList(5,10);
                        dead.SendMessage( 32, "You have lost some stamina points permenantly due to the wound you've sustained!" );
                        }
                    if (ow.RawMana > 25 && ow.Maimings + 1 > Utility.Random(10))
                        {
                        ow.RawMana -= Utility.RandomList(5,10);
                        dead.SendMessage( 32, "You have lost some mana points permenantly due to the wound you've sustained!" );
                        }
                }
                }
            else
            from.SendMessage( "You are not capable of inflicting a wound on that target, as they have been dealt a finishing move within the past 24 hours." );
            }

            else if( this.Owner != null && this.Owner is PlayerMobile && ((PlayerMobile)this.Owner).Lives > -1 )
                from.SendMessage( "That person is not dead yet, so you cannot carve their body." );

            else if ( dead == null )
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
            else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 )
            {
                new Blood( 0x122D ).MoveToWorld( Location, Map );

                new Torso().MoveToWorld( Location, Map );
                new LeftLeg().MoveToWorld( Location, Map );
                new LeftArm().MoveToWorld( Location, Map );
                new RightLeg().MoveToWorld( Location, Map );
                new RightArm().MoveToWorld( Location, Map );
                new Head( dead.Name ).MoveToWorld( Location, Map );

                m_Carved = true;

                ProcessDelta();
                SendRemovePacket();
                ItemID = Utility.Random( 0xECA, 9 ); // bone graphic
                Hue = 0;
                ProcessDelta();

                if ( IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
            else if ( dead is BaseCreature )
            {
                ((BaseCreature)dead).OnCarve( from, this );
            }
            else
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:101,代码来源:Corpse.cs

示例4: FilterText

        public static string FilterText( Mobile m, string s )
        {
            try{

            string filter = "";
            string subOne = "";
            string subTwo = "";
            string subThree = "";
            int index = 0;

            for( int i = 0; i < ChatInfo.Filters.Count; ++i )
            {
                filter = ChatInfo.Filters[i].ToString();

                if ( filter == "" )
                {
                    ChatInfo.Filters.Remove( filter );
                    continue;
                }

                index = s.ToLower().IndexOf( filter );

                if ( index >= 0 )
                {
                    if ( m.AccessLevel == AccessLevel.Player )
                    {
                        if ( !ChatInfo.NoFilterPenalty )
                            m.SendMessage( ChatInfo.GetInfo( m ).SystemColor, "Filter violation detected: " + filter );

                        if ( ChatInfo.FilterBan )
                            ChatInfo.GetInfo( m ).Ban( ChatInfo.FilterBanLength );
                        else if ( ChatInfo.FilterKick )
                        {
                            m.Say( "I've been kicked!" );
                            if ( m.NetState != null ) m.NetState.Dispose();
                        }
                        else if ( ChatInfo.FilterCriminal )
                            m.CriminalAction( false );

                        if ( !ChatInfo.NoFilterPenalty )
                            return "";
                    }

                    subOne = s.Substring( 0, index );
                    subTwo = "";

                    for( int ii = 0; ii < filter.Length; ++ii )
                        subTwo+="*";

                    subThree = s.Substring( index+filter.Length, s.Length-filter.Length-index );

                    s = subOne + subTwo + subThree;

                    i--;
                }
            }

            }catch{ Errors.Report( String.Format( "Filter-> FilterText-> |{0}|", m ) ); }

            return s;
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:61,代码来源:Filter.cs

示例5: OnItemLifted

		public override void OnItemLifted( Mobile from, Item item )
		{
			base.OnItemLifted( from, item );

			if ( item != this && from != m_Owner )
				from.RevealingAction();

			if ( item != this && IsCriminalAction( from ) )
				from.CriminalAction( true );

			if ( !m_Looters.Contains( from ) )
				m_Looters.Add( from );

			if ( m_InstancedItems != null && m_InstancedItems.ContainsKey( item ) )
				m_InstancedItems.Remove( item );

            // Scriptiz : on log les loots !
            if (from != null && m_Owner != null && item != null && from.Player && m_Owner.Player)
            {
                string sItem = String.Format("{0} ({1})", item.GetType().Name, item.Serial);
                string sLooter = String.Format("{0} ({1})", from.Name, (from.Account != null ? from.Account.Username : "null"));
                string sLooted = String.Format("{0} ({1})", m_Owner.Name, (m_Owner.Account != null ? m_Owner.Account.Username : "null"));
                LogLoot(String.Format(DateTime.Now + ": {0} a été looté par {1} sur le corps de {2}", sItem, sLooter, sLooted));
            }
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:25,代码来源:Corpse.cs

示例6: OnCarve


//.........这里部分代码省略.........
                from.SendAsciiMessage( "You see nothing useful to carve from the corpse." );
            }
            else
            {
                if ( corpse.Map == Map.Felucca )
                {
                    feathers *= 2;
                    wool *= 2;
                    hides *= 2;
                }

                new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map );

                if ( feathers != 0 )
                {
                    corpse.DropItem( new Feather( feathers ) );
                    from.SendAsciiMessage( "You pluck the bird. The feathers are now on the corpse." );
                }

                if ( wool != 0 )
                {
                    corpse.DropItem( new Wool( wool ) );
                    from.SendAsciiMessage( "You shear it, and the wool is now on the corpse." );
                }

                if ( meat != 0 )
                {
                    if ( MeatType == MeatType.Ribs )
                        corpse.DropItem( new RawRibs( meat ) );
                    else if ( MeatType == MeatType.Bird )
                        corpse.DropItem( new RawBird( meat ) );
                    else if ( MeatType == MeatType.LambLeg )
                        corpse.DropItem( new RawLambLeg( meat ) );

                    from.SendAsciiMessage( "You carve some meat, which remains on the corpse." );
                }

                if ( lightfur != 0 )
                {
                    if ( LightFurType == LightFurType.LightFur )
                        corpse.DropItem( new LightFur( lightfur ) );

                    from.SendAsciiMessage ( "You skin it, and the fur is now on the corpse." );
                }

                if ( darkfur != 0 )
                {
                    if ( DarkFurType == DarkFurType.DarkFur )
                        corpse.DropItem( new DarkFur( darkfur ) );

                    from.SendAsciiMessage ( "You skin it, and the fur is now on the corpse." );
                }

                if ( hides != 0 )
                {
                    if ( HideType == HideType.Regular )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Spined )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Horned )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Barbed )
                        corpse.DropItem( new Hides( hides ) );

                    from.SendAsciiMessage( "You skin it, and the hides are now on the corpse." );
                }

                if ( scales != 0 )
                {
                    ScaleType sc = this.ScaleType;

                    switch ( sc )
                    {
                        case ScaleType.Red:		corpse.DropItem( new RedScales( scales ) ); break;
                        case ScaleType.Yellow:	corpse.DropItem( new YellowScales( scales ) ); break;
                        case ScaleType.Black:	corpse.DropItem( new BlackScales( scales ) ); break;
                        case ScaleType.Green:	corpse.DropItem( new GreenScales( scales ) ); break;
                        case ScaleType.White:	corpse.DropItem( new WhiteScales( scales ) ); break;
                        case ScaleType.Blue:	corpse.DropItem( new BlueScales( scales ) ); break;
                        case ScaleType.All:
                        {
                            corpse.DropItem( new RedScales( scales ) );
                            corpse.DropItem( new YellowScales( scales ) );
                            corpse.DropItem( new BlackScales( scales ) );
                            corpse.DropItem( new GreenScales( scales ) );
                            corpse.DropItem( new WhiteScales( scales ) );
                            corpse.DropItem( new BlueScales( scales ) );
                            break;
                        }
                    }

                    from.SendAsciiMessage( "You cut away some scales, but they remain on the corpse." );
                }

                corpse.Carved = true;

                if ( corpse.IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:101,代码来源:BaseCreature.cs

示例7: OnItemUsed

        public override void OnItemUsed( Mobile from, Item item )
        {
            base.OnItemUsed( from, item );

            if ( item is Food )
                from.RevealingAction();

            if ( item != this && IsCriminalAction( from ) )
                from.CriminalAction( true );

            if ( !m_Looters.Contains( from ) )
                m_Looters.Add( from );

            if ( m_InstancedItems != null && m_InstancedItems.ContainsKey( item ) )
                m_InstancedItems.Remove( item );
        }
开发者ID:Leodinas,项目名称:uolite,代码行数:16,代码来源:Corpse.cs

示例8: CheckLoot

		private bool CheckLoot( Mobile m, bool criminalAction )
		{
			if ( m_Temporary )
				return false;

			if ( m.AccessLevel >= AccessLevel.GameMaster || m_Owner == null || m == m_Owner )
				return true;

			Party p = Party.Get( m_Owner );

			if ( p != null && p.Contains( m ) )
				return true;

			Map map = this.Map;

			if ( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
			{
				if ( criminalAction )
					m.CriminalAction( true );
				else
					m.SendLocalizedMessage( 1010630 ); // Taking someone else's treasure is a criminal offense!

				return true;
			}

			m.SendLocalizedMessage( 1010631 ); // You did not discover this chest!
			return false;
		}
开发者ID:suiy187,项目名称:runuocustom,代码行数:28,代码来源:TreasureMapChest.cs

示例9: OnLoot

        public virtual void OnLoot(Mobile from) 
        {
            Item m_Loot;
            string m_Collected = "";

            DefragLooters();
            if (!FindLooter(from))
            {
                // always one
                m_Loot = Loot.Construct(m_TrashCommonTypes);
                from.AddToBackpack(m_Loot); 
                m_Collected = "You have recovered " + GetName(m_Loot);

                if (Utility.RandomBool())// maybe two
                {
                    m_Loot = Loot.Construct(m_TrashCommonTypes);
                    from.AddToBackpack(m_Loot);
                    m_Collected = m_Collected + ", " + GetName(m_Loot);
                }

                if (m_ItemChance > Utility.RandomDouble())// plus chance for a random item
                {
                    m_Loot = Loot.Construct(m_TrashItemTypes);
                    from.AddToBackpack(m_Loot);
                    m_Collected = m_Collected + ", " + GetName(m_Loot);
                }

                if (m_RareChance > Utility.RandomDouble())// plus chance for a random prize
                {
                    m_Loot = Loot.Construct(m_TrashRareTypes);
                    from.AddToBackpack(m_Loot);
                    m_Collected = m_Collected + ", and " + GetName(m_Loot) + "!";
                }

                if (m_Sound > 0)
                    Effects.PlaySound(from.Location, from.Map, m_Sound);

                from.SendMessage(m_Collected);

                Looters.Add(new TrashLooter(from));
                m_usesCount++;

                if (m_MaxUses > 0 && m_usesCount >= m_MaxUses)
                {
                    from.SendMessage("You have recovered the last useable item!");
                    this.Delete();
                }

                if (m_MakesCriminal)
                {
                    from.CriminalAction(false);
                    from.SendLocalizedMessage(1010630); // Taking someone else's treasure is a criminal offense!
                }
            }
            else
                from.SendMessage("You find nothing of value at this time.");
        }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:57,代码来源:TrashPiles.cs

示例10: Carve

        public void Carve( Mobile from, Item item )
        {
            if ( IsCriminalAction( from ) && this.Map != null && ( this.Map.Rules & MapRules.HarmfulRestrictions ) != 0 || ( Instanced && GetInstancedCorpse( from ) == null ) )
            {
                // You may not dismember that corpse as you do not have rights to it.
                from.SendLocalizedMessage( 1005016 );

                return;
            }

            Mobile dead = m_Owner;

            if ( GetFlag( CorpseFlag.Carved ) || dead == null )
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
            else if ( dead is TyballShadow )
            {
                // You may not dismember that corpse as you do not have rights to it.
                from.SendLocalizedMessage( 1005016 );
            }
            else if ( ( (Body) Amount ).IsHuman && ItemID == 0x2006 )
            {
                new Blood( 0x122D ).MoveToWorld( Location, Map );

                new Torso().MoveToWorld( Location, Map );
                new LeftLeg().MoveToWorld( Location, Map );
                new LeftArm().MoveToWorld( Location, Map );
                new RightLeg().MoveToWorld( Location, Map );
                new RightArm().MoveToWorld( Location, Map );
                new Head( String.Format( "the head of {0}", dead.Name ) ).MoveToWorld( Location, Map );

                SetFlag( CorpseFlag.Carved, true );

                ProcessDelta();
                SendRemovePacket();
                ItemID = Utility.Random( 0xECA, 9 ); // bone graphic
                Hue = 0;
                Direction = Direction.North;
                ProcessDelta();

                if ( IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
            else if ( dead is BaseCreature )
                ( (BaseCreature) dead ).OnCarve( from, this, item is ButchersWarCleaver );
            else
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:49,代码来源:Corpse.cs

示例11: OnCarve

		public virtual void OnCarve( Mobile from, Corpse corpse )
		{
			int feathers = Feathers;
			int wool = Wool;
			int meat = Meat;
			int hides = Hides;
			int scales = Scales;

			if ( (feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned || IsBonded )
			{
				from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
			}
			else
			{
				//	6/8/2004 - Pulse
				//		No longer doubles the resources from corpses if in Felucca, to re-add double resources
				//		un-comment the 6 lines of code below.
				//				if ( corpse.Map == Map.Felucca )
				//				{
				//					feathers *= 2;
				//					wool *= 2;
				//					hides *= 2;
				//				}

				new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map );

				if ( feathers != 0 )
				{
					corpse.DropItem( new Feather( feathers ) );
					from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse.
				}

				if ( wool != 0 )
				{
					corpse.DropItem( new Wool( wool ) );
					from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse.
				}

				if ( meat != 0 )
				{
					if ( MeatType == MeatType.Ribs )
						corpse.DropItem( new RawRibs( meat ) );
					else if ( MeatType == MeatType.Bird )
						corpse.DropItem( new RawBird( meat ) );
					else if ( MeatType == MeatType.LambLeg )
						corpse.DropItem( new RawLambLeg( meat ) );

					from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse.
				}

				if ( hides != 0 )
				{
					if ( HideType == HideType.Regular )
						corpse.DropItem( new Hides( hides ) );
					else if ( HideType == HideType.Spined )
						corpse.DropItem( new SpinedHides( hides ) );
					else if ( HideType == HideType.Horned )
						corpse.DropItem( new HornedHides( hides ) );
					else if ( HideType == HideType.Barbed )
						corpse.DropItem( new BarbedHides( hides ) );

					from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
				}

				if ( scales != 0 )
				{
					ScaleType sc = this.ScaleType;

					switch ( sc )
					{
						case ScaleType.Red:		corpse.DropItem( new RedScales( scales ) ); break;
						case ScaleType.Yellow:	corpse.DropItem( new YellowScales( scales ) ); break;
						case ScaleType.Black:	corpse.DropItem( new BlackScales( scales ) ); break;
						case ScaleType.Green:	corpse.DropItem( new GreenScales( scales ) ); break;
						case ScaleType.White:	corpse.DropItem( new WhiteScales( scales ) ); break;
						case ScaleType.Blue:	corpse.DropItem( new BlueScales( scales ) ); break;
						case ScaleType.All:
						{
							corpse.DropItem( new RedScales( scales ) );
							corpse.DropItem( new YellowScales( scales ) );
							corpse.DropItem( new BlackScales( scales ) );
							corpse.DropItem( new GreenScales( scales ) );
							corpse.DropItem( new WhiteScales( scales ) );
							corpse.DropItem( new BlueScales( scales ) );
							break;
						}
					}

					from.SendMessage( "You cut away some scales, but they remain on the corpse." );
				}

				corpse.Carved = true;

				if ( corpse.IsCriminalAction( from ) )
					from.CriminalAction( true );
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:97,代码来源:BaseCreature.cs

示例12: ExecuteCriminalAction

 private void ExecuteCriminalAction( Mobile state )
 {
     if ( state != null && !state.Deleted )
         state.CriminalAction( true );
 }
开发者ID:greeduomacro,项目名称:divinity,代码行数:5,代码来源:Corpse.cs

示例13: OnLoot

		public virtual void OnLoot(Mobile from)
		{
			Item m_Loot;
			string m_Collected = "You have recovered ";

			DefragLooters();
			if (!FindLooter(from))
			{
				List<Item> loots = new List<Item>();

				bool rare = false;

				// improved chance of finding good loot based on certian skills
				// Calculated out of 200%
				double useskills = (from.Skills.Begging.Value + from.Skills.ItemID.Value) / 5000;

				// always one
				m_Loot = Loot.Construct( m_TrashCommonTypes );
				m_Loot.Movable = true;
				from.AddToBackpack(m_Loot);
				loots.Add( m_Loot );

				if ( Utility.RandomBool() ) // maybe two
				{
					m_Loot = Loot.Construct(m_TrashCommonTypes);
					m_Loot.Movable = true;
					from.AddToBackpack(m_Loot);
					loots.Add( m_Loot );
				}

				if ( ( m_ItemChance + ( useskills * 2 ) ) > Utility.RandomDouble() )// plus chance for a random item
				{
					m_Loot = Loot.Construct(m_TrashItemTypes);
					m_Loot.Movable = true;
					from.AddToBackpack(m_Loot);
					loots.Add( m_Loot );
				}
				else if ( m_RareChance + useskills > Utility.RandomDouble() )// plus chance for a random prize
				{
					m_Loot = Loot.Construct(m_TrashRareTypes);
					m_Loot.Movable = true;
					from.AddToBackpack(m_Loot);
					loots.Add( m_Loot );
					rare = true;
				}
				else if ( ( m_RareChance + useskills ) / 100.0 > Utility.RandomDouble() )
				{
					m_Loot = Loot.Construct(m_TrashVeryRareTypes);
					m_Loot.Movable = true;
					from.AddToBackpack(m_Loot);
					loots.Add( m_Loot );
					rare = true;
				}

				if ( m_Sound > 0 )
					Effects.PlaySound(from.Location, from.Map, m_Sound);

				for ( int i = 0;i < loots.Count; i++ )
				{
					if ( i == 0 ) //First
						m_Collected += GetName( loots[i] );
					else if ( i == loots.Count-1 ) //Last
					{
						m_Collected += String.Format( ", and {0}{1}", GetName( loots[i] ), rare ? "!" : "." );

					}
					else
						m_Collected += String.Format( ", {0}", GetName( loots[i] ) );
				}

				from.SendMessage(m_Collected);

				Looters.Add(new TrashLooter(from));
				m_usesCount++;

				if (m_MaxUses > 0 && m_usesCount >= m_MaxUses)
				{
					from.SendMessage("You have recovered the last useable item!");
					this.Delete();
				}

				if (m_MakesCriminal)
				{
					from.CriminalAction(false);
					from.SendLocalizedMessage(1010630); // Taking someone else's treasure is a criminal offense!
				}
			}
			else
				from.SendMessage("You find nothing of value at this time.");
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:90,代码来源:TrashPiles.cs

示例14: OnCarve

        public virtual void OnCarve( Mobile from, Corpse corpse )
        {
            int feathers = Feathers;
            int wool = Wool;
            int meat = Meat;
            int hides = Hides;
            int scales = 0;//Scales;
            int furs = GenerateFurs( corpse );

            if ( (feathers == 0 && furs == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned )
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
            else
            {
                new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map );

                if ( feathers != 0 )
                {
                    corpse.DropItem( new Feather( feathers ) );
                    //from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse.
                }

                if ( wool != 0 )
                {
                    corpse.DropItem( new Wool( wool ) );
                    //from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse.
                }

                if ( meat != 0 )
                {
                    if ( MeatType == MeatType.Ribs )
                        corpse.DropItem( new RawRibs( meat ) );
                    else if ( MeatType == MeatType.Bird )
                        corpse.DropItem( new RawBird( meat ) );
                    else if ( MeatType == MeatType.LambLeg )
                        corpse.DropItem( new RawLambLeg( meat ) );

                    //from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse.
                }

                if ( hides != 0 )
                {
                    if ( HideType == HideType.Regular )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Spined )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Horned )
                        corpse.DropItem( new Hides( hides ) );
                    else if ( HideType == HideType.Barbed )
                        corpse.DropItem( new Hides( hides ) );
                }

                //if ( hides != 0 || furs != 0 )
                //	from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.

                corpse.Carved = true;

                if ( corpse.IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:62,代码来源:BaseCreature.cs

示例15: CanUseTrap

        private bool CanUseTrap(Mobile from)
        {
            if (m_Owner == null || RootParent != null)
                return false;

            if (!from.InRange(this.Location, 6))
            {
                from.SendLocalizedMessage(500295); //You are too far away to do that.
                return false;
            }

            //is owner, or in same guild
            if (m_Owner == from || (from.Guild != null && from.Guild == m_Owner.Guild))
                return true;

            //partied
            if (Party.Get(from) == Party.Get(m_Owner))
                return true;

            //fel rules
            if (from.Map != null && from.Map.Rules == MapRules.FeluccaRules)
            {
                from.CriminalAction(true);
                from.SendLocalizedMessage(1149823); //The owner of the lobster trap notices you committing a criminal act!

                if (m_Owner != null)
                    m_Owner.SendMessage("You notice {0} taking your lobster trap out of the water!", from.Name);

                return true;
            }

            from.SendLocalizedMessage(1116391); //You realize that the trap isn't yours so you leave it alone.
            return false;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:34,代码来源:LobsterTrap.cs


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