|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Support::Windows Servers Support forum for Windows EQEMu users. |

11-08-2010, 09:04 PM
|
Sarnak
|
|
Join Date: Oct 2010
Location: NYC
Posts: 39
|
|
Increase Max Item Stack Size?
I've seen servers where the max item stack size is 100, how do you increase it?
Thanks 
|

11-08-2010, 09:12 PM
|
Dragon
|
|
Join Date: Dec 2008
Location: Tennessee
Posts: 656
|
|
Just changed the field stacksize in the items table.
Example:
-- Sets the stacksize of Halas 10lb Meat Pie to 100
update items set stacksize = 100 where id = 9752;
|

11-08-2010, 10:02 PM
|
Sarnak
|
|
Join Date: Oct 2010
Location: NYC
Posts: 39
|
|
ahh i see, individually for each item eh?
thanks
is 100 the maximum you can do for stacks?
|

11-08-2010, 11:28 PM
|
Dragon
|
|
Join Date: Dec 2008
Location: Tennessee
Posts: 656
|
|
There probably is a way to do multiple items at once but I don't know how as I am not very good with sql.
I think the stacksize can go upwards of 250ish give or take. Don't hold me to that as I am not completely positive on that one.
|

07-30-2011, 08:38 PM
|
 |
Hill Giant
|
|
Join Date: Aug 2010
Location: UT
Posts: 215
|
|
I found some of the stacksizes for items in the db to be 500 or 1000. So I changed some of the other ones to be this high too, like all gems can stack up to 1000. But in game I can only stack up to 244 blue diamonds for example. Anyone know why?
|

07-30-2011, 08:57 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
StackSize in the Item_Struct is a uint8. That means 255 is as high as you can go without overflowing. As an example, if you set it to 1000 in the database it would get converted to (1000 % 256) or 232 when the item was loaded.
You could potentially change the code to allow for a different variable size, but there may also be a limit on the client side.
|

07-30-2011, 10:14 PM
|
 |
Hill Giant
|
|
Join Date: Aug 2010
Location: UT
Posts: 215
|
|
So I am kinda new with cpp. I found where the Item_struct is defined in the file item_struct.h and changed the StackSize member from uint8 to uint16 (line 208 in my code). Laying aside a possible client side limit, should that do it?
EDIT: I just re-compiled and tested this and it looks like there is no change, stacksizes are still limited to 244 (I find that amount an unusual number).
Last edited by revloc02c; 07-30-2011 at 10:31 PM..
Reason: more info
|

07-31-2011, 12:26 AM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
You would also need to change the cast in line 919 in sharededb.cpp
Code:
item.StackSize = (uint8)atoi(row[ItemField::stacksize]);
There may be other places, but that one was obvious.
Like I said earlier, the reason you see 244 is that you have it set to 500 in the database and 500 % 256 = 244. If it was 600 in the DB you'd see 88 in game, and if it was 400 in the DB you'd see 144 in game. Nothing unusual about it, just a number being truncated to fit a variable.
|

07-31-2011, 12:32 AM
|
 |
Hill Giant
|
|
Join Date: Aug 2010
Location: UT
Posts: 215
|
|
Oh I just realized why it is 244...my stacksize in the DB is 500 so [500 % 256 = 244].
EDIT: I see you beat me to it by a couple mins while I was typing the answer, nice job. And thanks for the info, I'll try that.
Last edited by revloc02c; 07-31-2011 at 12:37 AM..
Reason: clarify
|

07-31-2011, 12:47 AM
|
 |
Hill Giant
|
|
Join Date: Aug 2010
Location: UT
Posts: 215
|
|
BINGO!
That worked! Thanks lerxst I really appreciate you pointing the way for me on this.
Changing the stacksizes were not so important as making changes and having them work correctly. I recently had another success with changing the cpp code (my first success) and this has offered additional encouragement as I continue to learn this stuff. I couldn't have done it without ya.
|

08-01-2011, 05:59 PM
|
 |
Hill Giant
|
|
Join Date: Aug 2010
Location: UT
Posts: 215
|
|
This actually is not working correctly yet. I can stack things above 256 now, but then when I zone the items I put on the stack beyond the former limit end up on my cursor when I respawn in the new zone.
E.g.: My stacksizes were previously maxing out at 244. I had a stack of 244 blue diamonds. After I changed the uint8 to a uint16 I summoned 100 blue diamonds and auto-inventory-ed them and voila stack went to 344, except when I zoned, 100 blue diamonds ended up on my cursor and my stack of blue diamonds in inventory was back to a stack of 244.
So somehow the stacksizes in inventory are not saving?
Or maybe this is the client-side issue lerxst referred to? If so, is there a way to fix it or is that just how Titanium is?
Last edited by revloc02c; 08-01-2011 at 06:01 PM..
Reason: corrected spelling
|

08-01-2011, 06:33 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
There may be other places in the code that need to be changed. You'll probably have to examine each use of StackSize and see if it is being cast or assigned to a smaller variable size.
IMO, set them all to 250 and move on. I don't see the benefit being worth the work.
As an example, all of these functions may be suspect:
Code:
// Remove item from inventory
bool DeleteItem(sint16 slot_id, uint8 quantity=0);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
sint16 HasItem(uint32 item_id, uint8 quantity=0, uint8 where=0xFF);
// Check whether there is space for the specified number of the specified item.
bool HasSpaceForItem(const Item_Struct *ItemToTry, uint8 Quantity);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
sint16 HasItemByUse(uint8 use, uint8 quantity=0, uint8 where=0xFF);
|

08-01-2011, 07:15 PM
|
 |
Hill Giant
|
|
Join Date: Aug 2010
Location: UT
Posts: 215
|
|
Quote:
Originally Posted by lerxst2112
There may be other places in the code that need to be changed. You'll probably have to examine each use of StackSize and see if it is being cast or assigned to a smaller variable size.
|
I see.
Quote:
Originally Posted by lerxst2112
IMO, set them all to 250 and move on. I don't see the benefit being worth the work.
|
I agree.
Quote:
Originally Posted by lerxst2112
As an example, all of these functions may be suspect:
|
This is good info to have if ever I get bored and want to try this again (if I ever do, I will post my findings here).
I appreciate it lerxst, you've been very helpful.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 02:22 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |