mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-16 02:10:28 +00:00
- fixed attack rti target action (#758)
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
#include "LootObjectStack.h"
|
||||
#include "Playerbots.h"
|
||||
#include "PossibleRpgTargetsValue.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "PvpTriggers.h"
|
||||
#include "ServerFacade.h"
|
||||
|
||||
bool AttackEnemyPlayerAction::isUseful()
|
||||
{
|
||||
@@ -129,3 +129,33 @@ bool DpsAssistAction::isUseful()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AttackRtiTargetAction::Execute(Event event)
|
||||
{
|
||||
Unit* rtiTarget = AI_VALUE(Unit*, "rti target");
|
||||
|
||||
if (rtiTarget && rtiTarget->IsInWorld() && rtiTarget->GetMapId() == bot->GetMapId())
|
||||
{
|
||||
botAI->GetAiObjectContext()->GetValue<GuidVector>("prioritized targets")->Set({rtiTarget->GetGUID()});
|
||||
bool result = Attack(botAI->GetUnit(rtiTarget->GetGUID()));
|
||||
if (result)
|
||||
{
|
||||
context->GetValue<ObjectGuid>("pull target")->Set(rtiTarget->GetGUID());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
botAI->TellError("I dont see my rti attack target");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AttackRtiTargetAction::isUseful()
|
||||
{
|
||||
if (botAI->ContainsStrategy(STRATEGY_TYPE_HEAL))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user