mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-18 03:05:43 +00:00
Merge branch 'master' of github.com:liyunfan1223/mod-playerbots
This commit is contained in:
@@ -337,7 +337,7 @@ bool AutoSetTalentsAction::Execute(Event event)
|
||||
|
||||
PlayerbotFactory factory(bot, bot->GetLevel());
|
||||
factory.InitTalentsTree(true, true, true);
|
||||
|
||||
factory.InitPetTalents();
|
||||
botAI->TellMaster(out);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -179,7 +179,7 @@ bool QuestAction::AcceptQuest(Quest const* quest, ObjectGuid questGiver)
|
||||
p.rpos(0);
|
||||
bot->GetSession()->HandleQuestgiverAcceptQuestOpcode(p);
|
||||
|
||||
if (bot->GetQuestStatus(questId) == QUEST_STATUS_NONE && !sPlayerbotAIConfig->syncQuestWithPlayer)
|
||||
if (bot->GetQuestStatus(questId ) == QUEST_STATUS_NONE && sPlayerbotAIConfig->syncQuestWithPlayer)
|
||||
{
|
||||
Object* pObject = ObjectAccessor::GetObjectByTypeMask(*bot, questGiver, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM);
|
||||
bot->AddQuest(quest, pObject);
|
||||
@@ -191,6 +191,7 @@ bool QuestAction::AcceptQuest(Quest const* quest, ObjectGuid questGiver)
|
||||
botAI->TellMaster(out);
|
||||
return true;
|
||||
}
|
||||
out << "Cannot accept";
|
||||
}
|
||||
|
||||
out << " " << chat->FormatQuest(quest);
|
||||
|
||||
@@ -13,6 +13,9 @@ bool QuestConfirmAcceptAction::Execute(Event event)
|
||||
if (!quest || !bot->CanAddQuest(quest, true)) {
|
||||
return false;
|
||||
}
|
||||
std::ostringstream out;
|
||||
out << "Quest: " << chat->FormatQuest(quest) << " confirm accept";
|
||||
botAI->TellMaster(out);
|
||||
bot->GetSession()->HandleQuestConfirmAccept(sendPacket);
|
||||
return true;
|
||||
}
|
||||
@@ -16,10 +16,10 @@ class Player;
|
||||
class PlayerbotAI;
|
||||
class WorldObject;
|
||||
|
||||
class QuestConfirmAcceptAction : public QuestAction
|
||||
class QuestConfirmAcceptAction : public Action
|
||||
{
|
||||
public:
|
||||
QuestConfirmAcceptAction(PlayerbotAI* botAI) : QuestAction(botAI, "quest confirm accept") {}
|
||||
QuestConfirmAcceptAction(PlayerbotAI* botAI) : Action(botAI, "quest confirm accept") {}
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "ItemUsageValue.h"
|
||||
#include "Object.h"
|
||||
#include "Playerbots.h"
|
||||
#include "QuestDef.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
void TalkToQuestGiverAction::ProcessQuest(Quest const* quest, Object* questGiver)
|
||||
@@ -238,6 +239,7 @@ bool TurnInQueryQuestAction::Execute(Event event)
|
||||
}
|
||||
}
|
||||
std::ostringstream out;
|
||||
out << "Quest ";
|
||||
switch (status)
|
||||
{
|
||||
case QUEST_STATUS_COMPLETE:
|
||||
@@ -252,6 +254,9 @@ bool TurnInQueryQuestAction::Execute(Event event)
|
||||
case QUEST_STATUS_FAILED:
|
||||
out << "|cffff0000Failed|r";
|
||||
break;
|
||||
case QUEST_STATUS_REWARDED:
|
||||
out << "|cffff0000Rewarded|r";
|
||||
break;
|
||||
}
|
||||
|
||||
out << ": " << chat->FormatQuest(quest);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "QuestAction.h"
|
||||
#include "PassLeadershipToMasterAction.h"
|
||||
#include "PetitionSignAction.h"
|
||||
#include "QuestConfirmAcceptAction.h"
|
||||
#include "ReadyCheckAction.h"
|
||||
#include "RememberTaxiAction.h"
|
||||
#include "ReviveFromCorpseAction.h"
|
||||
@@ -36,6 +37,7 @@
|
||||
#include "TradeStatusAction.h"
|
||||
#include "UseMeetingStoneAction.h"
|
||||
#include "NamedObjectContext.h"
|
||||
#include "QuestConfirmAcceptAction.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
@@ -92,6 +94,7 @@ class WorldPacketActionContext : public NamedObjectContext<Action>
|
||||
creators["see spell"] = &WorldPacketActionContext::see_spell;
|
||||
creators["arena team accept"] = &WorldPacketActionContext::arena_team_accept;
|
||||
creators["turn in query quest"] = &WorldPacketActionContext::turn_in_query_quest;
|
||||
creators["quest confirm accept"] = &WorldPacketActionContext::quest_confirm_accept;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -143,6 +146,7 @@ class WorldPacketActionContext : public NamedObjectContext<Action>
|
||||
static Action* see_spell(PlayerbotAI* botAI) { return new SeeSpellAction(botAI); }
|
||||
static Action* arena_team_accept(PlayerbotAI* botAI) { return new ArenaTeamAcceptAction(botAI); }
|
||||
static Action* turn_in_query_quest(PlayerbotAI* botAI) { return new TurnInQueryQuestAction(botAI); }
|
||||
static Action* quest_confirm_accept(PlayerbotAI* botAI) { return new QuestConfirmAcceptAction(botAI); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,6 @@ void GenericHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
// triggers.push_back(new TriggerNode("enemy too close for auto shot", NextAction::array(0, new NextAction("switch to melee", ACTION_HIGH), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy is close",
|
||||
NextAction::array(0,
|
||||
new NextAction("wing clip", ACTION_HIGH + 1),
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "RangeTriggers.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
|
||||
@@ -16,8 +17,8 @@ bool EnemyTooCloseForSpellTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return target && (target->GetVictim() != bot || target->isFrozen() || !target->CanFreeMove()) &&
|
||||
target->GetObjectSize() <= 10.0f &&
|
||||
AI_VALUE2(float, "distance", "current target") <= sPlayerbotAIConfig->tooCloseDistance;
|
||||
target->GetObjectSize() <= 10.0f &&
|
||||
target->IsWithinCombatRange(bot, MIN_MELEE_REACH);
|
||||
// Unit* target = AI_VALUE(Unit*, "current target");
|
||||
// if (!target) {
|
||||
// return false;
|
||||
@@ -79,7 +80,9 @@ bool EnemyTooCloseForAutoShotTrigger::IsActive()
|
||||
bool EnemyTooCloseForShootTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return target && (target->GetVictim() != bot || target->isFrozen() || !target->CanFreeMove()) && AI_VALUE2(float, "distance", "current target") <= sPlayerbotAIConfig->shootDistance;
|
||||
// target->IsWithinCombatRange()
|
||||
|
||||
return target && (target->GetVictim() != bot || target->isFrozen() || !target->CanFreeMove()) && target->IsWithinCombatRange(bot, MIN_MELEE_REACH);
|
||||
|
||||
// Unit* target = AI_VALUE(Unit*, "current target");
|
||||
// if (!target)
|
||||
|
||||
Reference in New Issue
Block a user