mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Tweak automation
This commit is contained in:
@@ -47,6 +47,27 @@ bool SmartDestroyItemAction::Execute(Event event)
|
||||
if (bagSpace < 90)
|
||||
return false;
|
||||
|
||||
// only destoy grey items if with real player/guild
|
||||
if (botAI->HasRealPlayerMaster() && botAI->IsInRealGuild())
|
||||
{
|
||||
std::set<Item*> items;
|
||||
FindItemsToTradeByQualityVisitor visitor(ITEM_QUALITY_POOR, 5);
|
||||
IterateItems(&visitor, ITERATE_ITEMS_IN_BAGS);
|
||||
items.insert(visitor.GetResult().begin(), visitor.GetResult().end());
|
||||
|
||||
for (auto& item : items)
|
||||
{
|
||||
FindItemByIdVisitor visitor(item->GetTemplate()->ItemId);
|
||||
DestroyItem(&visitor);
|
||||
|
||||
bagSpace = AI_VALUE(uint8, "bag space");
|
||||
|
||||
if (bagSpace < 90)
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<uint32> bestToDestroy = { ITEM_USAGE_NONE }; //First destroy anything useless.
|
||||
|
||||
if (!AI_VALUE(bool, "can sell") && AI_VALUE(bool, "should get money")) // We need money so quest items are less important since they can't directly be sold.
|
||||
|
||||
Reference in New Issue
Block a user