Bag ID's in character_items

General support forum. If you require assistance and your problem doesnt fall in any of the other categories, this is the forum for you!

Moderator: Team Members

Forum rules
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Bag ID's in character_items

Post by John Adams » Fri Jan 02, 2009 6:16 pm

LE, what is the logic behind the bag_id value? is it random, or some method to it? I am trying to create starting_items with the food/water inside LE's huge sack (grin) but wanted to make sure any value I put would work without breaking anything.

I'm trying to back-fill starting_items to existing characters and not having any luck with things showing up in bag_id 1, slot 0 and 1 (the food and water). I've done this before, I just can't seem to recall how I did it. :D

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Bag ID's in character_items

Post by LethalEncounter » Fri Jan 02, 2009 6:41 pm

If you delete all the entries from character_items and then set up starting_items as you want, the next time the player logs in they will automatically get the items as specified in your starting_items table. However, to answer your original question the bag_id field is the id of the bag that the particular item is in. The bag_id field is 0 if it is a bag and it is in an inventory slot. The field can also be negative in special cases such as bank slots.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Bag ID's in character_items

Post by John Adams » Fri Jan 02, 2009 6:52 pm

Ahh, maybe that's what it was. Nuke the character_items and let starting_items just do it's magic.

I was asking where the actual bag_id value comes from... if that is randomly generated or not, because it seems to be all over the map. For instance, my LE bag was bag_id 18 before the wipe. Now, that same bag in the same slot is bag_id 80744, neither of which are the item_id of the bag itself. Does that make more sense?

Either way, I won't bother forcing anything into a slot with SQL, I'll let World handle the job. :)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Bag ID's in character_items

Post by LethalEncounter » Fri Jan 02, 2009 7:23 pm

Bah, listen to what I'm saying :P

The value of the bag_id field is the ID in the character_items table of the bag.

Examples:

Code: Select all

id   	 type   	 account_id   	 char_id   	 bag_id   	 slot   	 item_id   	 creator   	 condition_   	 attuned   	 count   	 max_sell_value
1    NOT-EQUIPPED    0    750    0    0    1    LethalEncounter  	100  	0  	1  	0
2 	NOT-EQUIPPED 	0 	750 	1 	0 	40198 	  	                100 	0 	20 	0
3 	NOT-EQUIPPED 	0 	750 	1 	1 	39908 	  	                100 	0 	20 	0

4 	NOT-EQUIPPED 	0 	396 	0 	0 	1 	LethalEncounter 	100 	0 	1 	0
5 	NOT-EQUIPPED 	0 	396 	4 	0 	40198 	  	                100 	0 	20 	0
6 	NOT-EQUIPPED 	0 	396 	4 	1 	39908 	  	                100 	0 	20 	0

Look at the entry with the ID of 1 in the first example. That is the bag and it is in the first slot of the inventory (bag_id is 0 so in inventory, and slot is 0 so it is the first slot). Now look at the entries with IDs of 2 and 3. The 1 in the bag_id field means that the bag they are in is the entry in the character_items table with the id of 1.

The second example is the same, the 4 is the unique id of the bag, which is why that is in the bag_id field for all items inside the bag.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Bag ID's in character_items

Post by John Adams » Fri Jan 02, 2009 7:47 pm

Heh, believe it or not, I already get that part.

But nevermind. What I was looking for is unnecessary anyway, so I will stop trying to explain my twisted questions =)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests