• 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!

I have this stack problem at an 8.0

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
507
Reaction score
68
Hello again here bothering xD, I changed the ot to be able to stack the runes and the mana fluids, I want to have the runes and manas all stacks,
This OTSERVER I'm using:
GitHub - Brunowots/RealMap-Global-8.0-TFS1.2 (https://github.com/Brunowots/RealMap-Global-8.0-TFS1.2)
in one part of the Config.lua is the autostackitem option
Lua:
allowChangeOutfit = true
freePremium = true
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = true
classicAttackSpeed = true
autoStackItems = true
displayLootMessage = true
summonsDropCorpse = true
Untitled ‑ Made with FlexClip.gif
in the ObjectBuilder, in the item part in the runes I put stackable, but when I buy a blank rune, it must sell me 1 gives me 160 blank rune, and when I create the rune it gives me only one rune
In items.xml this is how the runes are:
XML:
<item id="2265" article="an" name="intense healing rune">
        <attribute key="type" value="rune" />
        <attribute key="runeSpellName" value="adura gran" />
        <attribute key="weight" value="210" />
        <attribute key="charges" value="1" />
    </item>
What can I do so that the runes and potions can be stacked?
Post automatically merged:

Hello again here bothering xD, I changed the ot to be able to stack the runes and the mana fluids, I want to have the runes and manas all stacks,
This OTSERVER I'm using:
GitHub - Brunowots/RealMap-Global-8.0-TFS1.2 (https://github.com/Brunowots/RealMap-Global-8.0-TFS1.2)
in one part of the Config.lua is the autostackitem option
Lua:
allowChangeOutfit = true
freePremium = true
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = true
classicAttackSpeed = true
autoStackItems = true
displayLootMessage = true
summonsDropCorpse = true
Untitled ‑ Made with FlexClip.gif
in the ObjectBuilder, in the item part in the runes I put stackable, but when I buy a blank rune, it must sell me 1 gives me 160 blank rune, and when I create the rune it gives me only one rune
In items.xml this is how the runes are:
XML:
<item id="2265" article="an" name="intense healing rune">
        <attribute key="type" value="rune" />
        <attribute key="runeSpellName" value="adura gran" />
        <attribute key="weight" value="210" />
        <attribute key="charges" value="1" />
    </item>
What can I do so that the runes and potions can be stacked?
Post automatically merged:

Hello again here bothering xD, I changed the ot to be able to stack the runes and the mana fluids, I want to have the runes and manas all stacks,
This OTSERVER I'm using:
GitHub - Brunowots/RealMap-Global-8.0-TFS1.2 (https://github.com/Brunowots/RealMap-Global-8.0-TFS1.2)
in one part of the Config.lua is the autostackitem option
Lua:
allowChangeOutfit = true
freePremium = true
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = true
classicAttackSpeed = true
autoStackItems = true
displayLootMessage = true
summonsDropCorpse = true
Untitled ‑ Made with FlexClip.gif
in the ObjectBuilder, in the item part in the runes I put stackable, but when I buy a blank rune, it must sell me 1 gives me 160 blank rune, and when I create the rune it gives me only one rune
In items.xml this is how the runes are:
XML:
<item id="2265" article="an" name="intense healing rune">
        <attribute key="type" value="rune" />
        <attribute key="runeSpellName" value="adura gran" />
        <attribute key="weight" value="210" />
        <attribute key="charges" value="1" />
    </item>
What can I do so that the runes and potions can be stacked?
Post automatically merged:
I was able to stack the runes well, the only problem I have now is that I can't separate them, for example if I have 50 and I want to put 30 in another BP, it passes the 50 directly to you. And if I do SDS it makes both charges but you can't put them together with the other runes created
View attachment 79555
 
Last edited:
You can remove the check for isRune() in containers.cpp check this line:


and this line:



Then remove the checks

C++:
&& !containerItem->isRune()

and

C++:
&& !destItem->isRune()


Or replace the entire ReturnValue Container::queryMaxCount code for:
C++:
ReturnValue Container::queryMaxCount(int32_t index, const Thing& thing, uint32_t count,
        uint32_t& maxQueryCount, uint32_t flags) const
{
    const Item* item = thing.getItem();
    if (item == nullptr) {
        maxQueryCount = 0;
        return RETURNVALUE_NOTPOSSIBLE;
    }

    if (hasBitSet(FLAG_NOLIMIT, flags)) {
        maxQueryCount = std::max<uint32_t>(1, count);
        return RETURNVALUE_NOERROR;
    }

    int32_t freeSlots = std::max<int32_t>(capacity() - size(), 0);

    if (item->isStackable()) {
        uint32_t n = 0;

        if (index == INDEX_WHEREEVER) {
            //Iterate through every item and check how much free stackable slots there is.
            uint32_t slotIndex = 0;
            for (Item* containerItem : itemlist) {
                if (containerItem != item && containerItem->equals(item) && containerItem->getItemCount() < 100) {
                    if (queryAdd(slotIndex++, *item, count, flags) == RETURNVALUE_NOERROR) {
                        n += 100 - containerItem->getItemCount();
                    }
                }
            }
        } else {
            const Item* destItem = getItemByIndex(index);
            if (item->equals(destItem) && destItem->getItemCount() < 100) {
                if (queryAdd(index, *item, count, flags) == RETURNVALUE_NOERROR) {
                    n = 100 - destItem->getItemCount();
                }
            }
        }

        maxQueryCount = freeSlots * 100 + n;
        if (maxQueryCount < count) {
            return RETURNVALUE_CONTAINERNOTENOUGHROOM;
        }
    } else {
        maxQueryCount = freeSlots;
        if (maxQueryCount == 0) {
            return RETURNVALUE_CONTAINERNOTENOUGHROOM;
        }
    }
    return RETURNVALUE_NOERROR;
}


I hope I've helped
 
You can remove the check for isRune() in containers.cpp check this line:


and this line:



Then remove the checks

C++:
&& !containerItem->isRune()

and

C++:
&& !destItem->isRune()


Or replace the entire ReturnValue Container::queryMaxCount code for:
C++:
ReturnValue Container::queryMaxCount(int32_t index, const Thing& thing, uint32_t count,
        uint32_t& maxQueryCount, uint32_t flags) const
{
    const Item* item = thing.getItem();
    if (item == nullptr) {
        maxQueryCount = 0;
        return RETURNVALUE_NOTPOSSIBLE;
    }

    if (hasBitSet(FLAG_NOLIMIT, flags)) {
        maxQueryCount = std::max<uint32_t>(1, count);
        return RETURNVALUE_NOERROR;
    }

    int32_t freeSlots = std::max<int32_t>(capacity() - size(), 0);

    if (item->isStackable()) {
        uint32_t n = 0;

        if (index == INDEX_WHEREEVER) {
            //Iterate through every item and check how much free stackable slots there is.
            uint32_t slotIndex = 0;
            for (Item* containerItem : itemlist) {
                if (containerItem != item && containerItem->equals(item) && containerItem->getItemCount() < 100) {
                    if (queryAdd(slotIndex++, *item, count, flags) == RETURNVALUE_NOERROR) {
                        n += 100 - containerItem->getItemCount();
                    }
                }
            }
        } else {
            const Item* destItem = getItemByIndex(index);
            if (item->equals(destItem) && destItem->getItemCount() < 100) {
                if (queryAdd(index, *item, count, flags) == RETURNVALUE_NOERROR) {
                    n = 100 - destItem->getItemCount();
                }
            }
        }

        maxQueryCount = freeSlots * 100 + n;
        if (maxQueryCount < count) {
            return RETURNVALUE_CONTAINERNOTENOUGHROOM;
        }
    } else {
        maxQueryCount = freeSlots;
        if (maxQueryCount == 0) {
            return RETURNVALUE_CONTAINERNOTENOUGHROOM;
        }
    }
    return RETURNVALUE_NOERROR;
}


I hope I've helped
01.png


Directly copy all the code you have given me. that starts at the 309, compile it and it still has the same error
Untitled ‑ Made with FlexClip (1).gif
 
Directly copy all the code you have given me. that starts at the 309, compile it and it still has the same error

Ok i miss the game.cpp part check line 1017 and change_

C++:
ReturnValue ret = internalMoveItem(fromCylinder, toCylinder, toIndex, item, item->isRune() ? item->getItemCount() : count, nullptr, 0, player);

for:

C++:
ReturnValue ret = internalMoveItem(fromCylinder, toCylinder, toIndex, item, count, nullptr, 0, player);


- Then search line 1091 :

and change:
C++:
if (item->isStackable()) {
    if (item->isRune()) {
        m = std::min<uint32_t>(item->getItemCount(), maxQueryCount);
    } else {
        m = std::min<uint32_t>(count, maxQueryCount);
    }
} else {
    m = maxQueryCount;
}

to this :
C++:
    if (item->isStackable()) {
        m = std::min<uint32_t>(count, maxQueryCount);
    } else {
        m = maxQueryCount;
    }


- Again search the line 1133and change:

C++:
 if (!item->isRune() && item->equals(toItem)) {
for :

C++:
if (item->equals(toItem)) {


- Go to line 1232 and do the same for:

C++:
if (item->isStackable() && !item->isRune() && item->equals(toItem)) {

change for this:

C++:
if (item->isStackable() && item->equals(toItem)) {


- Now go to player.cpp and search the line 2376

- Then change:

C++:
if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->isRune() || inventoryItem->getID() != item->getID())) {

for:
C++:
if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->getID() != item->getID())) {

- Go to the line 2445 and change:

C++:
if (!destItem->isRune() && destItem->isStackable() && item->equals(destItem) && destItem->getItemCount() < 100) {

for:

C++:
if (destItem->isStackable() && item->equals(destItem) && destItem->getItemCount() < 100) {



- Search for the line 2503 and change:

C++:
bool isStackable = item->isStackable() && !item->isRune();

for this:

C++:
bool isStackable = item->isStackable();



i've attached the files for this BASE if u have problems with the procedure
 

Attachments

Last edited:
Ok i miss the game.cpp part check line 1017 and change_

C++:
ReturnValue ret = internalMoveItem(fromCylinder, toCylinder, toIndex, item, item->isRune() ? item->getItemCount() : count, nullptr, 0, player);

for:

C++:
ReturnValue ret = internalMoveItem(fromCylinder, toCylinder, toIndex, item, count, nullptr, 0, player);


- Then search line 1091 :

and change:
C++:
if (item->isStackable()) {
    if (item->isRune()) {
        m = std::min<uint32_t>(item->getItemCount(), maxQueryCount);
    } else {
        m = std::min<uint32_t>(count, maxQueryCount);
    }
} else {
    m = maxQueryCount;
}

to this :
C++:
    if (item->isStackable()) {
        m = std::min<uint32_t>(count, maxQueryCount);
    } else {
        m = maxQueryCount;
    }


- Again search the line 1133and change:

C++:
 if (!item->isRune() && item->equals(toItem)) {
for :

C++:
if (item->equals(toItem)) {


- Go to line 1232 and do the same for:

C++:
if (item->isStackable() && !item->isRune() && item->equals(toItem)) {

change for this:

C++:
if (item->isStackable() && item->equals(toItem)) {


- Now go to player.cpp and search the line 2376

- Then change:

C++:
if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->isRune() || inventoryItem->getID() != item->getID())) {

for:
C++:
if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->getID() != item->getID())) {

- Go to the line 2445 and change:

C++:
if (!destItem->isRune() && destItem->isStackable() && item->equals(destItem) && destItem->getItemCount() < 100) {

for:

C++:
if (destItem->isStackable() && item->equals(destItem) && destItem->getItemCount() < 100) {



- Search for the line 2503 and change:

C++:
bool isStackable = item->isStackable() && !item->isRune();

for this:

C++:
bool isStackable = item->isStackable();



i've attached the files for this BASE if u have problems with the procedure
I was able to fix it! I kept changing line by line, because I had replaced the files you uploaded but I got an error when compiling, I did it manually and it worked! Thank you so much brother!
Untitled ‑ Made with FlexClip (2).gif
 
Back
Top