Files
mod-playerbots/src/strategy/actions/InviteToGroupAction.h
antony 274101c000 Fix crash:
PlayerbotAI::FindOilFor was making the server randomly crashing
ChooseTravelTargetAction::getNewTarget: when active bot groupping was making the server crash as looking for unexisting params

Several bug fixes and tweak to Quest and Group

New fucntionnality:
Bots will now share quests randomly to their party
Bots will try to accomplish group member quest before moving on to new target
Bots will try to sells items only after few levels ( 5 ) when in group
When dropping a quest bots will try to select a new one they are on instead of idling for few time
Bots will no longuer try to invite themselfs to group or if group is full
Bots are now allowed to leave party by themself
Bots in groupe if not leader are forbbiden to tag in bgs
Bots in bot-groups no have a more limited range to look for grind target

Polish logs
2024-07-31 12:26:48 +02:00

73 lines
1.9 KiB
C++

/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_INVITETOGROUPACTION_H
#define _PLAYERBOT_INVITETOGROUPACTION_H
#include "Action.h"
#include "Player.h"
class PlayerbotAI;
class InviteToGroupAction : public Action
{
public:
InviteToGroupAction(PlayerbotAI* botAI, std::string const name = "invite") : Action(botAI, name) { }
bool Execute(Event event) override;
virtual bool Invite(Player* player);
};
class JoinGroupAction : public InviteToGroupAction
{
public:
JoinGroupAction(PlayerbotAI* ai, std::string name = "join") : InviteToGroupAction(ai, name) {}
bool Execute(Event event) override;
bool isUseful() override { return !bot->IsBeingTeleported(); }
};
class InviteNearbyToGroupAction : public InviteToGroupAction
{
public:
InviteNearbyToGroupAction(PlayerbotAI* botAI, std::string const name = "invite nearby") : InviteToGroupAction(botAI, name) { }
bool Execute(Event event) override;
bool isUseful() override;
};
//Generic guid member finder
class FindGuildMembers
{
public:
FindGuildMembers() { };
void operator()(Player* player)
{
data.push_back(player);
};
std::vector<Player*> const GetResult()
{
return data;
};
private:
std::vector<Player*> data;
};
class InviteGuildToGroupAction : public InviteNearbyToGroupAction
{
public:
InviteGuildToGroupAction(PlayerbotAI* botAI, std::string const name = "invite guild") : InviteNearbyToGroupAction(botAI, name) { }
bool Execute(Event event) override;
bool isUseful() override;
private:
std::vector<Player*> getGuildMembers();
};
#endif