quest share

This commit is contained in:
Yunfan Li
2023-12-18 20:29:48 +08:00
parent 493be84f56
commit 3c2bc1c959
4 changed files with 11 additions and 3 deletions

View File

@@ -134,7 +134,7 @@ PlayerbotAI::PlayerbotAI(Player* bot) : PlayerbotAIBase(true), bot(bot), chatHel
masterIncomingPacketHandlers.AddHandler(CMSG_TAXICLEARNODE, "taxi done");
masterIncomingPacketHandlers.AddHandler(CMSG_GROUP_UNINVITE, "uninvite");
masterIncomingPacketHandlers.AddHandler(CMSG_GROUP_UNINVITE_GUID, "uninvite guid");
// masterIncomingPacketHandlers.AddHandler(CMSG_PUSHQUESTTOPARTY, "quest share");
masterIncomingPacketHandlers.AddHandler(CMSG_PUSHQUESTTOPARTY, "quest share");
masterIncomingPacketHandlers.AddHandler(CMSG_LFG_TELEPORT, "lfg teleport");
masterIncomingPacketHandlers.AddHandler(CMSG_CAST_SPELL, "see spell");
masterIncomingPacketHandlers.AddHandler(CMSG_REPOP_REQUEST, "release spirit");

View File

@@ -88,6 +88,14 @@ bool AcceptQuestShareAction::Execute(Event event)
return false;
quest = qInfo->GetQuestId();
if (bot->HasQuest(quest))
{
bot->SetDivider(ObjectGuid::Empty);
botAI->TellError("I have this quest");
return false;
}
if (!bot->CanTakeQuest(qInfo, false))
{
// can't take quest

View File

@@ -14,7 +14,7 @@ void QuestStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
PassTroughStrategy::InitTriggers(triggers);
// triggers.push_back(new TriggerNode("quest share", NextAction::array(0, new NextAction("accept quest share", relevance), nullptr)));
triggers.push_back(new TriggerNode("quest share", NextAction::array(0, new NextAction("accept quest share", relevance), nullptr)));
}
void DefaultQuestStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -660,7 +660,7 @@ class NewPlayerNearbyTrigger : public Trigger
class CollisionTrigger : public Trigger
{
public:
CollisionTrigger(PlayerbotAI* botAI) : Trigger(botAI, "collision", 5) { }
CollisionTrigger(PlayerbotAI* botAI) : Trigger(botAI, "collision", 5 * 1000) { }
bool IsActive() override;
};