mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-16 02:10:28 +00:00
Misdirection and tricks of the trade
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "Playerbots.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "ThreatMgr.h"
|
||||
#include "Timer.h"
|
||||
|
||||
bool LowManaTrigger::IsActive()
|
||||
@@ -185,6 +186,22 @@ bool MyAttackerCountTrigger::IsActive()
|
||||
return AI_VALUE2(bool, "combat", "self target") && AI_VALUE(uint8, "my attacker count") >= amount;
|
||||
}
|
||||
|
||||
bool LowTankThreatTrigger::IsActive()
|
||||
{
|
||||
Unit* mt = AI_VALUE(Unit*, "main tank");
|
||||
if (!mt)
|
||||
return false;
|
||||
|
||||
Unit* current_target = AI_VALUE(Unit*, "current target");
|
||||
if (!current_target)
|
||||
return false;
|
||||
|
||||
ThreatMgr& mgr = current_target->GetThreatMgr();
|
||||
float threat = mgr.GetThreat(bot);
|
||||
float tankThreat = mgr.GetThreat(mt);
|
||||
return tankThreat == 0.0f || threat > tankThreat * 0.5f;
|
||||
}
|
||||
|
||||
bool AoeTrigger::IsActive()
|
||||
{
|
||||
Unit* current_target = AI_VALUE(Unit*, "current target");
|
||||
|
||||
Reference in New Issue
Block a user