• Visit Rebornbuddy
  • Alternative Ways of Selling Items to an NPC

    Discussion in 'Community Developer Forum' started by AltanaFFXI, Mar 15, 2016.

    1. AltanaFFXI

      AltanaFFXI New Member

      Joined:
      Jan 25, 2016
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      0
      I apologize if this isn't the place for questions like these, but I've hit a snag trying to work something into the profiles I'm writing. Everything in the forums I found via search just seems to say "just use CommonTasks.SellItem(bagslot,delay) or write a codechunk." I'm not super great with code since I have minimal/no coding background, but I pick up fast so if it's easier to point me to an example I may be able to figure out writing a CodeChunk.

      I understand there's the CommonTasks.SellItem(bagslot,delay) function; however, is there a way to sell by item ID (i.e. how you can set item desynthesis by ID?) or even a "sell everything except" function? I'm trying to incorporate selling indicated drop/loot items during mendor visits.

      My ultimate goal is to specifically sell the following items to the vendor in Idyllshire while keeping everything else (i.e. bait, collectables, etc.):
      (1) various dye pigments, (2) allagan pieces, (3) HQ/NQ fine sand, (4) clear prisms. (Junk in general.)

      Thank you, and again I apologize if this request for guidance does not belong here. I appreciate any guidance you are able to give me.
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,229
      Likes Received:
      364
      Trophy Points:
      83
      This should work.

      Code:
      var itemList = InventoryManager.FilledSlots;
      var items = itemList.Where(r=>r.Item.RawItemId == 12312415);
      if (items  != null)
      {
      	foreach(var item in items)
      	{
      		await CommonTasks.SellItem(item);
      	}
      }
      
       
    3. AltanaFFXI

      AltanaFFXI New Member

      Joined:
      Jan 25, 2016
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      0
      Wonderful! Thank you very much, mastahg!
       

    Share This Page