Bots: "accept" also takes quests that start from an item in the bags
A bot that loots a quest starting item (a letter, a head, a wanted note) already took that quest by itself after a few seconds. Now the owner's "accept" (and the AI bots bridge's accept) takes it at once as well, from the item, the way a player right-clicks it, and says so. A refusal gets its reason like any other accept. The snapshot keeps the item's guid so the accept can name the item as the quest giver. Quest objects (wanted boards, chests that give quests) were already in the bot's offers and need nothing new.
This commit is contained in:
@@ -1364,8 +1364,12 @@ std::string RunAction(ConfigReader::BridgeConfig const& cfg, Player* bot, Player
|
||||
auto snap = Services::Snapshots().latest(id);
|
||||
bool offered = false;
|
||||
if (snap)
|
||||
{
|
||||
for (auto const& off : snap->quest_discovery.quest_offers)
|
||||
offered = offered || off.quest_id == a.quest;
|
||||
for (auto const& si : snap->quest_discovery.quest_starting_items) // an item in my bags starts it
|
||||
offered = offered || si.quest_id == a.quest;
|
||||
}
|
||||
if (!offered)
|
||||
{
|
||||
QuestRefusal const why = API(bot).why_cant_take_quest(a.quest);
|
||||
|
||||
Reference in New Issue
Block a user