mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Check mount state
This commit is contained in:
@@ -18,12 +18,11 @@ bool CheckMountStateAction::Execute(Event event)
|
|||||||
AI_VALUE2(bool, "combat", "self target") ? (AI_VALUE(uint8, "attacker count") > 0 ? false : true) : true;
|
AI_VALUE2(bool, "combat", "self target") ? (AI_VALUE(uint8, "attacker count") > 0 ? false : true) : true;
|
||||||
bool enemy = AI_VALUE(Unit*, "enemy player target");
|
bool enemy = AI_VALUE(Unit*, "enemy player target");
|
||||||
// ignore grind target in BG or bots will dismount near any creature (eg: the rams in AV)
|
// ignore grind target in BG or bots will dismount near any creature (eg: the rams in AV)
|
||||||
bool dps = (AI_VALUE(Unit*, "dps target") || (!bot->InBattleground() && AI_VALUE(Unit*, "grind target")));
|
bool dps = AI_VALUE(Unit*, "dps target");
|
||||||
bool fartarget =
|
bool fartarget = (enemy && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), 40.0f)) ||
|
||||||
(enemy && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), 40.0f)) ||
|
|
||||||
(dps && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "dps target"), 50.0f));
|
(dps && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "dps target"), 50.0f));
|
||||||
bool attackdistance = false;
|
bool attackdistance = false;
|
||||||
bool chasedistance = false;
|
// bool chasedistance = false;
|
||||||
float attack_distance = 35.0f;
|
float attack_distance = 35.0f;
|
||||||
if (PlayerbotAI::IsMelee(bot))
|
if (PlayerbotAI::IsMelee(bot))
|
||||||
{
|
{
|
||||||
@@ -38,11 +37,9 @@ bool CheckMountStateAction::Execute(Event event)
|
|||||||
|
|
||||||
if (dps || enemy)
|
if (dps || enemy)
|
||||||
{
|
{
|
||||||
attackdistance = (enemy || dps) && sServerFacade->IsDistanceLessThan(
|
Unit* currentTarget = AI_VALUE(Unit*, "current target");
|
||||||
AI_VALUE2(float, "distance", "current target"), attack_distance);
|
attackdistance = (enemy || dps) && currentTarget && sServerFacade->IsDistanceLessThan(AI_VALUE2(float, "distance", "current target"), attack_distance);
|
||||||
chasedistance =
|
// chasedistance = enemy && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), 45.0f) && AI_VALUE2(bool, "moving", "enemy player target");
|
||||||
enemy && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), 45.0f) &&
|
|
||||||
AI_VALUE2(bool, "moving", "enemy player target");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bot->IsMounted() && attackdistance)
|
if (bot->IsMounted() && attackdistance)
|
||||||
|
|||||||
Reference in New Issue
Block a user