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

C++ auto loot corpse item remove

Xandress

Active Member
Joined
Apr 21, 2020
Messages
65
Reaction score
37
Hi, I couldn't find a solution for my problem.

Im trying to edit the autoloot to make it work with item level
C++:
if (owner->getAutoLootItem(item->getID())) {
    g_game.internalPlayerAddItem(owner, item, true, CONST_SLOT_WHEREEVER);
    autolooted = autolooted + ", " + item->getNameDescription();
} else if (g_game.internalAddItem(corpse, item) != RETURNVALUE_NOERROR) {
    corpse->internalAddThing(item);
}

in this case auto looted items got item level 0, when creating item first

C++:
if (owner->getAutoLootItem(item->getID())) {
    g_game.internalAddItem(corpse, item);
    g_game.internalPlayerAddItem(owner, item, true, CONST_SLOT_WHEREEVER);
    autolooted = autolooted + ", " + item->getNameDescription();
} else if (g_game.internalAddItem(corpse, item) != RETURNVALUE_NOERROR) {
    corpse->internalAddThing(item);
}

creates two items, one item goes to player (with proper item level) and seccond item is still in the corpse.

Using
C++:
g_game.internalMoveItem()
does give an item to backpack but with item level 0

When trying to remove the item the server crash. Any ideas?
 
Since there is no such method getAutoLootItem in the official TFS repository. I am assuming this is a modification from somewhere.
Because you haven't given any reference to the origin of this modification, people are unable to test this and reproduce your problem.
If you wish for a better response than this, do provide a link (in case someone wants to test this on their machine).
 
Sorry, my bad, you dont have to know this method

This is the autoloot im using

And item levels based on

TFS 1.3
 
Back
Top