Invoke Player's Current Inventory menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    darkmage113's Avatar Member
    Reputation
    11
    Join Date
    Jun 2007
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Invoke Player's Current Inventory

    I need a way to get the GUID's of every item in a player's inventory. I've poked around and it doesn't look like there's a script lying around anywhere.

    I'm using MangosZero w/ Eluna right now.

    Invoke Player's Current Inventory
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    https://github.com/ElunaLuaEngine/El...aFunctions.cpp

    Your item reference can be returned by:

    Code:
        { "GetItemByEntry", &LuaPlayer::GetItemByEntry },                             // :GetItemByEntry(entry) - Gets an item if the player has it
        { "GetEquippedItemBySlot", &LuaPlayer::GetEquippedItemBySlot },               // :GetEquippedItemBySlot(slotId) - Returns equipped item by slot
    Then to get the item's GUID you will need to expose the GetGUID function by the looks of it, as it does not seem to exist for some strange reason. You can loop through the entire players inventory this way.

  3. #3
    darkmage113's Avatar Member
    Reputation
    11
    Join Date
    Jun 2007
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    https://github.com/ElunaLuaEngine/El...aFunctions.cpp

    Your item reference can be returned by:

    Code:
        { "GetItemByEntry", &LuaPlayer::GetItemByEntry },                             // :GetItemByEntry(entry) - Gets an item if the player has it
        { "GetEquippedItemBySlot", &LuaPlayer::GetEquippedItemBySlot },               // :GetEquippedItemBySlot(slotId) - Returns equipped item by slot
    Then to get the item's GUID you will need to expose the GetGUID function by the looks of it, as it does not seem to exist for some strange reason. You can loop through the entire players inventory this way.
    Thanks mate!

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    In regards to PM, do something like this:

    Code:
    local function getPlayersInventory(plr)
    	local items = {}
    	
    	for i=0,23 do -- need to iterate through every slot, this does not include items in bag I think, need to get the ID's for these from the emulator
    		local item = plr:GetEquippedItemBySlot(i)
    		if item then
    			table.insert(items, item:GetGUID())
    		end
    	end
    	
    	return items
    end
    If you want to get the item ID's the player has, change item:GetGUID() to item:GetEntry().

    Code:
    ...
    local items = getPlayersInventory(player) -- call our custom function passing in the player
    -- Assume item ID's were returned not GUIDs
    for _,v in pairs(items) do
        player:AddItem(v)
    end
    Last edited by stoneharry; 08-09-2014 at 08:53 AM.

Similar Threads

  1. Reading players inventory / available bag slots left
    By Envoke in forum WoW Memory Editing
    Replies: 7
    Last Post: 05-26-2012, 05:14 PM
  2. Player inventory
    By diablothree in forum Diablo 3 Memory Editing
    Replies: 8
    Last Post: 01-31-2012, 04:34 AM
  3. Replies: 3
    Last Post: 03-31-2010, 07:25 AM
  4. How can i add an item to your inventory whenever you kill a player ?
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 01-20-2009, 07:39 PM
All times are GMT -5. The time now is 02:53 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search