mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-16 18:30:27 +00:00
[Spell] Handle tree of life and assist dps
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "BattlegroundWS.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "GameTime.h"
|
||||
#include "LastSpellCastValue.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
@@ -372,23 +374,28 @@ bool HealerShouldAttackTrigger::IsActive()
|
||||
if (botAI->GetNearGroupMemberCount(sPlayerbotAIConfig->sightDistance) <= 1)
|
||||
return true;
|
||||
|
||||
bool almostFullMana = AI_VALUE2(bool, "has mana", "self target") &&
|
||||
AI_VALUE2(uint8, "mana", "self target") < 85;
|
||||
|
||||
// high pressure
|
||||
if (AI_VALUE(uint8, "balance") <= 50 && almostFullMana)
|
||||
if (AI_VALUE2(uint8, "health", "party member to heal") < sPlayerbotAIConfig->almostFullHealth)
|
||||
return false;
|
||||
|
||||
bool highMana = AI_VALUE2(bool, "has mana", "self target") &&
|
||||
AI_VALUE2(uint8, "mana", "self target") < sPlayerbotAIConfig->highMana;
|
||||
// special check for resto druid (dont remove tree of life frequently)
|
||||
if (bot->GetAura(33891))
|
||||
{
|
||||
LastSpellCast& lastSpell = botAI->GetAiObjectContext()->GetValue<LastSpellCast&>("last spell cast")->Get();
|
||||
if (lastSpell.timer + 5 > time(nullptr))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (AI_VALUE(uint8, "balance") <= 100 && highMana)
|
||||
return false;
|
||||
|
||||
bool mediumMana = AI_VALUE2(bool, "has mana", "self target") &&
|
||||
AI_VALUE2(uint8, "mana", "self target") < sPlayerbotAIConfig->mediumMana;
|
||||
int manaThreshold;
|
||||
int balance = AI_VALUE(uint8, "balance");
|
||||
// higher threshold in higher pressure
|
||||
if (balance <= 50)
|
||||
manaThreshold = 85;
|
||||
else if (balance <= 100)
|
||||
manaThreshold = sPlayerbotAIConfig->highMana;
|
||||
else
|
||||
manaThreshold = sPlayerbotAIConfig->mediumMana;
|
||||
|
||||
if (mediumMana)
|
||||
if (AI_VALUE2(bool, "has mana", "self target") && AI_VALUE2(uint8, "mana", "self target") < manaThreshold)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user