luanmaximus123
New Member
- Joined
- Oct 28, 2010
- Messages
- 11
- Reaction score
- 1
Hi everyone, I'm currently using @login12's auto-loot and I would like to know if it's possible for the items to go to a specific container instead of any backpack/container. Additionally, if it's possible to check beforehand if the player has that specific item/container and if there's enough space in that container for the items.
Modification made in actions.cpp for autoloot:
I believe it's here:
Modification made in actions.cpp for autoloot:
Lua:
if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) {
return RETURNVALUE_YOUARENOTTHEOWNER;
} else {
if (player->canOpenCorpse(corpseOwner) && player->autoLootList.size() != 0) {
if (player->getCapacity() > 100 * 100) { //Minimum of Capacity for autoloot works. (100 CAP)
for (Item* item : container->getItemList()) {
if (player->getItemFromAutoLoot(item->getID())) {
std::ostringstream msgAutoLoot;
msgAutoLoot << "You looted a " << item->getItemCount() << "x " << item->getName() << ".";
g_game.internalMoveItem(container, player, CONST_SLOT_WHEREEVER, item, item->getItemCount(), nullptr);
player->sendTextMessage(MESSAGE_INFO_DESCR, msgAutoLoot.str());
}
}
} else {
player->sendTextMessage(MESSAGE_INFO_DESCR, "Sorry, you don't have enough capacity to use auto loot, so it has been disabled. (100+ capacity is required)");
}
}
}
I believe it's here:
Code:
g_game.internalMoveItem(container, player, CONST_SLOT_WHEREEVER, item, item->getItemCount(), nullptr);