Наследование: MonoBehaviour
Пример #1
2
			public ResurrectEntry( Mobile mobile, Item item ) : base( 6195, ResurrectRange )
			{
				m_Mobile = mobile;
				m_Item = item;

				Enabled = !m_Mobile.Alive;
			}
Пример #2
1
        public Dueller()
            : base("The DuelMaster")
        {
            InitStats(100, 100, 25);

            Hue = Utility.RandomSkinHue();

            Female = false;
            Direction = Direction.Down;
            Body = 0x190;
            Name = NameList.RandomName("male");
            Title = "The DuelMaster";

            AddItem(new Tunic(0x48D));
            AddItem(new LongPants(0x48D));
            AddItem(new SkullCap(0x48D));
            AddItem(new Boots());

            Item hair = new Item(Utility.RandomList(0x203B, 0x203C, 0x203D, 0x2044, 0x2045, 0x2047, 0x2049, 0x204A));
            hair.Hue = Utility.RandomHairHue();
            hair.Layer = Layer.Hair;
            hair.Movable = false;
            AddItem(hair);

            Locations = new Point3D[10];
            DuelSystem.Duellers.Add(this);
        }
Пример #3
1
		/// <summary>
		/// Starts a new session and calls Gift.
		/// </summary>
		/// <param name="target"></param>
		/// <param name="creature"></param>
		/// <param name="gift"></param>
		public void StartGift(NPC target, Creature creature, Item gift)
		{
			if (!this.Start(target, creature))
				return;

			this.Script.GiftAsync(gift);
		}
Пример #4
1
		public Fuma() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "Fuma";
			Body = 400;

			Female = false;

			SetStr( 536, 585 );
			SetDex( 126, 145 );
			SetInt( 281, 305 );

			SetHits( 322, 351 );

			SetDamage( 13, 16 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 35, 45 );
			SetResistance( ResistanceType.Fire, 30, 40 );
			SetResistance( ResistanceType.Cold, 25, 35 );
			SetResistance( ResistanceType.Poison, 30, 40 );
			SetResistance( ResistanceType.Energy, 30, 40 );

			SetSkill( SkillName.EvalInt, 85.1, 100.0 );
			SetSkill( SkillName.Magery, 85.1, 100.0 );
			SetSkill( SkillName.MagicResist, 80.2, 110.0 );
			SetSkill( SkillName.Tactics, 60.1, 80.0 );
			SetSkill( SkillName.Wrestling, 40.1, 50.0 );

			Fame = 15000;
			Karma = -15000;

			VirtualArmor = 40;
			
			Item hair = new Item( Utility.RandomList( 0x203B, 0x2049, 0x2048, 0x204A ) );
			hair.Hue = Utility.RandomHairHue();
			hair.Layer = Layer.Hair;
			hair.Movable = false;
			AddItem( hair );
			
			NinjaTabi ninjatabi = new NinjaTabi();
			ninjatabi.Hue = 0x1;
			AddItem( ninjatabi );

			LeatherNinjaPants ninjapants = new LeatherNinjaPants();
			ninjapants.Hue = 1;
			AddItem(ninjapants);
			
			LeatherNinjaJacket ninjajacket = new LeatherNinjaJacket();
			ninjajacket.Hue = 1;
			AddItem(ninjajacket);
			
			LeatherJingasa jingasa = new LeatherJingasa();
			jingasa.Hue = 1;
			AddItem(jingasa);	

	

			
		}
Пример #5
1
        public static void LoadRepositoryXml(string filePath, ContentManager content)
        {
            XmlDocument document = new XmlDocument();
            document.Load(filePath);

            foreach (XmlNode itemNode in document.SelectNodes("ItemRepository/Item"))
            {
                Item item = new Item();
                item.Name = XmlExtensions.GetAttributeValue(itemNode, "Name", null, true);

                item.FriendlyName = itemNode.SelectSingleNode("FriendlyName").InnerText;
                item.Description = itemNode.SelectSingleNode("Description").InnerText;
                item.Weight = XmlExtensions.GetAttributeValue<float>(itemNode, "Weight", 0);
                item.ItemType = (ItemType)Enum.Parse(typeof(ItemType), XmlExtensions.GetAttributeValue(itemNode, "ItemType", null, true));

                foreach(XmlNode drawableSetNode in itemNode.SelectNodes("Drawables/Drawable"))
                {
                    string src = XmlExtensions.GetAttributeValue(drawableSetNode, "src");
                    DrawableSet.LoadDrawableSetXml(item.Drawables, src, content);
                }

                if (itemNode.SelectSingleNode("Icon") != null)
                    item.Icon = content.Load<Texture2D>(XmlExtensions.GetAttributeValue(itemNode.SelectSingleNode("Icon"), "src"));

                GameItems.Add(item.Name, item);
            }
        }
Пример #6
1
		public override bool OnDragDropInto( Mobile from, Item dropped, Point3D point )
		{
			BasePiece piece = dropped as BasePiece;

			if ( piece != null && piece.Board == this && base.OnDragDropInto( from, dropped, point ) )
			{
				Packet p = new PlaySound( 0x127, GetWorldLocation() );

				p.Acquire();

				if ( RootParent == from )
				{
					from.Send( p );
				}
				else
				{
					foreach ( NetState state in this.GetClientsInRange( 2 ) )
						state.Send( p );
				}

				p.Release();

				return true;
			}
			else
			{
				return false;
			}
		}
Пример #7
1
        public List<Item> getDropdown(string type)
        {
            List<Item> list = new List<Item>();
            string dropdownFirst = "";
            dropDownType review;
            if (!Enum.TryParse(type, out review))
            {
                //throw bad enum parse
            }
            switch (review)
            {
                case dropDownType.PROVINCE:
                    list = getProvinces(dropDownType.PROVINCE);
                    dropdownFirst = "เลือกจังหวัด";
                    break;
                case dropDownType.PROVINCEGOID:
                    list = getProvinces(dropDownType.PROVINCEGOID);
                    dropdownFirst = "เลือกจังหวัด";
                    break;

            }

            Item firstList = new Item();
            firstList.value = "0";
            firstList.name = "-- " + dropdownFirst + " --";
            list.Insert(0, firstList);
            return list;
        }
Пример #8
1
		public virtual bool IsEqual(Item item)
		{
			if (type != item.type) { return false; }

			if (name.CompareTo(item.name) != 0) { return false; }
			if (tradeAs != item.tradeAs) { return false; }
			if (fullGround != item.fullGround) { return false; }
			if (isAnimation != item.isAnimation) { return false; }
			if (alwaysOnTop != item.alwaysOnTop) { return false; }
			if (alwaysOnTopOrder != item.alwaysOnTopOrder) { return false; }
			if (isUnpassable != item.isUnpassable) { return false; }
			if (blockPathfinder != item.blockPathfinder) { return false; }
			if (blockMissiles != item.blockMissiles) { return false; }
			if (groundSpeed != item.groundSpeed) { return false; }
			if (hasElevation != item.hasElevation) { return false; }
			if (multiUse != item.multiUse) { return false; }
			if (isHangable != item.isHangable) { return false; }
			if (isHorizontal != item.isHorizontal) { return false; }
			if (isVertical != item.isVertical) { return false; }
			if (isMoveable != item.isMoveable) { return false; }
			if (isPickupable != item.isPickupable) { return false; }
			if (isReadable != item.isReadable) { return false; }
			if (isRotatable != item.isRotatable) { return false; }
			if (isStackable != item.isStackable) { return false; }
			if (lightColor != item.lightColor) { return false; }
			if (lightLevel != item.lightLevel) { return false; }
			if (ignoreLook != item.ignoreLook) { return false; }
			if (maxReadChars != item.maxReadChars) { return false; }
			if (maxReadWriteChars != item.maxReadWriteChars) { return false; }
			if (minimapColor != item.minimapColor) { return false; }
			return true;
		}
		public override bool OnMoveOver( Mobile m )
		{

			if ( m == null || m.Deleted || m.Backpack == null || m.Backpack.Deleted )
				return true;

			if ( Active && m_itemType != null )
			{
				if ( !Creatures && !m.Player )
					return true;

				m_item = m.Backpack.FindItemByType(m_itemType, true);
				if ( m_item != null )
				{
					StartTeleport(m);
					return false;
				}
				else
				{
					if ( m_Message != null && m != null)
						m.SendMessage(m_Message);
				}


			}
			return true;
		}
Пример #10
1
		internal UserItem(uint Id, uint BaseItem, string ExtraData, uint Group, string SongCode)
		{
			this.Id = Id;
			this.BaseItem = BaseItem;
			this.ExtraData = ExtraData;
			this.mBaseItem = this.GetBaseItem();
			this.GroupId = Group;
			using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
			{
				queryreactor.setQuery("SELECT * FROM items_limited WHERE item_id=" + Id + " LIMIT 1");
				DataRow row = queryreactor.getRow();
				if (row != null)
				{
					this.LimitedNo = int.Parse(row[1].ToString());
					this.LimitedTot = int.Parse(row[2].ToString());
				}
				else
				{
					this.LimitedNo = 0;
					this.LimitedTot = 0;
				}
			}
			this.isWallItem = (this.mBaseItem.Type == 'i');
			this.SongCode = SongCode;
		}
    private List<Item> ItemsToFileJSon(JsonData sourceData)
    {
        int LengthData = sourceData.Count;
        List<Item> itemsToGetted = new List<Item>();

        for (int i = 0; i < LengthData; i++)
        {
            Item itemGettedTmp = new Item()
            {
                Id = (int)sourceData[i]["Id"],
                Name = sourceData[i]["Name"].ToString(),
                Description = sourceData[i]["Description"].ToString(),
                Intensity = (int)sourceData[i]["Intensity"],
                TypeItem = (e_itemType)((int)sourceData[i]["Type"]),
                ElementTarget = (e_element)((int)sourceData[i]["Element"]),
                LevelRarity = (e_itemRarity)((int)sourceData[i]["Rarity"]),
                IsStackable = (bool)sourceData[i]["Stackable"],
                Sprite = Item.AssignResources(sourceData[i]["Sprite"].ToString())
            };

            itemsToGetted.Add(itemGettedTmp);
        }

        return itemsToGetted;
    }
Пример #12
1
 //Equips the item you click
 public static void Equip(Item item)
 {
     Item prevItem;
     if(item.itemType == Item.ItemType.Armor)
     {
         if(CharacterWindow.itemHead == null)
         {
             CharacterWindow.itemHead = item;
         }
         else
         {
             prevItem = CharacterWindow.itemHead;
             Inventory.AddItem(prevItem.itemID);
             CharacterWindow.itemHead = item;
             print ("" + CharacterWindow.itemHead.itemName);
         }
     }
     if(item.itemType == Item.ItemType.Weapon)
     {
         if(CharacterWindow.itemWeapon == null)
         {
             CharacterWindow.itemWeapon = item;
         }
         else
         {
             prevItem = CharacterWindow.itemWeapon;
             Inventory.AddItem(prevItem.itemID);
             CharacterWindow.itemWeapon = item;
             print ("" + CharacterWindow.itemWeapon.itemName);
         }
     }
 }
Пример #13
1
        public Inventory(int SCREEN_WIDTH, int SCREEN_HEIGHT, Pantheon gameReference)
        {
            locationBoxes = new List<Rectangle>();
            equippedBoxes = new List<Rectangle>();
            types = new List<int>();
            infoBox = new Rectangle();
            movingBox = new Rectangle();
            trashBox = new Rectangle();

            tempStorage = new Item();

            this.SCREEN_WIDTH = SCREEN_WIDTH;
            this.SCREEN_HEIGHT = SCREEN_HEIGHT;

            SetBoxes();

            selected = -1;
            hoveredOver = -1;

            color = new Color(34, 167, 222, 50);
            trashColor = Color.White;

            inventorySelector = gameReference.Content.Load<Texture2D>("Inventory/InvSelect");
            trashCan = gameReference.Content.Load<Texture2D>("Inventory/TrashCan");
            nullImage = new Texture2D(gameReference.GraphicsDevice, 1,1);
            nullImage.SetData(new[] { new Color(0,0,0,0) });
        }
Пример #14
1
	    /// <summary>
	    ///     Gets the item price model.
	    /// </summary>
	    /// <param name="item">The item.</param>
	    /// <param name="lowestPrice">The lowest price.</param>
	    /// <param name="tags">Additional tags for promotion evaluation</param>
	    /// <returns>price model</returns>
	    /// <exception cref="System.ArgumentNullException">item</exception>
	    public PriceModel GetItemPriceModel(Item item, Price lowestPrice, Hashtable tags)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            if (lowestPrice == null)
            {
                return new PriceModel();
            }

            var price = lowestPrice.Sale ?? lowestPrice.List;
            var discount = _client.GetItemDiscountPrice(item, lowestPrice, tags);
            var priceModel = CreatePriceModel(price, price - discount, UserHelper.CustomerSession.Currency);
	        priceModel.ItemId = item.ItemId;
            //If has any variations
            /* performance too slow with this method, need to store value on indexing instead
	        if (CatalogHelper.CatalogClient.GetItemRelations(item.ItemId).Any())
	        {
	            priceModel.PriceTitle = "Starting from:".Localize();
	        }
             * */
            return priceModel;
        }
Пример #15
1
        public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage)
        {
            if (!this.CheckHold(from, dropped, sendFullMessage, true))
                return false;

            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house != null && house.IsLockedDown(this))
            {
                if (dropped is VendorRentalContract || (dropped is Container && ((Container)dropped).FindItemByType(typeof(VendorRentalContract)) != null))
                {
                    from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
                    return false;
                }

                if (!house.LockDown(from, dropped, false))
                    return false;
            }

            List<Item> list = this.Items;

            for (int i = 0; i < list.Count; ++i)
            {
                Item item = list[i];

                if (!(item is Container) && item.StackWith(from, dropped, false))
                    return true;
            }

            this.DropItem(dropped);

            ItemFlags.SetTaken(dropped, true);

            return true;
        }
Пример #16
1
 // Process a new item that is being created
 // Extracts the intent based on ItemType and extends as FieldValue on Item
 // return true to indicate to sub-classes that processing is complete
 public virtual bool ProcessCreate(Item item)
 {
     var intent = ExtractIntent(item);
     if (intent != null)
         CreateIntentFieldValue(item, intent);
     return false;
 }
Пример #17
1
        public override bool CheckItemUse(Mobile from, Item item)
        {
            if (this.IsDecoContainer && item is BaseBook)
                return true;

            return base.CheckItemUse(from, item);
        }
Пример #18
0
			private SmeltResult Resmelt( Mobile from, Item item, CraftResource resource )
			{
				try
				{
					if ( CraftResources.GetType( resource ) != CraftResourceType.Metal )
						return SmeltResult.Invalid;

					CraftResourceInfo info = CraftResources.GetInfo( resource );

					if ( info == null || info.ResourceTypes.Length == 0 )
						return SmeltResult.Invalid;

					CraftItem craftItem = m_CraftSystem.CraftItems.SearchFor( item.GetType() );

					if ( craftItem == null || craftItem.Resources.Count == 0 )
						return SmeltResult.Invalid;

					CraftRes craftResource = craftItem.Resources.GetAt( 0 );

					if ( craftResource.Amount < 2 )
						return SmeltResult.Invalid; // Not enough metal to resmelt

					double difficulty = 0.0;

					switch ( resource )
					{
						case CraftResource.DullCopper: difficulty = 65.0; break;
						case CraftResource.ShadowIron: difficulty = 70.0; break;
						case CraftResource.Copper: difficulty = 75.0; break;
						case CraftResource.Bronze: difficulty = 80.0; break;
						case CraftResource.Gold: difficulty = 85.0; break;
						case CraftResource.Agapite: difficulty = 90.0; break;
						case CraftResource.Verite: difficulty = 95.0; break;
						case CraftResource.Valorite: difficulty = 99.0; break;
					}

					if ( difficulty > from.Skills[ SkillName.Mining ].Value )
						return SmeltResult.NoSkill;

					Type resourceType = info.ResourceTypes[0];
					Item ingot = (Item)Activator.CreateInstance( resourceType );

					if ( item is DragonBardingDeed || (item is BaseArmor && ((BaseArmor)item).PlayerConstructed) || (item is BaseWeapon && ((BaseWeapon)item).PlayerConstructed) || (item is BaseClothing && ((BaseClothing)item).PlayerConstructed) )
						ingot.Amount = craftResource.Amount / 2;
					else
						ingot.Amount = 1;

					item.Delete();
					from.AddToBackpack( ingot );

					from.PlaySound( 0x2A );
					from.PlaySound( 0x240 );
					return SmeltResult.Success;
				}
				catch
				{
				}

				return SmeltResult.Invalid;
			}
        public ItemViewModel Map(Item source, ItemViewModel destination)
        {
            if (source == null)
            {
                return null;
            }

            if (destination == null)
            {
                destination = new ItemViewModel();
            }
            destination.Id = source.Id;
            destination.Name = source.Name;
            destination.SerialNumber = source.SerialNumber;
            destination.CreatedOn = source.CreatedOn;
            destination.CreatedBy = source.CreatedBy;
            destination.ModifiedOn = source.ModifiedOn;
            destination.ModifiedBy = source.ModifiedBy;

            var state = source.States.FirstOrDefault();

            destination.StateName = state == null ? "-" : state.StateName;

            return destination;

        }
Пример #20
0
        public static IUpdateQuality GetItemInstance(Item item)
        {
            IUpdateQuality updateQuality = null;

            if (item.Name.Equals("Aged Brie"))
            {
                updateQuality = new AgedBrieDecorator(item);
            }

            else if (item.Name.Equals("Elixir of the Mongoose"))
            {
                updateQuality = new ElixirMongooseDecorator(item);
            }

            else if (item.Name.Equals("+5 Dexterity Vest"))
            {
                updateQuality = new DexterityVestDecorator(item);
            }

            else if (item.Name.Equals("Backstage passes to a TAFKAL80ETC concert"))
            {
                updateQuality = new BackstagePassesDecorator(item);
            }

            else if (item.Name.Equals("Conjured Mana Cake"))
            {
                updateQuality = new ConjuredDecorator(item);
            }

            return updateQuality;
        }
Пример #21
0
      	public StoneGump(Mobile from, Item deed)
			:base(20, 15)
        	{
            	m_Mobile = from;
            	m_Deed = deed;
			Closable = true;
            	Disposable = true;
            	Dragable = true;
			Resizable = false;
	  	            AddPage(0);

		AddBackground( 0, 0, 300, 400, 3000 ); 
         	AddBackground( 8, 8, 284, 384, 5120 ); 
            	 AddLabel( 40, 12, 37, "PICK YOUR REWARD FOR VOTING!" ); 
			AddButton(74, 111, 4023, 4024, 1, GumpButtonType.Reply, 0); //Shroud
			AddButton(74, 140, 4023, 4024, 2, GumpButtonType.Reply, 1); //Earrings
			AddButton(74, 169, 4023, 4024, 3, GumpButtonType.Reply, 2); //Sandals
			AddButton(74, 198, 4023, 4024, 4, GumpButtonType.Reply, 3); //Sandals            
         		AddButton( 12, 360, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddLabel( 52, 360, 37, "Close" ); 
			AddLabel(113, 111, 0, @"Vote Shroud");
			AddLabel(113, 140, 0, @"Vote Earrings");
 			AddLabel(113, 169, 0, @"Vote Sandals");
			AddLabel(113, 198, 0, @"Vote Half Apron");
		}
Пример #22
0
        private static void LoadItems()
        {
            XmlReader reader = new XmlTextReader("zitem.xml");
            while (reader.Read())
            {
                switch (reader.Name)
                {
                    case "ITEM":
                        Item item = new Item();
                        item.nItemID = Int32.Parse(reader.GetAttribute("id"));
                        item.nLevel = (byte)Int32.Parse(reader.GetAttribute("res_level"));
                        item.nWeight = Int32.Parse(reader.GetAttribute("weight"));
                        item.nMaxWT = reader.GetAttribute("maxwt") == null ? 0 : Int32.Parse(reader.GetAttribute("maxwt"));
                        item.nPrice = reader.GetAttribute("bt_price") == null ? 0 : Int32.Parse(reader.GetAttribute("bt_price"));
                        mItems.Add(item);
                        break;
                }
            }

            reader = new XmlTextReader("shop.xml");
            while (reader.Read())
            {
                switch (reader.Name)
                {
                    case "SELL":
                        mShop.Add(UInt32.Parse(reader.GetAttribute("itemid")));
                        break;
                }
            }
        }
Пример #23
0
    public bool CanAccept(Item item, int x, int y)
    {
        if (Item == null)
            return true;

        return false;
    }
Пример #24
0
		public override bool DropToItem( Mobile from, Item target, Point3D p )
		{
			bool ret = base.DropToItem( from, target, p );

			if ( ret && !Accepted && Parent != from.Backpack )
			{
				if ( from.AccessLevel > AccessLevel.Player )
				{
					return true;
				}
				else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
				{
					return true;
				}
				else
				{
					from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
					return false;
				}
			}
			else
			{
				return ret;
			}
		}
Пример #25
0
        protected void btnTesteInsercao_Click(object sender, EventArgs e)
        {
            //Simula a recepção dos objetos Colecao que serão associados ao novo Item
            ColecaoControler cCol = new ColecaoControler();
            Colecao c1 = cCol.ObterColecao(1);
            Colecao c2 = cCol.ObterColecao(2);

            //Cria o novo Item
            ItemControler cItem = new ItemControler();
            Item item = new Item
            {
                Nome = "Nome do novo item",
                Descricao = "Descrição do novo item",
                QtdVisualizacoes = 1,
                DataCasdastro = DateTime.Now
            };
            //Associa as coleções ao item
            item.Colecoes.Add(c1);
            item.Colecoes.Add(c2);

            //Tenta gravar no BD
            if (cItem.Gravar(item) > 0)
                ltMensagem.Text = "OK";
            else
                ltMensagem.Text = "Erro";
        }
Пример #26
0
		public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
		{
			if ( this.IsSecure && !BaseHouse.CheckHold( m, this, item, message, checkItems, plusItems, plusWeight ) )
				return false;

			return base.CheckHold( m, item, message, checkItems, plusItems, plusWeight );
		}
Пример #27
0
 public void AddItemTest_withQuantity_itemNotInCartAlready_itemAddedWithQuantity() {
     ShoppingCart cart = new ShoppingCart();
     Item item = new Item("Apple");
     cart.AddItem(item, 3);
     Assert.IsTrue(cart.DoesCartContainItem(item));
     Assert.AreEqual(3, cart.GetLineItemForItem(item).Quantity);
 }
Пример #28
0
	void OnDrop(GameObject go)
	{
		var item = go.GetComponent<Item>();

		if (item == null || go.transform.parent.name == "Holder")
		{
			// We dragged non-item GameObject or non-dragged item
			return;
		}

		// If we want to add or replace current Item
		if (currentItem != item)
		{
			// Replacing current item with new
			if (currentItem != null)
			{
				// Restore old hierarchy
				currentItem.transform.SetParent(currentItem.Parent);

				// Reset old position if possible
				if (currentItem.Parent != null)
				{
					var grid = currentItem.Parent.GetComponent<UIGrid>();
					grid.Reposition();
				}
			}

			currentItem = item;
		}
	}
Пример #29
0
 public void Add()
 {
     State state = new State();
     Item item = new Item(new Production(), state);
     state.Add(item);
     Assert.AreEqual(1, state.Count);
 }
Пример #30
0
        private void Completer(
            State state,
            Item item,
            IDictionary<Production,IList<Item>> completedNullable)
        {
            Debug.Assert(item.AtEnd);

            if (item.Parent == state)
            {
                // completed a nullable item

                if (!completedNullable.ContainsKey(item.Production))
                {
                    completedNullable[item.Production] = new List<Item>();
                }

                completedNullable[item.Production].Add(item);
            }

            foreach (Item parentItem in item.Parent.GetItems(item.Production))
            {
                Item newItem = state.Import(parentItem.NextItem);
                newItem.Add(item);
                ShiftCompletedNullable(state, newItem, completedNullable);
            }
        }
Пример #31
0
        public override void OnResponse(GameServer server, GameClient client, ushort responseID, string args)
        {
            switch (responseID)
            {
            case 0x0001:
                client.SendItemShopDialog(Mundane, "I stock only high-end gear.", 0x0004,
                                          ServerContext.GlobalItemTemplateCache.Values.Where(i => i.NpcKey == Mundane.Template.Name)
                                          .OrderBy(i => i.LevelRequired).ToList());
                break;

            case 0x0002:
                client.SendItemSellDialog(Mundane, "What do you want to sell?", 0x0005,
                                          client.Aisling.Inventory.Items.Values.Where(i => i != null && i.Template != null)
                                          .Select(i => i.Slot).ToList());

                break;

            case 0x0500:
            {
                var item = client.Aisling.Inventory.Get(i => i != null && i.Slot == Convert.ToInt32(args))
                           .FirstOrDefault();
                var offer = Convert.ToString((int)(item.Template.Value / 1.6));

                var opts2 = new List <OptionsDataItem>();
                opts2.Add(new OptionsDataItem(0x0019, "Fair enough."));
                opts2.Add(new OptionsDataItem(0x0020, "decline offer."));

                client.SendOptionsDialog(Mundane, string.Format(
                                             "I will give offer you {0} gold for that {1}, Deal?",
                                             offer, item.Template.Name), item.Template.Name, opts2.ToArray());
            }
            break;

            case 0x0019:
            {
                var v    = args;
                var item = client.Aisling.Inventory.Get(i => i != null && i.Template.Name == v)
                           .FirstOrDefault();

                if (item == null)
                {
                    return;
                }

                var offer = Convert.ToString((int)(item.Template.Value / 1.6));

                if (Convert.ToInt32(offer) <= 0)
                {
                    return;
                }

                if (Convert.ToInt32(offer) > item.Template.Value)
                {
                    return;
                }

                if (client.Aisling.GoldPoints + Convert.ToInt32(offer) <= ServerContext.Config.MaxCarryGold)
                {
                    client.Aisling.GoldPoints += Convert.ToInt32(offer);
                    client.Aisling.EquipmentManager.RemoveFromInventory(item, true);
                    client.SendStats(StatusFlags.StructC);

                    client.SendOptionsDialog(Mundane, "A Deal is a deal mate...");
                }
            }
            break;

                #region Buy

            case 0x0003:

                //TODO: make this calculate proper repair values.
                var repair_sum = client.Aisling.Inventory.Items.Where(i => i.Value != null &&
                                                                      i.Value.Template.Flags.HasFlag(
                                                                          ItemFlags.Repairable)).Sum(i =>
                                                                                                     i.Value.Template.Value / 4);

                var opts = new List <OptionsDataItem>();
                opts.Add(new OptionsDataItem(0x0014, "Fair enough."));
                opts.Add(new OptionsDataItem(0x0015, "No Thanks"));
                client.SendOptionsDialog(Mundane,
                                         "It will cost " + repair_sum + " Gold to repair everything. Do you Agree?",
                                         repair_sum.ToString(), opts.ToArray());

                break;

            case 0x0014:
            {
                var gear = client.Aisling.EquipmentManager.Equipment.Where(i => i.Value != null).Select(i => i.Value.Item);

                client.RepairEquipment(gear);

                client.SendOptionsDialog(Mundane, "All done, Bye for now.");
            }
            break;

            case 0x0015:
                client.SendOptionsDialog(Mundane, "well then. i will see you later.");
                break;

            case 0x0004:
            {
                if (string.IsNullOrEmpty(args))
                {
                    return;
                }

                if (!ServerContext.GlobalItemTemplateCache.ContainsKey(args))
                {
                    return;
                }

                var template = ServerContext.GlobalItemTemplateCache[args];
                if (template != null)
                {
                    if (client.Aisling.GoldPoints >= template.Value)
                    {
                        //Create Item:
                        var item = Item.Create(client.Aisling, template);

                        if (item.GiveTo(client.Aisling, true))
                        {
                            client.Aisling.GoldPoints -= (int)template.Value;

                            if (client.Aisling.GoldPoints < 0)
                            {
                                client.Aisling.GoldPoints = 0;
                            }

                            client.SendStats(StatusFlags.All);
                            client.SendOptionsDialog(Mundane, string.Format("You have a brand new {0}", args));
                        }
                        else
                        {
                            client.SendMessage(0x02, "You could not buy this item, because you can't physically hold it.");
                            return;
                        }
                    }
                    else
                    {
                        if (ServerContext.GlobalSpellTemplateCache.ContainsKey("ard cradh"))
                        {
                            var script = ScriptManager.Load <SpellScript>("ard cradh", Spell.Create(1, ServerContext.GlobalSpellTemplateCache["ard cradh"]));
                            {
                                script.OnUse(Mundane, client.Aisling);
                            }
                            client.SendOptionsDialog(Mundane, "Now now, None of that here. Be warned.");
                        }
                    }
                }
            }
            break;

            case 0x0005: client.SendOptionsDialog(Mundane, "You want a stick for free huh? They don't grow on trees you know!");
                break;
                #endregion Buy
            }
        }
Пример #32
0
 public static void SetItemInSlot(string slotName, Item item)
 {
     items[slotName] = item;
 }
Пример #33
0
 public ActionItem(Action <ushort> act, Item item)
 {
     this.item = item;
     this.act  = act;
 }
Пример #34
0
 public EnergyBoltSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
 {
 }
Пример #35
0
        /// <summary>Renders the panel.</summary>
        /// <param name="output">The output.</param>
        /// <param name="ribbon">The ribbon.</param>
        /// <param name="button">The button.</param>
        /// <param name="context">The context.</param>
        public override void Render(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            Assert.ArgumentNotNull((object)output, "output");
            Assert.ArgumentNotNull((object)ribbon, "ribbon");
            Assert.ArgumentNotNull((object)button, "button");
            Assert.ArgumentNotNull((object)context, "context");
            if (context.Items.Length < 1)
            {
                return;
            }
            Item obj = context.Items[0];

            if (!this.HasField(obj, FieldIDs.Workflow) || !Settings.Workflows.Enabled)
            {
                return;
            }
            IWorkflow workflow;

            WorkflowCommand[] commands;
            GetCommands(context.Items, out workflow, out commands);
            bool flag1 = this.IsCommandEnabled("item:checkout", obj);
            bool flag2 = CanShowCommands(obj, commands);
            bool flag3 = this.IsCommandEnabled("item:checkin", obj);

            this.RenderText(output, GetText(context.Items));
            if (workflow == null && !flag1 && (!flag2 && !flag3))
            {
                return;
            }



            Context.ClientPage.ClientResponse.DisableOutput();
            ribbon.BeginSmallButtons(output);
            if (flag1)
            {
                this.RenderSmallButton(output, ribbon, string.Empty, Translate.Text("Edit"), "Office/24x24/edit_in_workflow.png", Translate.Text("Start editing this item."), "item:checkout", this.Enabled, false);
            }
            if (flag3)
            {
                Item checkInItem = this.GetCheckInItem();
                if (checkInItem != null)
                {
                    this.RenderSmallButton(output, ribbon, string.Empty, checkInItem["Phrase"], checkInItem.Appearance.Icon, Translate.Text("Check this item in."), "item:checkin(id=" + (object)obj.ID + ",language=" + obj.Language.Name + ",version=" + (object)obj.Version + ")", (this.Enabled ? 1 : 0) != 0, 0 != 0);
                }
            }
            if (workflow != null)
            {
                this.RenderSmallButton(output, ribbon, Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("B"), Translate.Text("History"), "Office/16x16/history.png", Translate.Text("Show the workflow history."), "item:workflowhistory", this.Enabled, false);
            }
            if (flag2)
            {
                var repository = new WorxboxItemsRepository(workflow);

                foreach (WorkflowCommand command in commands)
                {
                    this.RenderSmallButton(output, ribbon, string.Empty, command.DisplayName, command.Icon, command.DisplayName,
                                           new WorkflowCommandBuilder(obj, workflow, command).ToString(),
                                           this.Enabled,
                                           false);

                    if (repository.IsWorxboxItem(obj.State.GetWorkflowState(), new DataUri(obj.Uri)) &&
                        repository.GetWorkflowCommandIDs().Contains(ID.Parse(command.CommandID)))
                    {
                        this.RenderSmallButton(output, ribbon, string.Empty, "WorxBox " + command.DisplayName, command.Icon, command.DisplayName,
                                               new WorxBoxWorkflowCommandBuilder(obj, workflow, command).ToString(),
                                               this.Enabled,
                                               false);
                    }
                }
            }
            ribbon.EndSmallButtons(output);
            Context.ClientPage.ClientResponse.EnableOutput();
        }
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 /// <param name="inheritItem">Source for inheriting item values.</param>
 public void SetInherit(IPaletteTriple inheritItem)
 {
     Item.SetInherit(inheritItem);
 }
Пример #37
0
		public virtual void PackItems( Item item, int amount )
		{
			for ( int i = 0; i < amount; i ++ )
				PackItem( item );
		}
Пример #38
0
 public void Clear()
 {
     this.item = null;
     // image.sprite = defaultSprite;
     image.enabled = false;
 }
Пример #39
0
 public ItemDetailViewModel(Item item = null)
 {
     Title = item?.Text;
     Item  = item;
 }
 public override void OnItemLoaded(Item item)
 {
     base.OnItemLoaded(item);
     item.gameObject.AddComponent <ItemLightsaberTool>();
 }
Пример #41
0
        public MediaImportMapItem(Item item) : base(item)
        {

        }
 /// <summary>
 /// Populate values from the base palette.
 /// </summary>
 /// <param name="state">Palette state to use when populating.</param>
 public void PopulateFromBase(PaletteState state)
 {
     Item.PopulateFromBase(state);
 }
Пример #43
0
 public OscillatorComponent(Item item, XElement element) :
     base(item, element)
 {
     IsActive = true;
 }
Пример #44
0
 public NightSightSpell(Mobile caster, Item scroll)
     : base(caster, scroll, m_Info)
 {
 }
Пример #45
0
 public void Put(Guid ItemId, Item item)
 {
     throw new NotImplementedException();
 }
Пример #46
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 1 && !m_House.Deleted)
            {
                if (m_House.IsOwner(m_Mobile))
                {
                    if (m_House.MovingCrate != null || m_House.InternalizedVendors.Count > 0)
                    {
                        return;
                    }
                    else if (!Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null)
                    {
                        m_Mobile.SendLocalizedMessage(501389);                           // You cannot redeed a house with a guildstone inside.
                        return;
                    }
                    else if (m_House.HasRentedVendors && m_House.VendorInventories.Count > 0)
                    {
                        m_Mobile.SendLocalizedMessage(1062679);                           // You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
                        return;
                    }
                    else if (m_House.HasRentedVendors)
                    {
                        m_Mobile.SendLocalizedMessage(1062680);                           // You cannot do that that while you still have contract vendors in your house.
                        return;
                    }
                    else if (m_House.VendorInventories.Count > 0)
                    {
                        m_Mobile.SendLocalizedMessage(1062681);                           // You cannot do that that while you still have unclaimed contract vendor inventory in your house.
                        return;
                    }

                    Item toGive = null;

                    if (m_House.IsAosRules)
                    {
                        if (m_House.Price > 0)
                        {
                            toGive = new BankCheck(m_House.Price);
                        }
                        else
                        {
                            toGive = m_House.GetDeed();
                        }
                        toGive.Hue = m_House.Hue;
                    }
                    else
                    {
                        toGive     = m_House.GetDeed();
                        toGive.Hue = m_House.Hue;

                        if (toGive == null && m_House.Price > 0)
                        {
                            toGive = new BankCheck(m_House.Price);
                        }
                    }

                    if (toGive != null)
                    {
                        BankBox box = m_Mobile.BankBox;

                        if (box.TryDropItem(m_Mobile, toGive, false))
                        {
                            if (toGive is BankCheck)
                            {
                                m_Mobile.SendLocalizedMessage(1060397, ((BankCheck)toGive).Worth.ToString());                                     // ~1_AMOUNT~ gold has been deposited into your bank box.
                            }
                            if (toGive is HouseDeed)
                            {
                                m_Mobile.SendMessage("The deed has been returned to your bank box.");
                            }

                            m_House.RemoveKeys(m_Mobile);
                            m_House.Delete();
                        }
                        else
                        {
                            toGive.Delete();
                            m_Mobile.SendLocalizedMessage(500390);                               // Your bank box is full.
                        }
                    }
                    else
                    {
                        m_Mobile.SendMessage("Unable to refund house.");
                    }
                }
                else
                {
                    m_Mobile.SendLocalizedMessage(501320);                       // Only the house owner may do this.
                }
            }
        }
Пример #47
0
 public Item GetItem(string id)
 {
     Item item = ItemRepository.Get(id);
     return item;
 }
Пример #48
0
        /// <summary>Gets the text.</summary>
        /// <param name="items">The items.</param>
        /// <returns>The get text.</returns>
        private static string GetText(Item[] items)
        {
            Assert.ArgumentNotNull((object)items, "items");
            if (items.Length <= 0 || items.Length != 1)
            {
                return(string.Empty);
            }
            Item obj = items[0];

            if (obj.Appearance.ReadOnly)
            {
                return(string.Empty);
            }
            if (AuthorizationManager.IsAllowed((ISecurable)obj, AccessRight.ItemWrite, (Account)Context.User))
            {
                if (obj.Locking.HasLock())
                {
                    return(Translate.Text("<b>You</b> have locked this item."));
                }
                if (obj.Locking.IsLocked())
                {
                    return(Translate.Text("<b>\"{0}\"</b> has locked this item.", (object)StringUtil.GetString(new string[2]
                    {
                        obj.Locking.GetOwnerWithoutDomain(),
                        "?"
                    })));
                }
                if (obj.Locking.CanLock())
                {
                    return(Translate.Text("Click Edit to lock and edit this item."));
                }
                IWorkflow     workflow      = obj.State.GetWorkflow();
                WorkflowState workflowState = obj.State.GetWorkflowState();
                if (workflow == null || workflowState == null)
                {
                    return(Translate.Text("You do not have permission to<br/>edit the content of this item."));
                }
                if (workflowState.FinalState)
                {
                    return(Translate.Text("This item has been approved."));
                }
                return(Translate.Text("The item is in the <b>{0}</b> state<br/>in the <b>{1}</b> workflow.", (object)StringUtil.GetString(new string[2]
                {
                    workflowState.DisplayName,
                    "?"
                }), (object)StringUtil.GetString(new string[2]
                {
                    workflow.Appearance.DisplayName,
                    "?"
                })));
            }
            if (obj.Access.CanWrite())
            {
                return(Translate.Text("Click Edit to lock and edit this item."));
            }
            IWorkflow     workflow1      = obj.State.GetWorkflow();
            WorkflowState workflowState1 = obj.State.GetWorkflowState();

            if (workflow1 == null || workflowState1 == null)
            {
                return(Translate.Text("You do not have permission to<br/>edit the content of this item."));
            }
            if (workflowState1.FinalState)
            {
                return(Translate.Text("This item has been approved."));
            }
            return(Translate.Text("The item is in the <b>{0}</b> state<br/>in the <b>{1}</b> workflow.", (object)StringUtil.GetString(new string[2]
            {
                workflowState1.DisplayName,
                "?"
            }), (object)StringUtil.GetString(new string[2]
            {
                workflow1.Appearance.DisplayName,
                "?"
            })));
        }
Пример #49
0
        public static void CheckProperties(Item item)
        {
            if (item is PrimerOnArmsTalisman && ((PrimerOnArmsTalisman)item).Attributes.AttackChance != 10)
            {
                ((PrimerOnArmsTalisman)item).Attributes.AttackChance = 10;
            }

            if (item is ClaininsSpellbook && ((ClaininsSpellbook)item).Attributes.LowerManaCost != 10)
            {
                ((ClaininsSpellbook)item).Attributes.LowerManaCost = 10;
            }

            if (item is CrimsonCincture && ((CrimsonCincture)item).Attributes.BonusDex != 10)
            {
                ((CrimsonCincture)item).Attributes.BonusDex = 10;
            }

            if (item is CrystallineRing && ((CrystallineRing)item).Attributes.CastRecovery != 3)
            {
                ((CrystallineRing)item).Attributes.CastRecovery = 3;
            }

            if (item is FeyLeggings)
            {
                if (((FeyLeggings)item).PhysicalBonus != 3)
                {
                    ((FeyLeggings)item).PhysicalBonus = 3;
                }

                if (((FeyLeggings)item).FireBonus != 3)
                {
                    ((FeyLeggings)item).FireBonus = 3;
                }

                if (((FeyLeggings)item).ColdBonus != 3)
                {
                    ((FeyLeggings)item).ColdBonus = 3;
                }

                if (((FeyLeggings)item).EnergyBonus != 3)
                {
                    ((FeyLeggings)item).EnergyBonus = 3;
                }
            }

            if (item is FoldedSteelGlasses && ((FoldedSteelGlasses)item).Attributes.DefendChance != 25)
            {
                ((FoldedSteelGlasses)item).Attributes.DefendChance = 25;
            }

            if (item is HeartOfTheLion)
            {
                if (((HeartOfTheLion)item).PhysicalBonus != 5)
                {
                    ((HeartOfTheLion)item).PhysicalBonus = 5;
                }

                if (((HeartOfTheLion)item).FireBonus != 5)
                {
                    ((HeartOfTheLion)item).FireBonus = 5;
                }

                if (((HeartOfTheLion)item).ColdBonus != 5)
                {
                    ((HeartOfTheLion)item).ColdBonus = 5;
                }

                if (((HeartOfTheLion)item).PoisonBonus != 5)
                {
                    ((HeartOfTheLion)item).PoisonBonus = 5;
                }

                if (((HeartOfTheLion)item).EnergyBonus != 5)
                {
                    ((HeartOfTheLion)item).EnergyBonus = 5;
                }
            }

            if (item is HuntersHeaddress)
            {
                if (((HuntersHeaddress)item).Resistances.Physical != 8)
                {
                    ((HuntersHeaddress)item).Resistances.Physical = 8;
                }

                if (((HuntersHeaddress)item).Resistances.Fire != 4)
                {
                    ((HuntersHeaddress)item).Resistances.Fire = 4;
                }

                if (((HuntersHeaddress)item).Resistances.Cold != -8)
                {
                    ((HuntersHeaddress)item).Resistances.Cold = -8;
                }

                if (((HuntersHeaddress)item).Resistances.Poison != 9)
                {
                    ((HuntersHeaddress)item).Resistances.Poison = 9;
                }

                if (((HuntersHeaddress)item).Resistances.Energy != 3)
                {
                    ((HuntersHeaddress)item).Resistances.Energy = 3;
                }
            }

            if (item is KasaOfTheRajin && ((KasaOfTheRajin)item).Attributes.DefendChance != 10)
            {
                ((KasaOfTheRajin)item).Attributes.DefendChance = 10;
            }

            if (item is MaceAndShieldGlasses && ((MaceAndShieldGlasses)item).Attributes.WeaponDamage != 10)
            {
                ((MaceAndShieldGlasses)item).Attributes.WeaponDamage = 10;
            }

            if (item is VesperOrderShield && ((VesperOrderShield)item).Attributes.CastSpeed != 0)
            {
                ((VesperOrderShield)item).Attributes.CastSpeed = 0;

                if (item.Name != "Order Shield")
                {
                    item.Name = "Order Shield";
                }
            }

            if (item is OrnamentOfTheMagician && ((OrnamentOfTheMagician)item).Attributes.RegenMana != 3)
            {
                ((OrnamentOfTheMagician)item).Attributes.RegenMana = 3;
            }

            if (item is RingOfTheVile && ((RingOfTheVile)item).Attributes.AttackChance != 25)
            {
                ((RingOfTheVile)item).Attributes.AttackChance = 25;
            }

            if (item is RuneBeetleCarapace)
            {
                if (((RuneBeetleCarapace)item).PhysicalBonus != 3)
                {
                    ((RuneBeetleCarapace)item).PhysicalBonus = 3;
                }

                if (((RuneBeetleCarapace)item).FireBonus != 3)
                {
                    ((RuneBeetleCarapace)item).FireBonus = 3;
                }

                if (((RuneBeetleCarapace)item).ColdBonus != 3)
                {
                    ((RuneBeetleCarapace)item).ColdBonus = 3;
                }

                if (((RuneBeetleCarapace)item).PoisonBonus != 3)
                {
                    ((RuneBeetleCarapace)item).PoisonBonus = 3;
                }

                if (((RuneBeetleCarapace)item).EnergyBonus != 3)
                {
                    ((RuneBeetleCarapace)item).EnergyBonus = 3;
                }
            }

            if (item is SpiritOfTheTotem)
            {
                if (((SpiritOfTheTotem)item).Resistances.Fire != 7)
                {
                    ((SpiritOfTheTotem)item).Resistances.Fire = 7;
                }

                if (((SpiritOfTheTotem)item).Resistances.Cold != 2)
                {
                    ((SpiritOfTheTotem)item).Resistances.Cold = 2;
                }

                if (((SpiritOfTheTotem)item).Resistances.Poison != 6)
                {
                    ((SpiritOfTheTotem)item).Resistances.Poison = 6;
                }

                if (((SpiritOfTheTotem)item).Resistances.Energy != 6)
                {
                    ((SpiritOfTheTotem)item).Resistances.Energy = 6;
                }
            }

            if (item is Stormgrip && ((Stormgrip)item).Attributes.AttackChance != 10)
            {
                ((Stormgrip)item).Attributes.AttackChance = 10;
            }

            if (item is InquisitorsResolution)
            {
                if (((InquisitorsResolution)item).PhysicalBonus != 5)
                {
                    ((InquisitorsResolution)item).PhysicalBonus = 5;
                }

                if (((InquisitorsResolution)item).FireBonus != 7)
                {
                    ((InquisitorsResolution)item).FireBonus = 7;
                }

                if (((InquisitorsResolution)item).ColdBonus != -2)
                {
                    ((InquisitorsResolution)item).ColdBonus = -2;
                }

                if (((InquisitorsResolution)item).PoisonBonus != 7)
                {
                    ((InquisitorsResolution)item).PoisonBonus = 7;
                }

                if (((InquisitorsResolution)item).EnergyBonus != -7)
                {
                    ((InquisitorsResolution)item).EnergyBonus = -7;
                }
            }

            if (item is TomeOfLostKnowledge && ((TomeOfLostKnowledge)item).Attributes.RegenMana != 3)
            {
                ((TomeOfLostKnowledge)item).Attributes.RegenMana = 3;
            }

            if (item is WizardsCrystalGlasses)
            {
                if (((WizardsCrystalGlasses)item).PhysicalBonus != 5)
                {
                    ((WizardsCrystalGlasses)item).PhysicalBonus = 5;
                }

                if (((WizardsCrystalGlasses)item).FireBonus != 5)
                {
                    ((WizardsCrystalGlasses)item).FireBonus = 5;
                }

                if (((WizardsCrystalGlasses)item).ColdBonus != 5)
                {
                    ((WizardsCrystalGlasses)item).ColdBonus = 5;
                }

                if (((WizardsCrystalGlasses)item).PoisonBonus != 5)
                {
                    ((WizardsCrystalGlasses)item).PoisonBonus = 5;
                }

                if (((WizardsCrystalGlasses)item).EnergyBonus != 5)
                {
                    ((WizardsCrystalGlasses)item).EnergyBonus = 5;
                }
            }
        }
Пример #50
0
 /// <summary>Determines whether this instance can show commands.</summary>
 /// <param name="item">The item to check.</param>
 /// <param name="commands">The commands.</param>
 /// <returns>
 /// <c>true</c> if this instance [can show commands] the specified item; otherwise, <c>false</c>.
 /// </returns>
 public static bool CanShowCommands(Item item, WorkflowCommand[] commands)
 {
     Assert.ArgumentNotNull((object)item, "item");
     return(!item.Appearance.ReadOnly && commands != null && commands.Length > 0 && (Context.IsAdministrator || item.Access.CanWriteLanguage() && (item.Locking.CanLock() || item.Locking.HasLock())));
 }
Пример #51
0
		public PlaylistItem(Item i) {
			playlistItem = i;
		}
 public GumpPicBackpack(AControl owner, int page, int x, int y, Item backpack)
     : base(owner, page, x, y, 0xC4F6, 0)
 {
     BackpackItem = backpack;
 }
 public override bool IsArmorSet(Item head, Item body, Item legs)
 {
     return(body.type == mod.ItemType("VarguleChestplate") && legs.type == mod.ItemType("VarguleLeggings"));
 }
 public WraithFormSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
 {
 }
Пример #55
0
 public void AddItem(Action <ushort> act, Item item)
 {
     itemAdded(new ActionItem(act, item));
 }
Пример #56
0
 internal override void SetValue(Item item, string val) => Cast(item).SelectString = val;
Пример #57
0
        public override void RightClick(Player player)
        {
            //Needed to counter the default consuption.
            this.item.stack++;

            if (!ContainsCandy)
            {
                return;
            }
            int remove = Main.rand.Next(pieces);
            int i      = 0;

            for (; i < candy.Length; i++)
            {
                if (remove < candy[i])
                {
                    break;
                }

                remove -= candy[i];
            }
            int  slot = Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, SlotToType(i), 1, true);
            Item item = Main.item[slot];

            if (i == 0)
            {
                remove = Main.rand.Next(candy[0]);
                int v = variants.Length - 1;
                for (; v >= 0; v--)
                {
                    if (remove < variants[v])
                    {
                        variants[v]--;
                        ((Candy)item.modItem).Variant = v;
                        break;
                    }
                    remove -= variants[v];
                }
            }
            if (i < candy.Length)
            {
                candy[i]--;
            }
            pieces--;
            Item[] inv = player.inventory;
            for (int j = 0; j < 50; j++)
            {
                if (!inv[j].IsAir)
                {
                    continue;
                }
                inv[j]          = item;
                Main.item[slot] = new Item();
                return;
            }
            item.velocity.X  = 4 * player.direction + player.velocity.X;
            item.velocity.Y  = -2f;
            item.noGrabDelay = 100;
            if (Main.netMode != 0)
            {
                NetMessage.SendData(21, -1, -1, null, slot, 1f);
            }
        }
Пример #58
0
 internal override string GetTargetName(Item item) => $"{Cast(item).GetWhereSelectTargetName()}  {Root.GetNameId(IdKey)}";
Пример #59
0
 public void QueueRoomItemUpdate(Item item)
 {
     _roomItemUpdateQueue.Enqueue(item);
 }
Пример #60
0
 internal override string GetValue(Item item) => Cast(item).SelectString;