mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-24 22:16:23 +00:00
warlock and dk strategy port
This commit is contained in:
@@ -4,7 +4,11 @@
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
#include "BattlegroundWS.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include <string>
|
||||
|
||||
bool LowManaTrigger::IsActive()
|
||||
{
|
||||
@@ -18,7 +22,20 @@ bool MediumManaTrigger::IsActive()
|
||||
|
||||
bool NoPetTrigger::IsActive()
|
||||
{
|
||||
return (!AI_VALUE(Unit*, "pet target")) && (!bot->GetGuardianPet()) && (!bot->GetFirstControlled()) && (!AI_VALUE2(bool, "mounted", "self target"));
|
||||
// Guardian* gp = bot->GetGuardianPet();
|
||||
// bot->getpet
|
||||
// if (gp) {
|
||||
// bot->Yell("Guardian name: " + gp->GetName(), LANG_UNIVERSAL);
|
||||
// }
|
||||
// Minion* minion = bot->GetFirstMinion();
|
||||
// if (minion) {
|
||||
// bot->Yell("has minion: " + minion->GetName(), LANG_UNIVERSAL);
|
||||
// }
|
||||
return (bot->GetMinionGUID().IsEmpty()) &&
|
||||
(!AI_VALUE(Unit*, "pet target")) &&
|
||||
(!bot->GetGuardianPet()) &&
|
||||
(!bot->GetFirstControlled()) &&
|
||||
(!AI_VALUE2(bool, "mounted", "self target"));
|
||||
}
|
||||
|
||||
bool HasPetTrigger::IsActive() {
|
||||
@@ -193,7 +210,7 @@ bool TargetInSightTrigger::IsActive()
|
||||
|
||||
bool DebuffTrigger::IsActive()
|
||||
{
|
||||
return BuffTrigger::IsActive() && AI_VALUE2(uint8, "health", GetTargetName()) > 15;
|
||||
return BuffTrigger::IsActive() && AI_VALUE2(uint8, "health", GetTargetName()) > life_bound;
|
||||
}
|
||||
|
||||
bool SpellTrigger::IsActive()
|
||||
@@ -331,7 +348,7 @@ bool AttackerCountTrigger::IsActive()
|
||||
|
||||
bool HasAuraTrigger::IsActive()
|
||||
{
|
||||
return botAI->HasAura(getName(), GetTarget());
|
||||
return botAI->HasAura(getName(), GetTarget(), false, false, -1, true);
|
||||
}
|
||||
|
||||
bool TimerTrigger::IsActive()
|
||||
|
||||
@@ -306,10 +306,12 @@ class TargetInSightTrigger : public Trigger
|
||||
class DebuffTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
DebuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false) : BuffTrigger(botAI, spell, checkInterval, checkIsOwner) { }
|
||||
DebuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false, float life_bound = 0.25) : BuffTrigger(botAI, spell, checkInterval, checkIsOwner), life_bound(life_bound) { }
|
||||
|
||||
std::string const GetTargetName() override { return "current target"; }
|
||||
bool IsActive() override;
|
||||
protected:
|
||||
float life_bound;
|
||||
};
|
||||
|
||||
class DebuffOnAttackerTrigger : public DebuffTrigger
|
||||
|
||||
Reference in New Issue
Block a user