mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Run clang-format
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "HunterTriggers.h"
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
#include "HunterActions.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
@@ -13,18 +15,16 @@
|
||||
bool HunterAspectOfTheHawkTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
return SpellTrigger::IsActive() &&
|
||||
!botAI->HasAura("aspect of the hawk", target) && !botAI->HasAura("aspect of the dragonhawk", target) &&
|
||||
(!AI_VALUE2(bool, "has mana", "self target") || AI_VALUE2(uint8, "mana", "self target") > 70);
|
||||
return SpellTrigger::IsActive() && !botAI->HasAura("aspect of the hawk", target) &&
|
||||
!botAI->HasAura("aspect of the dragonhawk", target) &&
|
||||
(!AI_VALUE2(bool, "has mana", "self target") || AI_VALUE2(uint8, "mana", "self target") > 70);
|
||||
}
|
||||
|
||||
bool HunterNoStingsActiveTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return DebuffTrigger::IsActive() && target &&
|
||||
!botAI->HasAura("serpent sting", target, false, true) &&
|
||||
!botAI->HasAura("scorpid sting", target, false, true) &&
|
||||
!botAI->HasAura("viper sting", target, false, true);
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return DebuffTrigger::IsActive() && target && !botAI->HasAura("serpent sting", target, false, true) &&
|
||||
!botAI->HasAura("scorpid sting", target, false, true) && !botAI->HasAura("viper sting", target, false, true);
|
||||
}
|
||||
|
||||
bool HuntersPetDeadTrigger::IsActive()
|
||||
@@ -37,13 +37,15 @@ bool HuntersPetDeadTrigger::IsActive()
|
||||
bool HuntersPetLowHealthTrigger::IsActive()
|
||||
{
|
||||
Unit* pet = AI_VALUE(Unit*, "pet target");
|
||||
return pet && AI_VALUE2(uint8, "health", "pet target") < 40 && !AI_VALUE2(bool, "dead", "pet target") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
return pet && AI_VALUE2(uint8, "health", "pet target") < 40 && !AI_VALUE2(bool, "dead", "pet target") &&
|
||||
!AI_VALUE2(bool, "mounted", "self target");
|
||||
}
|
||||
|
||||
bool HuntersPetMediumHealthTrigger::IsActive()
|
||||
{
|
||||
Unit* pet = AI_VALUE(Unit*, "pet target");
|
||||
return pet && AI_VALUE2(uint8, "health", "pet target") < sPlayerbotAIConfig->mediumHealth && !AI_VALUE2(bool, "dead", "pet target") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
return pet && AI_VALUE2(uint8, "health", "pet target") < sPlayerbotAIConfig->mediumHealth &&
|
||||
!AI_VALUE2(bool, "dead", "pet target") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
}
|
||||
|
||||
bool HunterPetNotHappy::IsActive()
|
||||
@@ -53,8 +55,9 @@ bool HunterPetNotHappy::IsActive()
|
||||
|
||||
bool HunterAspectOfTheViperTrigger::IsActive()
|
||||
{
|
||||
return SpellTrigger::IsActive() && !botAI->HasAura(spell, GetTarget()) &&
|
||||
AI_VALUE2(uint8, "mana", "self target") < sPlayerbotAIConfig->lowMana;;
|
||||
return SpellTrigger::IsActive() && !botAI->HasAura(spell, GetTarget()) &&
|
||||
AI_VALUE2(uint8, "mana", "self target") < sPlayerbotAIConfig->lowMana;
|
||||
;
|
||||
}
|
||||
|
||||
bool HunterAspectOfThePackTrigger::IsActive()
|
||||
@@ -64,30 +67,30 @@ bool HunterAspectOfThePackTrigger::IsActive()
|
||||
|
||||
bool HunterLowAmmoTrigger::IsActive()
|
||||
{
|
||||
return bot->GetGroup() && (AI_VALUE2(uint32, "item count", "ammo") < 100) && (AI_VALUE2(uint32, "item count", "ammo") > 0);
|
||||
return bot->GetGroup() && (AI_VALUE2(uint32, "item count", "ammo") < 100) &&
|
||||
(AI_VALUE2(uint32, "item count", "ammo") > 0);
|
||||
}
|
||||
|
||||
bool HunterHasAmmoTrigger::IsActive()
|
||||
{
|
||||
return !AmmoCountTrigger::IsActive();
|
||||
}
|
||||
bool HunterHasAmmoTrigger::IsActive() { return !AmmoCountTrigger::IsActive(); }
|
||||
|
||||
bool SwitchToRangedTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return botAI->HasStrategy("close", BOT_STATE_COMBAT) && target && (target->GetVictim() != bot &&
|
||||
sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "current target"), 8.0f));
|
||||
return botAI->HasStrategy("close", BOT_STATE_COMBAT) && target &&
|
||||
(target->GetVictim() != bot &&
|
||||
sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "current target"), 8.0f));
|
||||
}
|
||||
|
||||
bool SwitchToMeleeTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return botAI->HasStrategy("ranged", BOT_STATE_COMBAT) && target && (target->GetVictim() == bot &&
|
||||
sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "current target"), 8.0f));
|
||||
return botAI->HasStrategy("ranged", BOT_STATE_COMBAT) && target &&
|
||||
(target->GetVictim() == bot &&
|
||||
sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "current target"), 8.0f));
|
||||
}
|
||||
|
||||
bool TargetRemoveEnrageTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
return target && (botAI->HasAuraToDispel(target, DISPEL_ENRAGE) || botAI->HasAuraToDispel(target, DISPEL_MAGIC));
|
||||
Unit* target = GetTarget();
|
||||
return target && (botAI->HasAuraToDispel(target, DISPEL_ENRAGE) || botAI->HasAuraToDispel(target, DISPEL_MAGIC));
|
||||
}
|
||||
Reference in New Issue
Block a user