Merge pull request #367 from liyunfan1223/self-command

Fix .playerbot bot self
This commit is contained in:
Yunfan Li
2024-07-24 12:27:56 +08:00
committed by GitHub
13 changed files with 68 additions and 43 deletions

View File

@@ -19,7 +19,7 @@ bool InviteToGroupAction::Execute(Event event)
bool InviteToGroupAction::Invite(Player* player)
{
if (!player)
if (!player || !player->IsInWorld())
return false;
if (!GET_PLAYERBOT_AI(player) && !botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_INVITE, true, player))

View File

@@ -74,7 +74,7 @@ bool SellAction::Execute(Event event)
return true;
}
if (text == "all")
if (text != "")
{
std::vector<Item *> items = parseItems(text, ITERATE_ITEMS_IN_BAGS);
for (Item *item : items)
@@ -84,7 +84,7 @@ bool SellAction::Execute(Event event)
return true;
}
botAI->TellError("Usage: s gray/*/vendor/all");
botAI->TellError("Usage: s gray/*/vendor/[item link]");
return false;
}

View File

@@ -172,6 +172,7 @@ bool MaintenanceAction::Execute(Event event)
factory.ApplyEnchantAndGemsNew();
}
bot->DurabilityRepairAll(false, 1.0f, false);
bot->SendTalentsInfoData(false);
return true;
}
@@ -181,6 +182,7 @@ bool RemoveGlyphAction::Execute(Event event)
{
bot->SetGlyph(slotIndex, 0, true);
}
bot->SendTalentsInfoData(false);
return true;
}