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:
@@ -309,6 +309,10 @@ bool DisEnchantRandomItemAction::Execute(Event event)
|
|||||||
|
|
||||||
for (auto& item: items)
|
for (auto& item: items)
|
||||||
{
|
{
|
||||||
|
// don't touch rare+ items if with real player/guild
|
||||||
|
if ((botAI->HasRealPlayerMaster() || botAI->IsInRealGuild()) && item->GetTemplate()->Quality > ITEM_QUALITY_UNCOMMON)
|
||||||
|
return false;
|
||||||
|
|
||||||
if(CastCustomSpellAction::Execute(Event("disenchant random item", "13262 "+ chat->FormatQItem(item->GetEntry()))))
|
if(CastCustomSpellAction::Execute(Event("disenchant random item", "13262 "+ chat->FormatQItem(item->GetEntry()))))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,27 @@ bool SmartDestroyItemAction::Execute(Event event)
|
|||||||
if (bagSpace < 90)
|
if (bagSpace < 90)
|
||||||
return false;
|
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.
|
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.
|
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.
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ bool GuildManageNearbyAction::Execute(Event event)
|
|||||||
Guild::Member* member = guild->GetMember(player->GetGUID());
|
Guild::Member* member = guild->GetMember(player->GetGUID());
|
||||||
uint32 dCount = AI_VALUE(uint32, "death count");
|
uint32 dCount = AI_VALUE(uint32, "death count");
|
||||||
|
|
||||||
if (dCount < 2 || !urand(0, 10))
|
if ((dCount < 2 || !urand(0, 10)) && guild->GetRankRights(botMember->GetRankId() & GR_RIGHT_PROMOTE))
|
||||||
{
|
{
|
||||||
if (!urand(0, 10))
|
if (!urand(0, 10))
|
||||||
{
|
{
|
||||||
@@ -173,7 +173,7 @@ bool GuildManageNearbyAction::Execute(Event event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dCount > 3 || !urand(0, 10))
|
if ((dCount > 3 || !urand(0, 10)) && guild->GetRankRights(botMember->GetRankId() & GR_RIGHT_DEMOTE))
|
||||||
{
|
{
|
||||||
if (!urand(0, 10))
|
if (!urand(0, 10))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ bool LeaveLargeGuildTrigger::IsActive()
|
|||||||
if (botAI->IsAlt())
|
if (botAI->IsAlt())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (botAI->IsInRealGuild())
|
||||||
|
return false;
|
||||||
|
|
||||||
GuilderType type = botAI->GetGuilderType();
|
GuilderType type = botAI->GetGuilderType();
|
||||||
|
|
||||||
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
|
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
|
||||||
@@ -34,7 +37,7 @@ bool LeaveLargeGuildTrigger::IsActive()
|
|||||||
Player* leader = ObjectAccessor::FindPlayer(guild->GetLeaderGUID());
|
Player* leader = ObjectAccessor::FindPlayer(guild->GetLeaderGUID());
|
||||||
|
|
||||||
//Only leave the guild if we know the leader is not a real player.
|
//Only leave the guild if we know the leader is not a real player.
|
||||||
if (!leader)
|
if (!leader || !GET_PLAYERBOT_AI(leader) || !GET_PLAYERBOT_AI(leader)->IsRealPlayer())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PlayerbotAI* leaderBotAI = GET_PLAYERBOT_AI(leader);
|
PlayerbotAI* leaderBotAI = GET_PLAYERBOT_AI(leader);
|
||||||
|
|||||||
Reference in New Issue
Block a user