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


C# Item.InvalidateProperties方法代码示例

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


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

示例1: CheckItem

        private static void CheckItem( Item item, Map oldMap )
        {
            if ( item.Map == null || item.Map == Map.Internal )
                return;

            if ( !m_Timers.ContainsKey( item ) )
            {
                MoonbindTimer timer = new MoonbindTimer( item );
                timer.Start();

                m_Timers.Add( item, timer );
            }

            Mobile parent = item.Parent as Mobile;

            if ( parent != null )
            {
                bool sendMessage = oldMap != null && oldMap != Map.Internal && ( oldMap == Map.Felucca || item.Map == Map.Felucca );

                if ( sendMessage )
                {
                    if ( item.IsEphemeral() )
                        parent.SendLocalizedMessage( 1153088 ); // The power of the moon Felucca no longer strengthens your Faction gear.
                    else
                        parent.SendLocalizedMessage( 1153087 ); // The power of the moon Felucca strengthens your Faction gear.
                }
            }

            item.InvalidateProperties();
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:30,代码来源:Moonbind.cs

示例2: RemoveVendorItem

		private void RemoveVendorItem( Item item )
		{
			VendorItem vi = GetVendorItem( item );

			if ( vi != null )
			{
				vi.Invalidate();
				m_SellItems.Remove( item );

				foreach ( Item subItem in item.Items )
				{
					RemoveVendorItem( subItem );
				}

				item.InvalidateProperties();
			}
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:17,代码来源:PlayerVendor.cs

示例3: SetVendorItem

		private VendorItem SetVendorItem( Item item, int price, string description, DateTime created )
		{
			RemoveVendorItem( item );

			VendorItem vi = new VendorItem( item, price, description, created );
			m_SellItems[item] = vi;

			item.InvalidateProperties();

			return vi;
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:11,代码来源:PlayerVendor.cs

示例4: Remove

		public static void Remove( Mobile from, SetItem setID, Item item )
		{						
			if ( item is ISetItem )
			{
				ISetItem setItem = (ISetItem) item;
				
				if ( setItem.IsSetItem && setItem.SetID == setID )
				{				
					if ( setItem.LastEquipped )
					{
						if ( from != null )
							RemoveStatBonuses( from, item );
						
						setItem.SetSkillBonuses.Remove();					
					}
										
					int temp = item.Hue;
					item.Hue = setItem.SetHue;
					setItem.SetHue = temp;
					
					setItem.SetEquipped = false;
					setItem.LastEquipped = false;		
					item.InvalidateProperties();
				}
			}
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:26,代码来源:SetItem.cs

示例5: AddInfo

        private VendorItem AddInfo( Item item, Item target )
        {
            int defPrice = 999;
            VendorItem vi;

            if ( item is BaseBook || ( item is Container && item.Items.Count == 0 ) || item is KeyRing )
            {
                defPrice = 0;
            }
            else if ( target != null )
            {
                vi = (VendorItem)m_SellItems[target];

                if ( vi != null && vi.Price > 0 )
                    defPrice = 0;
            }

            vi = new VendorItem( item, defPrice, "" );
            m_SellItems[item] = vi;

            if ( defPrice == 0 )
            {
                for (int i=0;i<item.Items.Count;i++)
                    AddInfo( (Item)item.Items[i], null );
            }

            item.InvalidateProperties();

            return vi;
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:30,代码来源:PlayerVendor.cs

示例6: RemoveInfo

        public void RemoveInfo( Item item )
        {
            m_SellItems.Remove( item );
            for (int i=0;i<item.Items.Count;i++)
                RemoveInfo( (Item)item.Items[i] );

            item.InvalidateProperties();
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:8,代码来源:PlayerVendor.cs

示例7: ImbueItem


//.........这里部分代码省略.........
                                shield.Attributes[attr] = value;
                        }

                        if (prop is SAAbsorptionAttribute)
                            shield.AbsorptionAttributes[(SAAbsorptionAttribute)prop] = value;

                        if (prop is AosArmorAttribute)
                            shield.ArmorAttributes[(AosArmorAttribute)prop] = value;
                    }
                    else if (i is BaseHat)
                    {
                        BaseHat hat = i as BaseHat;

                        if (prop is AosAttribute)
                            hat.Attributes[(AosAttribute)prop] = value;

                        if (prop is SAAbsorptionAttribute)
                            hat.SAAbsorptionAttributes[(SAAbsorptionAttribute)prop] = value;

                        if (prop is AosElementAttribute)
                        {
                            AosElementAttribute attr = (AosElementAttribute)prop;

                            switch (attr)
                            {
                                case AosElementAttribute.Physical: hat.Resistances.Physical = value; hat.PhysImbuing = 0; break;
                                case AosElementAttribute.Fire: hat.Resistances.Fire = value; hat.FireImbuing = 0; break;
                                case AosElementAttribute.Cold: hat.Resistances.Cold = value; hat.ColdImbuing = 0; break;
                                case AosElementAttribute.Poison: hat.Resistances.Poison = value; hat.PoisonImbuing = 0; break;
                                case AosElementAttribute.Energy: hat.Resistances.Energy = value; hat.EnergyImbuing = 0; break;
                            }
                        }
                    }
                    else if (i is BaseJewel)
                    {
                        BaseJewel jewel = i as BaseJewel;

                        if (jewel.MaxHitPoints <= 0 && jewel.TimesImbued == 1)
                        {
                            jewel.MaxHitPoints = 255;
                            jewel.HitPoints = 255;
                        }

                        if (prop is AosAttribute)
                            jewel.Attributes[(AosAttribute)prop] = value;

                        if (prop is SAAbsorptionAttribute)
                            jewel.AbsorptionAttributes[(SAAbsorptionAttribute)prop] = value;

                        if (prop is AosElementAttribute)
                        {
                            AosElementAttribute attr = (AosElementAttribute)prop;

                            switch (attr)
                            {
                                case AosElementAttribute.Physical: jewel.Resistances.Physical = value; break;
                                case AosElementAttribute.Fire: jewel.Resistances.Fire = value; break;
                                case AosElementAttribute.Cold: jewel.Resistances.Cold = value; break;
                                case AosElementAttribute.Poison: jewel.Resistances.Poison = value; break;
                                case AosElementAttribute.Energy: jewel.Resistances.Energy = value; break;
                            }
                        }

                        if (prop is SkillName)
                        {
                            SkillName skill = (SkillName)prop;

                            //Removes skill bonus if jewel already exist
                            for (int j = 0; j < 5; j++)
                            {
                                if (jewel.SkillBonuses.GetSkill(j) == skill)
                                {
                                    jewel.SkillBonuses.SetBonus(j, 0.0);
                                    jewel.SkillBonuses.SetSkill(j, SkillName.Alchemy);
                                }
                            }

                            if (mod >= 151 && mod <= 155)
                                jewel.SkillBonuses.SetValues(0, skill, value);
                            else if (mod >= 156 && mod <= 160)
                                jewel.SkillBonuses.SetValues(1, skill, value);
                            else if (mod >= 161 && mod <= 166)
                                jewel.SkillBonuses.SetValues(2, skill, value);
                            else if (mod >= 167 && mod <= 173)
                                jewel.SkillBonuses.SetValues(3, skill, value);
                            else if (mod >= 174 && mod <= 180)
                                jewel.SkillBonuses.SetValues(4, skill, value);
                        }
                    }

                    i.InvalidateProperties();
                }
                // == FAILURE ==
                else
                {
                    from.SendLocalizedMessage(1079774); // Fail
                    from.PlaySound(0x5AC);
                }
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:101,代码来源:Imbuing.cs

示例8: CheckTrade

		public override bool CheckTrade( Mobile to, Item item, SecureTradeContainer cont, bool message, bool checkItems, int plusItems, int plusWeight )
		{
			int msgNum = 0;

			if ( cont == null )
			{
				if ( to.Holding != null )
					msgNum = 1062727; // You cannot trade with someone who is dragging something.
				else if ( this.HasTrade )
					msgNum = 1062781; // You are already trading with someone else!
				else if ( to.HasTrade )
					msgNum = 1062779; // That person is already involved in a trade
			}

			if ( msgNum == 0 )
			{
				if ( cont != null )
				{
					plusItems += cont.TotalItems;
					plusWeight += cont.TotalWeight;
				}

				if ( this.Backpack == null || !this.Backpack.CheckHold( this, item, false, checkItems, plusItems, plusWeight ) )
					msgNum = 1004040; // You would not be able to hold this if the trade failed.
				else if ( to.Backpack == null || !to.Backpack.CheckHold( to, item, false, checkItems, plusItems, plusWeight ) )
					msgNum = 1004039; // The recipient of this trade would not be able to carry this.
				else
					msgNum = CheckContentForTrade( item );
			}

			if ( msgNum != 0 )
			{
				if ( message )
					this.SendLocalizedMessage( msgNum );

				return false;
			}
//added
			item.InvalidateProperties();
//end
			return true;
		}
开发者ID:greeduomacro,项目名称:uodarktimes-1,代码行数:42,代码来源:PlayerMobile.cs

示例9: SetVendorItem

		public VendorItem SetVendorItem(Item item, int price, string description)
		{
			RemoveVendorItem(item);

			VendorItem vi = new VendorItem(item, price, description);
			m_SellItems[item] = vi;
			ProcessRestockCharge(RestockCharge.Record, vi);	// record this item for future restocking charges

			item.InvalidateProperties();

			return vi;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:12,代码来源:PlayerVendor.cs


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