Item slotid/bagid menu

User Tag List

Results 1 to 3 of 3
  1. #1
    peterwurst's Avatar Member
    Reputation
    11
    Join Date
    Jul 2006
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Item slotid/bagid

    Heya guys,

    I'm currently trying to figure out in which slot and bag an item is, to use the lua functions like PickupContainerItem and UseContainerItem.

    I'm able to get the slotid/bagid by looping through the iventory searching for the itemname.

    But dealing with items with the same name it would be better if I could choose a specific item by an unique identifier like the guid.

    So is it possible to get the slotid and bagid via the item guid?
    (Maybe it's stored in the itemstruct, but I'm unable to find it?)

    Thanks

    Item slotid/bagid
  2. #2
    LongBow's Avatar Member
    Reputation
    5
    Join Date
    Aug 2008
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should be able to figure this out in like 10 minutes. Iirc, there are pointers in the player object to the equipped bag objects. From the location of the pointer you know the bag slot. In the bag objects there is an array of pointers to the item objects of the items contained in the bag. From the location of the pointer you know the item slot. I hope that this helps.

  3. #3
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How I do it:
    Code:
    // relevant offsets
        PlayerField_CharacterSlot                   = 0x4A8, // goes through 0x538
    	PlayerField_BagStart						= 0x540, // 4 bag GUIDs will be listed starting here
    	PlayerField_BackPackStart					= 0x560, // all items go through 0x5D8, these are the GUIDs of items in the backpack
    	PlayerField_BankStart						= 0x5E0, // these items are in the bank (NOT in bags)
    	PlayerField_BankBags						= 0x6F0, // these are the GUIDs of the BAGS in your bank
    	PlayerField_Keys							= 0x758, // player keys
    	PlayerField_Marks							= 0x858, // player marks/emblems (currency)
    
    
    // Player.m
    // items player has in their backpack
    - (NSArray*)itemGUIDsInBackpack{
    	NSMutableArray *itemGUIDs = [NSMutableArray array];
    	
    	const int numberOfItems = 16;	// this could change on a patch day, it's the number of items stored in a player's backpack
    	uint i;
    	GUID value = 0;
    	for ( i = 0; i < numberOfItems; i++ ){
    		if([_memory loadDataForObject: self atAddress: ([self infoAddress] + PlayerField_BackPackStart + sizeof(GUID)*i) Buffer: (Byte *)&value BufLength: sizeof(value)]) {
    			[itemGUIDs addObject:[NSNumber numberWithLongLong:value]];
    		}
    	}
    	
    	return itemGUIDs;
    }
    
    // the GUIDs of the player's bags
    - (NSArray*)itemGUIDsOfBags{
    	NSMutableArray *bagGUIDs = [NSMutableArray array];
    	const int numberOfBags = 4;
    	uint i;
    	GUID value = 0;
    	for ( i = 0; i < numberOfBags; i++ ){
    		if([_memory loadDataForObject: self atAddress: ([self infoAddress] + PlayerField_BagStart + sizeof(GUID)*i) Buffer: (Byte *)&value BufLength: sizeof(value)]) {
    			[bagGUIDs addObject:[NSNumber numberWithLongLong:value]];
    		}
    	}
    	
    	return bagGUIDs;
    }
    
    // InventoryController.m
    
    // return an array of items for an array of guids
    - (NSArray*)itemsForGUIDs: (NSArray*) guids{
    	NSMutableArray *items = [NSMutableArray array];
    	
    	for ( NSNumber *guid in guids ){
    		Item *item = [self itemForGUID:[guid longLongValue]];
    		if ( item ){
    			[items addObject:item];
    		}
    	}
    	
    	return items;	
    }
    
    // return ONLY the items the player is wearing (herro % durability calculation)
    - (NSArray*)itemsPlayerIsWearing{
    	NSArray *items = [self itemsForGUIDs:[[playerData player] itemGUIDsPlayerIsWearing]];
    	return [[items retain] autorelease];	
    }
    
    // will return an array of type Item
    - (NSArray*)itemsInBags{
    	
    	// will store all of our items
    	NSMutableArray *items = [NSMutableArray array];
    	
    	// grab the GUIDs of our bags
    	NSArray *GUIDsBagsOnPlayer = [[playerData player] itemGUIDsOfBags];
    	
    	// loop through all of our items to find
    	for ( Item *item in _itemList ){
    		NSNumber *itemContainerGUID = [NSNumber numberWithLongLong:[item containerUID]];
    		
    		if ( [GUIDsBagsOnPlayer containsObject:itemContainerGUID] ){
    			[items addObject:item];
    		}
    	}
    	
    	// start with the GUIDs of the items in our backpack
    	NSArray *backpackGUIDs = [[playerData player] itemGUIDsInBackpack];
    	
    	// loop through our backpack guids
    	for ( NSNumber *guid in backpackGUIDs ){
    		Item *item = [self itemForGUID:[guid longLongValue]];
    		if ( item ){
    			[items addObject:item];
    		}
    	}
    	
    	return [[items retain] autorelease];	
    }

Similar Threads

  1. Dupe Quest items,
    By Krazzee in forum World of Warcraft Exploits
    Replies: 30
    Last Post: 12-28-2006, 02:50 PM
  2. Full Guide for Dungeon Set 1 items (all classes)
    By Cush in forum World of Warcraft Guides
    Replies: 13
    Last Post: 09-07-2006, 03:07 PM
  3. Informative WoW Items Site
    By Lonsdale in forum World of Warcraft General
    Replies: 1
    Last Post: 05-31-2006, 12:17 AM
  4. Double Disenchant items MAKE TONS OF GOLD
    By Matt in forum World of Warcraft Exploits
    Replies: 16
    Last Post: 04-05-2006, 03:07 AM
  5. Replies: 1
    Last Post: 03-20-2006, 12:16 AM
All times are GMT -5. The time now is 06:34 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