mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-15 08:06:11 +00:00
Pet attack (fix shadowfiend)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
#include "BattlegroundWS.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SharedDefines.h"
|
||||
@@ -34,6 +35,25 @@ bool HasPetTrigger::IsActive() {
|
||||
return (AI_VALUE(Unit*, "pet target")) && !AI_VALUE2(bool, "mounted", "self target");;
|
||||
}
|
||||
|
||||
bool PetAttackTrigger::IsActive()
|
||||
{
|
||||
Guardian* pet = bot->GetGuardianPet();
|
||||
if (!pet) {
|
||||
return false;
|
||||
}
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
if (!target) {
|
||||
return false;
|
||||
}
|
||||
if (pet->GetVictim() == target && pet->GetCharmInfo()->IsCommandAttack()) {
|
||||
return false;
|
||||
}
|
||||
if (bot->GetMap()->IsDungeon() && bot->GetGroup() && !target->IsInCombat()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HighManaTrigger::IsActive()
|
||||
{
|
||||
return AI_VALUE2(bool, "has mana", "self target") && AI_VALUE2(uint8, "mana", "self target") < 65;
|
||||
|
||||
Reference in New Issue
Block a user