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

Ring bag

  • Thread starter Thread starter verdehile95
  • Start date Start date
V

verdehile95

Guest
Is it possible to make the ring work in a ring bag? only in ring bags, not in other bagsasdasda.webp
 
Yes, actions.cpp
C++:
bool Actions::useItem(Player* player, const Position& pos, uint8_t index, Item* item, bool isHotkey)

here you can check slot from "clicked item" and do whatever you want, like

"slot" = item->getSlotPosition()
"ringslot" = ring slotp

then write something like that

C++:
if (slot != ringslot) {
    return false;
}


@edit i think i missunderstand i'll leave a code above maybe someone will use it in future for other things
request its probably to prevent put other items than ring in "ring bag", i might edit later with solution.

@edit2
C++:
void Container::addThing(int32_t index, Thing* thing)

under:
C++:
    Item* item = thing->getItem();
    if (item == nullptr) {
        return /*RETURNVALUE_NOTPOSSIBLE*/;
    }

add

C++:
    if (this->getID() == YOUR_ID_OF_RINGBACKPACK) {
        if (!item->getSlotPosition() & SLOTP_RING) {
            return;
        }
    }
untested.
 
Last edited:

Similar threads

Back
Top