+ Reply to Thread
Results 1 to 6 of 6

Thread: Instantiating Items & Inspect.Item.Detail()

  1. #1
    Soulwalker
    Join Date
    Jan 2015
    Posts
    15

    Default Instantiating Items & Inspect.Item.Detail()

    Good morning,

    I've searched around quite a bit and I can never quite find exactly the information I'm looking for as to how to create an Item. I've taken a look at items.xml and I see the various properties it has. I see ItemId and AddonKey, though I can't figure out how to create the Item object to pass into Inspect.Item.Detail() for example.

    Code:
    -- just an example number
    local i = { itemId = "1234567890" } 
    
    -- all the items matching this
    local items = Inspect.Item.Detail(i)
    
    -- i believe this returns a list, so grab the first item
    local firstItem = items[1]
    
    -- in theory, i should be able to print some of the information, however I'm usually given "nil"
    print(firstItem.name)
    Would someone mind pointing me in the right direction? Thanks a boatload.

    Hugh
    Last edited by hughball; 01-13-2015 at 09:20 AM.

  2. #2
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default

    You need to use the AddonType value from the items.xml.

    Then you need a table where the key is the item type:

    local ilist = {
    ["I167C314B7A65E7BB,63C1F1FE341DFD76,,,,,,"] = true,
    ["I658999227FA9CD3B,29267CFA3537356B,,,,,,"] = true
    }
    local idtls = Inspect.Item.Detail(ilist)

    Then you get a table back with the item ids:

    for k,v in pairs(idtls) do
    print(k.." : "..v.name)
    end
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  3. #3
    Soulwalker
    Join Date
    Jan 2015
    Posts
    15

    Default

    Thanks Adelea, this is exactly what I needed help with. Couldn't find this type of information anywhere.

    All the best to you!

    Hugh

  4. #4
    Soulwalker
    Join Date
    Jan 2015
    Posts
    15

    Default

    Alright, using the help you provided, I've gotten significantly further with addon development. I've got another question, however. In the documentation of Inspect.Item.Detail(), it refers to returning a table with the "coin" property, which should be the price I can sell the itemType to a vendor in silver, however, I don't see that on the table returned from the function when I dump() it.

    Any suggestions? Thanks again!
    Last edited by hughball; 02-01-2015 at 11:26 PM.

  5. #5
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default

    Quote Originally Posted by hughball View Post
    Alright, using the help you provided, I've gotten significantly further with addon development. I've got another question, however. In the documentation of Inspect.Item.Detail(), it refers to returning a table with the "coin" property, which should be the price I can sell the itemType to a vendor in silver, however, I don't see that on the table returned from the function when I dump() it.

    Any suggestions? Thanks again!

    The value is a property called 'sell' - and this is the price for a single item - so if you have a stack, the price of the stack would be sell * stack
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  6. #6
    Soulwalker
    Join Date
    Jan 2015
    Posts
    15

    Default

    Thank you very much - that makes sense, now that I look at it.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts