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


C# Item.CheckBlessed方法代码示例

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


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

示例1: TryStealItem


//.........这里部分代码省略.........
                                this.m_Thief.SendLocalizedMessage(1010259); //	The sigil has gone home because your backpack is full
                            }
                            else
                            {
                                if (sig.IsBeingCorrupted)
                                    sig.GraceStart = DateTime.Now; // begin grace period

                                this.m_Thief.SendLocalizedMessage(1010586); // YOU STOLE THE SIGIL!!!   (woah, calm down now)

                                if (sig.LastMonolith != null && sig.LastMonolith.Sigil != null)
                                {
                                    sig.LastMonolith.Sigil = null;
                                    sig.LastStolen = DateTime.Now;
                                }

                                return sig;
                            }
                        }
                        else
                        {
                            this.m_Thief.SendLocalizedMessage(1005594); //	You do not have enough skill to steal the sigil
                        }
                    }
                    else
                    {
                        this.m_Thief.SendLocalizedMessage(1005588); //	You must join a faction to do that
                    }
                }
                #endregion
                else if (si == null && (toSteal.Parent == null || !toSteal.Movable) && !ItemFlags.GetStealable(toSteal))
                {
                    this.m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if ((toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root)) && !ItemFlags.GetStealable(toSteal))
                {
                    this.m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if (Core.AOS && si == null && toSteal is Container && !ItemFlags.GetStealable(toSteal))
                {
                    this.m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if (!this.m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                {
                    this.m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
                }
                else if (si != null && this.m_Thief.Skills[SkillName.Stealing].Value < 100.0)
                {
                    this.m_Thief.SendLocalizedMessage(1060025, "", 0x66D); // You're not skilled enough to attempt the theft of this item.
                }
                else if (toSteal.Parent is Mobile)
                {
                    this.m_Thief.SendLocalizedMessage(1005585); // You cannot steal items which are equiped.
                }
                else if (root == this.m_Thief)
                {
                    this.m_Thief.SendLocalizedMessage(502704); // You catch yourself red-handed.
                }
                else if (root is Mobile && ((Mobile)root).IsStaff())
                {
                    this.m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if (root is Mobile && !this.m_Thief.CanBeHarmful((Mobile)root))
                {
                }
                else if (root is Corpse)
                {
开发者ID:m309,项目名称:ForkUO,代码行数:67,代码来源:Stealing.cs

示例2: TryStealItem

        private static bool TryStealItem(Item toSteal, object root, Mobile m_Thief)
        {
            PlayerMobile pm = null;

            if (root is PlayerMobile)
                pm = (PlayerMobile)root;

            if (m_Thief.AccessLevel == AccessLevel.Counselor)
                m_Thief.SendAsciiMessage("Naughty counselor!");
            else if (m_Thief.AccessLevel > AccessLevel.Counselor)
                m_Thief.SendAsciiMessage("You don't need to steal anything, just take what you want!");
            else if (m_Thief is PlayerMobile && ((PlayerMobile)m_Thief).Young)
                m_Thief.SendAsciiMessage("You cannot steal anything as a young player.");
            else if (!IsEmptyHanded(m_Thief))
                m_Thief.SendLocalizedMessage(1005584); // Both hands must be free to steal.
            else if (root is BaseVendor && ((BaseVendor)root).IsInvulnerable)
                m_Thief.SendLocalizedMessage(1005598); // You can't steal from shopkeepers.
            else if (root is PlayerVendor)
                m_Thief.SendLocalizedMessage(502709); // You can't steal from vendors.
            else if (!m_Thief.CanSee(toSteal))
                m_Thief.SendLocalizedMessage(500237); // Target can not be seen.
            else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true))
                m_Thief.SendLocalizedMessage(1048147); // Your backpack can't hold anything else.
            //ARTEGORDONMOD
            // allow stealing of STEALABLE items on the ground or in containers
            else if ( (toSteal.Parent == null || !toSteal.Movable) && !ItemFlags.GetStealable(toSteal) )
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else if (toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root))
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else if (toSteal is Container)
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
            else if (toSteal.Parent is Mobile)
                m_Thief.SendLocalizedMessage(1005585); // You cannot steal items which are equiped.
            else if (root == m_Thief)
                m_Thief.SendLocalizedMessage(502704); // You catch yourself red-handed.
            else if (root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player)
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else if (root is Mobile && !m_Thief.CanBeHarmful((Mobile)root))
                m_Thief.SendAsciiMessage("Something prevents you to steal from that mobile");
            /*else if (root is Corpse)
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!*/
            else if (pm != null && !pm.Snoopers.Contains(m_Thief))
                m_Thief.SendAsciiMessage("You waited too long between snooping and stealing the item");
            else if (m_Thief.SolidHueOverride == 2535)
                m_Thief.SendAsciiMessage("You cannot steal while using the pitsrune");
            else if (toSteal.UnStealable)
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else
            {
                double w = toSteal.Weight + toSteal.TotalWeight;

                if (w > 15)
                {
                    m_Thief.SendMessage("That is too heavy to steal.");
                }
                else
                    return true;
            }

            return false;
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:63,代码来源:Stealing.cs

示例3: TryStealItem


//.........这里部分代码省略.........

												foreach (PlayerState member in members)
												{
													member.Mobile.SendMessage(
														sig.Corrupted.Definition.HueBroadcast,
														"The {0} have stolen the {1} sigil from your faction stronghold!",
														faction.Definition.FriendlyName,
														sig.Town.Definition.FriendlyName);
												}
											}
										}
										break;
								}

								return sig;
							}
						}
						else
						{
							m_Thief.SendLocalizedMessage(1005594); //	You do not have enough skill to steal the sigil
						}
					}
					else
					{
						m_Thief.SendLocalizedMessage(1005588); //	You must join a faction to do that
					}
				}
					#endregion

				else if (!stealflag && si == null && (toSteal.Parent == null || !toSteal.Movable))
				{
					m_Thief.SendLocalizedMessage(502710); // You can't steal that!
				}
				else if ((toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root)) &&
						 !(toSteal.RootParent is FillableContainer) && !stealflag)
				{
					m_Thief.SendLocalizedMessage(502710); // You can't steal that!
				}
				else if (toSteal is Spellbook)
				{
					m_Thief.SendLocalizedMessage(502710); // You can't steal that!
				}
				else if (toSteal.Nontransferable)
				{
					m_Thief.SendLocalizedMessage(502710); // You can't steal that!
				}
				else if (m_Thief.EraAOS && si == null && toSteal is Container)
				{
					m_Thief.SendLocalizedMessage(502710); // You can't steal that!
				}
				else if (toSteal is IEthicsItem && ((IEthicsItem)toSteal).EthicsItemState != null &&
						 !((IEthicsItem)toSteal).EthicsItemState.HasExpired)
				{
					m_Thief.SendLocalizedMessage(502710); // You can't steal that!
				}
				else if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
				{
					m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
				}
					// Alan: commented this out b/c there shouldn't be a required skill level to steal stealflag stuff
					//else if ( ( si != null && m_Thief.Skills[SkillName.Stealing].Value < 100.0 ) || ( stealflag ) && m_Thief.Skills[SkillName.Stealing].Value < 100.0 ) ) //&& m_Thief.Skills[SkillName.Stealing].Value < 90.0 ) )
					//	m_Thief.SendLocalizedMessage( 1060025, "", 0x66D ); // You're not skilled enough to attempt the theft of this item.
				else if (toSteal.Parent is Mobile)
				{
					m_Thief.SendLocalizedMessage(1005585); // You cannot steal items which are equipped.
				}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:67,代码来源:Stealing.cs

示例4: TryStealItem

            private Item TryStealItem( Item toSteal, ref bool caught )
            {
                Item stolen = null;

                object root = toSteal.RootParent;

                if( !IsEmptyHanded(m_Thief) )
                {
                    m_Thief.SendLocalizedMessage(1005584); // Both hands must be free to steal.
                }
                /*else if( Server.Multis.BaseHouse.FindHouseAt(m_Thief) != null )
                {
                    m_Thief.SendMessage("You can't steal here!");
                }
                else if( root is Mobile && ((Mobile)root).Player && IsInnocentTo(m_Thief, (Mobile)root) && !IsInGuild(m_Thief) )
                {
                    m_Thief.SendLocalizedMessage(1005596); // You must be in the thieves guild to steal from other players.
                }
                else if( SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild(m_Thief) && m_Thief.Kills > 0 )
                {
                    m_Thief.SendLocalizedMessage(502706); // You are currently suspended from the thieves guild.
                }*/
                else if( root is BaseVendor && ((BaseVendor)root).IsInvulnerable )
                {
                    m_Thief.SendLocalizedMessage(1005598); // You can't steal from shopkeepers.
                }
                else if( root is PlayerVendor )
                {
                    m_Thief.SendLocalizedMessage(502709); // You can't steal from vendors.
                }
                else if( !m_Thief.CanSee(toSteal) )
                {
                    m_Thief.SendLocalizedMessage(500237); // Target can not be seen.
                }
                else if( m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true) )
                {
                    m_Thief.SendLocalizedMessage(1048147); // Your backpack can't hold anything else.
                }
                else if( toSteal.Parent == null || !toSteal.Movable )
                {
                    m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if( toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root) )
                {
                    m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if( Core.AOS && toSteal is Container )
                {
                    m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if( !m_Thief.InRange(toSteal.GetWorldLocation(), 1) )
                {
                    m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
                }
                else if( toSteal.Parent is Mobile )
                {
                    m_Thief.SendLocalizedMessage(1005585); // You cannot steal items which are equiped.
                }
                else if( root == m_Thief )
                {
                    m_Thief.SendLocalizedMessage(502704); // You catch yourself red-handed.
                }
                else if( root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player )
                {
                    m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if( root is Mobile && !m_Thief.CanBeHarmful((Mobile)root) )
                {
                }
                else if( (root is Mobile && (((Mobile)root).Player || ((Mobile)root).Body.IsHuman)) &&
                    (toSteal is BaseArmor || toSteal is BaseWeapon) )
                {
                    m_Thief.SendLocalizedMessage(502710); //You can't steal that!
                }
                else
                {
                    double w = toSteal.Weight + toSteal.TotalWeight;

                    if( w > 15.0 )
                    {
                        m_Thief.SendMessage("That is too heavy to steal.");
                    }
                    else
                    {
                        if( toSteal.Stackable && toSteal.Amount > 1 )
                        {
                            //ARTEGORDON
                            // fix for zero-weight stackables
                            int maxAmount = toSteal.Amount;
                            if( toSteal.Weight > 0 )
                                maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight);

                            if( maxAmount < 1 )
                                maxAmount = 1;
                            else if( maxAmount > toSteal.Amount )
                                maxAmount = toSteal.Amount;

                            int amount = Utility.RandomMinMax(1, maxAmount);

                            if( amount >= toSteal.Amount )
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:Stealing.cs

示例5: TryStealItem

			private Item TryStealItem( Item toSteal, ref bool caught )
			{
				Item stolen = null;

				object root = toSteal.RootParent;

				if ( !IsEmptyHanded( m_Thief ) )
				{
					m_Thief.SendLocalizedMessage( 1005584 ); // Both hands must be free to steal.
				}
				else if ( root is Mobile && ((Mobile)root).Player && !IsInGuild( m_Thief ) )
				{
					m_Thief.SendLocalizedMessage( 1005596 ); // You must be in the thieves guild to steal from other players.
				}
				else if ( SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild( m_Thief ) && m_Thief.Kills > 0 )
				{
					m_Thief.SendLocalizedMessage( 502706 ); // You are currently suspended from the thieves guild.
				}
				else if ( root is BaseVendor && ((BaseVendor)root).IsInvulnerable )
				{
					m_Thief.SendLocalizedMessage( 1005598 ); // You can't steal from shopkeepers.
				}
				else if ( root is PlayerVendor )
				{
					m_Thief.SendLocalizedMessage( 502709 ); // You can't steal from vendors.
				}
				else if ( !m_Thief.CanSee( toSteal ) )
				{
					m_Thief.SendLocalizedMessage( 500237 ); // Target can not be seen.
				}
				else if ( m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold( m_Thief, toSteal, false, true ) )
				{
					m_Thief.SendLocalizedMessage( 1048147 ); // Your backpack can't hold anything else.
				}
				else if ( toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed( root ) )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else if ( !m_Thief.InRange( toSteal.GetWorldLocation(), 1 ) )
				{
					m_Thief.SendLocalizedMessage( 502703 ); // You must be standing next to an item to steal it.
				}
				else if ( toSteal.Parent is Mobile )
				{
					m_Thief.SendLocalizedMessage( 1005585 ); // You cannot steal items which are equiped.
				}
				else if ( root == m_Thief )
				{
					m_Thief.SendLocalizedMessage( 502704 ); // You catch yourself red-handed.
				}
				else if ( root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else if ( root is Mobile && !m_Thief.CanBeHarmful( (Mobile)root ) )
				{
				}
				else if ( root is Corpse )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else
				{
					double w = toSteal.Weight + toSteal.TotalWeight;

					if ( w > 10 )
					{
						m_Thief.SendMessage( "That is too heavy to steal." );
					}
					else
					{
						if ( toSteal.Stackable && toSteal.Amount > 1 )
						{
							int maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight);

							if ( maxAmount < 1 )
								maxAmount = 1;
							else if ( maxAmount > toSteal.Amount )
								maxAmount = toSteal.Amount;

							int amount = Utility.RandomMinMax( 1, maxAmount );

							if ( amount >= toSteal.Amount )
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * toSteal.Amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
									stolen = toSteal;
							}
							else
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
								{
									stolen = Mobile.LiftItemDupe( toSteal, toSteal.Amount - amount );

									if ( stolen == null )
//.........这里部分代码省略.........
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:101,代码来源:Stealing.cs


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