• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Anty-Stack Runes - minCount, maxCount in Items.xml attribute?

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,837
Solutions
18
Reaction score
614
Location
Poland
Hello there!
I have a problem with making that runes on TFS 1.X+ not stackable.
I done everything with adding in sources near all functions that can stack runes simple: !item->isRune() but Im stuck at one thing.
If player already got ex. 5 runes in EQ (EQ means slots not backpack) and trying to make more rune, the rune that player is going to make instantly dissapear.
I think I should fix that by putting attribute minCount, maxCount in items.xml or something like that but i have no clue how to add this.

Anyone who got huge knowledge about sources (C++) can help me with that request?
I will be very glad if you can do something about that and share part of codes or something.

Thanks in advance,
Fresh.
 
Solution
Did you modify these parts of code:
1. make item not stackable when add to slot, tell server that it needs to replace (exchange places) item to add it to that slot:
otland/forgottenserver

2. return 'stack empty space = 0' (maxQueryCount) when add to slot with item in this slot, default is '100 - items alreade in slot':
otland/forgottenserver

They are responsible for 'trying' to stack runes.
So if you blocked 'real stack' (addThing), but left 'is stack possbile' (queryDestination, queryAdd, queryMaxCount) it thinks it can stack item.

In case of 'create rune function', you need to debug simple 'player:addItem(2293, 3)':
otland/forgottenserver
Which executes:
otland/forgottenserver
which executes...
So you want they to be not stackable, but possible to create with some count (like GFB x5)?
If you leave them 'stackable' in Tibia.dat client will still show 'select count' window wheny you drag and drop rune.
If you set them 'not stackable' in Tibia.dat client won't show their count and probably it will crash, because of invalid game protocol (client expects server to not send count of items not stackable).

To make it work like this, you need old tibia client (up to 8.54 as I remember), which had option 'rune' in .dat = show count of item in backpack (of item that is not stackable).

In case you got proper client you need to change:

1. make item not stackable when add to slot, tell server that it needs to replace (exchange places) item to add it to that slot:
otland/forgottenserver

2. return 'stack empty space = 0' (maxQueryCount) when add to slot with item in this slot, default is '100 - items alreade in slot':
otland/forgottenserver
 
So you want they to be not stackable, but possible to create with some count (like GFB x5)?
If you leave them 'stackable' in Tibia.dat client will still show 'select count' window wheny you drag and drop rune.
If you set them 'not stackable' in Tibia.dat client won't show their count and probably it will crash, because of invalid game protocol (client expects server to not send count of items not stackable).

To make it work like this, you need old tibia client (up to 8.54 as I remember), which had option 'rune' in .dat = show count of item in backpack (of item that is not stackable).

In case you got proper client you need to change:

1. make item not stackable when add to slot, tell server that it needs to replace (exchange places) item to add it to that slot:
otland/forgottenserver

2. return 'stack empty space = 0' (maxQueryCount) when add to slot with item in this slot, default is '100 - items alreade in slot':
otland/forgottenserver


Sended you PM, please read :( :D
 
I have done everything with stacks done in C++ with using item->isRune() attribute and stacking is poorly done without any errors but last error stayed in.

For example what last error i have:
output_4xSSBq.gif
What is should be like without errors:
HOEqQtH.png


And this error only occured when player got ex. HMM in hand and trying to convince one more rune in backpack / whatever.
When player got both hands and arrow slot equipped with items and trying to convince runes in backpack (got blank runes in backpack) everything is working good.

The problem is only when player already got HMM rune in hands/arrow slot.
 
Did you modify these parts of code:
1. make item not stackable when add to slot, tell server that it needs to replace (exchange places) item to add it to that slot:
otland/forgottenserver

2. return 'stack empty space = 0' (maxQueryCount) when add to slot with item in this slot, default is '100 - items alreade in slot':
otland/forgottenserver

They are responsible for 'trying' to stack runes.
So if you blocked 'real stack' (addThing), but left 'is stack possbile' (queryDestination, queryAdd, queryMaxCount) it thinks it can stack item.

In case of 'create rune function', you need to debug simple 'player:addItem(2293, 3)':
otland/forgottenserver
Which executes:
otland/forgottenserver
which executes ('toCylinder' = player):
queryDestination
queryAdd

I'm 99% sure that your 'queryDestination' returns already existing HMM rune as 'itemTo' and then it tries to add item to it (stack).

Probably you just need to add '&& !item->isRune()' to:
otland/forgottenserver
 
Solution
I fixed the bug with not conjuring runes properly
but last bug that i have is in INVENTORY window

When player got rune and trying to move on different rune it overwrite the rune that player is moving on

and the
Probably you just need to add '&& !item->isRune()' to:
otland/forgottenserver
Won't fixed that problem i checked it now and zero fix :p
 
And i tested it and it's only overwrite the rune with the same ID , ex -> HMM overwrite HMM's and SD's not overwrite HMM's , etc.
 
I fixed the bug with not conjuring runes properly
but last bug that i have is in INVENTORY window

When player got rune and trying to move on different rune it overwrite the rune that player is moving on

and the

Won't fixed that problem i checked it now and zero fix :p
Check this:
otland/forgottenserver
otland/forgottenserver
It should be responsible for 'stacking' items when you drop item X on other item with same itemid in container.
 
Fixed ALL. // close thread plz.
Thanks GESIOR for little help :p
Soon I will post this feature to anyone on OT.
Stay tuned! :)
 
Back
Top