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

Allow item with FLAG_NOLIMIT

Alexandre Nadal

New Member
Joined
Jun 2, 2015
Messages
5
Reaction score
0
I'm trying to introduce a gold pouch on my 7.4 server

I added a condition in container.cpp below Container::queryAdd:

C++:
    if (getID() == ITEM_GOLD_POUCH && !hasBitSet(FLAG_NOLIMIT, flags)) {
        return RETURNVALUE_LOOTPOUCHINVALIDITEM;
    }

This condition blocks adding any item to my gold pouch, even if I buy something from an NPC, that item never goes into the gold pouch.

So far everything is fine.

But they told me that I could, via LUA, release the addition of items using FLAG_NOLIMIT, but I couldn't.

I would like to release the addition of the 3 currencies, platinum, gold and crystal.

Can someone help me?
 
TFS version?

You could either use the worth method ['items.xml attribute'] (TFS 1.5 or manually added)
C++:
    if (getID() == ITEM_GOLD_POUCH && !hasBitSet(FLAG_NOLIMIT, flags) && !item->getWorth()) {
        return RETURNVALUE_LOOTPOUCHINVALIDITEM;
    }

Or simply id checks
C++:
    if (getID() == ITEM_GOLD_POUCH && !hasBitSet(FLAG_NOLIMIT, flags)
            && (item->getID() != 2160 && item->getID() != 2152 && item->getID() != 2148)) {
        return RETURNVALUE_LOOTPOUCHINVALIDITEM;
    }

But they told me that I could, via LUA, release the addition of items using FLAG_NOLIMIT, but I couldn't.
container:addItemEx(virtualItem, INDEX_WHEREEVER, FLAG_NOLIMIT)
container:addItem(itemId, count/subType, INDEX_WHEREEVER, FLAG_NOLIMIT)
 
Back
Top