mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-15 18:00:27 +00:00
General improvement on init and strats (#1064)
* Potions strats and potions init * Druid and shaman spell in low level * Ammo init improvement * Rogue low level * Fix melee attack action (for caster with no mana) * Disable pet spells that reduce dps * Talents improvement * Remove CanFreeMove check * Reduce penalty for non-dagger weapon for rogue
This commit is contained in:
@@ -53,6 +53,16 @@ bool AttackMyTargetAction::Execute(Event event)
|
||||
|
||||
bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
|
||||
{
|
||||
Unit* oldTarget = context->GetValue<Unit*>("current target")->Get();
|
||||
bool shouldMelee = bot->IsWithinMeleeRange(target) || botAI->IsMelee(bot);
|
||||
|
||||
bool sameTarget = oldTarget == target && bot->GetVictim() == target;
|
||||
bool inCombat = botAI->GetState() == BOT_STATE_COMBAT;
|
||||
bool sameAttackMode = bot->HasUnitState(UNIT_STATE_MELEE_ATTACKING) == shouldMelee;
|
||||
// there's no reason to do attack again
|
||||
if (sameTarget && inCombat && sameAttackMode)
|
||||
return false;
|
||||
|
||||
if (bot->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE ||
|
||||
bot->HasUnitState(UNIT_STATE_IN_FLIGHT))
|
||||
{
|
||||
@@ -131,11 +141,7 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
|
||||
ObjectGuid guid = target->GetGUID();
|
||||
bot->SetSelection(target->GetGUID());
|
||||
|
||||
Unit* oldTarget = context->GetValue<Unit*>("current target")->Get();
|
||||
bool melee = bot->IsWithinMeleeRange(target) || botAI->IsMelee(bot);
|
||||
|
||||
if (oldTarget == target && botAI->GetState() == BOT_STATE_COMBAT && bot->GetVictim() == target && (bot->HasUnitState(UNIT_STATE_MELEE_ATTACKING) == melee))
|
||||
return false;
|
||||
|
||||
|
||||
context->GetValue<Unit*>("old target")->Set(oldTarget);
|
||||
|
||||
@@ -158,7 +164,7 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
|
||||
}
|
||||
botAI->ChangeEngine(BOT_STATE_COMBAT);
|
||||
|
||||
bot->Attack(target, melee);
|
||||
bot->Attack(target, shouldMelee);
|
||||
/* prevent pet dead immediately in group */
|
||||
// if (bot->GetMap()->IsDungeon() && bot->GetGroup() && !target->IsInCombat()) {
|
||||
// with_pet = false;
|
||||
|
||||
@@ -51,11 +51,10 @@ bool TogglePetSpellAutoCastAction::Execute(Event event)
|
||||
continue;
|
||||
|
||||
bool shouldApply = true;
|
||||
// spellId == 4511 || spellId == 54424 || spellId == 57564 || spellId == 57565 ||
|
||||
// spellId == 57566 || spellId == 57567 ||
|
||||
// cat stealth, prowl
|
||||
if (spellId == 1742 || spellId == 24450)
|
||||
if (spellId == 1742 /*cower*/ || spellId == 24450 /*Prowl*/ ||
|
||||
spellId == 47482 /*Leap*/ /* || spellId == 47481 Gnaw*/)
|
||||
{
|
||||
|
||||
shouldApply = false;
|
||||
}
|
||||
bool isAutoCast = false;
|
||||
|
||||
@@ -2017,7 +2017,7 @@ Position MovementAction::BestPositionForMeleeToFlee(Position pos, float radius)
|
||||
if (currentTarget)
|
||||
{
|
||||
// Normally, move to left or right is the best position
|
||||
bool isTanking = (currentTarget->CanFreeMove()) && (currentTarget->GetVictim() == bot);
|
||||
bool isTanking = (!currentTarget->isFrozen() && !currentTarget->HasRootAura()) && (currentTarget->GetVictim() == bot);
|
||||
float angle = bot->GetAngle(currentTarget);
|
||||
float angleLeft = angle + (float)M_PI / 2;
|
||||
float angleRight = angle - (float)M_PI / 2;
|
||||
|
||||
@@ -63,7 +63,7 @@ bool UseItemAction::UseItem(Item* item, ObjectGuid goGuid, Item* itemTarget, Uni
|
||||
if (bot->CanUseItem(item) != EQUIP_ERR_OK)
|
||||
return false;
|
||||
|
||||
if (bot->IsNonMeleeSpellCast(true))
|
||||
if (bot->IsNonMeleeSpellCast(false))
|
||||
return false;
|
||||
|
||||
uint8 bagIndex = item->GetBagSlot();
|
||||
|
||||
@@ -143,7 +143,8 @@ void CasterDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
triggers.push_back(new TriggerNode("eclipse (lunar)",
|
||||
NextAction::array(0, new NextAction("starfire", ACTION_NORMAL + 6), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 9), NULL)));
|
||||
new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 9), nullptr)));
|
||||
|
||||
triggers.push_back(new TriggerNode("enemy too close for spell",
|
||||
NextAction::array(0, new NextAction("flee", ACTION_MOVE + 9), nullptr)));
|
||||
}
|
||||
|
||||
@@ -113,10 +113,10 @@ public:
|
||||
SavageRoarTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "savage roar") {}
|
||||
};
|
||||
|
||||
class NaturesGraspTrigger : public BoostTrigger
|
||||
class NaturesGraspTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
NaturesGraspTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "nature's grasp") {}
|
||||
NaturesGraspTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "nature's grasp") {}
|
||||
};
|
||||
|
||||
class EntanglingRootsTrigger : public HasCcTargetTrigger
|
||||
|
||||
@@ -169,4 +169,6 @@ void GenericDruidBuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
NextAction::array(0, new NextAction("mark of the wild on party", 13.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("thorns on main tank",
|
||||
NextAction::array(0, new NextAction("thorns on main tank", 11.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("thorns",
|
||||
NextAction::array(0, new NextAction("thorns", 10.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -121,6 +121,8 @@ void GenericDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
// NextAction::array(0, new NextAction("innervate", ACTION_EMERGENCY + 5), nullptr)));
|
||||
triggers.push_back(new TriggerNode("combat party member dead",
|
||||
NextAction::array(0, new NextAction("rebirth", ACTION_HIGH + 9), NULL)));
|
||||
triggers.push_back(new TriggerNode("being attacked",
|
||||
NextAction::array(0, new NextAction("nature's grasp", ACTION_HIGH + 1), nullptr)));
|
||||
}
|
||||
|
||||
void DruidCureStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DpsAssistStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
NextAction** DpsAssistStrategy::getDefaultActions()
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("not dps target active", NextAction::array(0, new NextAction("dps assist", 50.0f), nullptr)));
|
||||
return NextAction::array(
|
||||
0, new NextAction("dps assist", 50.0f),
|
||||
nullptr);
|
||||
}
|
||||
|
||||
void DpsAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
|
||||
@@ -16,8 +16,7 @@ public:
|
||||
DpsAssistStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "dps assist"; }
|
||||
// uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
NextAction** getDefaultActions() override;
|
||||
};
|
||||
|
||||
class DpsAoeStrategy : public NonCombatStrategy
|
||||
|
||||
@@ -7,8 +7,15 @@
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void TankAssistStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
NextAction** TankAssistStrategy::getDefaultActions()
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("tank assist", NextAction::array(0, new NextAction("tank assist", 50.0f), nullptr)));
|
||||
return NextAction::array(
|
||||
0, new NextAction("tank assist", 50.0f),
|
||||
nullptr);
|
||||
}
|
||||
|
||||
// void TankAssistStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
// {
|
||||
// triggers.push_back(
|
||||
// new TriggerNode("tank assist", NextAction::array(0, new NextAction("tank assist", 50.0f), nullptr)));
|
||||
// }
|
||||
|
||||
@@ -17,7 +17,8 @@ public:
|
||||
|
||||
std::string const getName() override { return "tank assist"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_TANK; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
NextAction** getDefaultActions() override;
|
||||
// void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -146,9 +146,4 @@ void HunterTrapWeaveStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode(
|
||||
"immolation trap no cd", NextAction::array(0, new NextAction("reach melee", ACTION_HIGH + 3), nullptr)));
|
||||
|
||||
// triggers.push_back(new TriggerNode(
|
||||
// "scare beast", NextAction::array(0, new NextAction("scare beast on cc", ACTION_HIGH + 3), nullptr)));
|
||||
// triggers.push_back(new TriggerNode(
|
||||
// "freezing trap", NextAction::array(0, new NextAction("freezing trap on cc", ACTION_HIGH + 3), nullptr)));
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ void ShadowPriestAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
void ShadowPriestDebuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode(
|
||||
"devouring plague", NextAction::array(0, new NextAction("devouring plague", ACTION_HIGH + 3), nullptr)));
|
||||
"vampiric touch", NextAction::array(0, new NextAction("vampiric touch", ACTION_HIGH + 3), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"vampiric touch", NextAction::array(0, new NextAction("vampiric touch", ACTION_HIGH + 2), nullptr)));
|
||||
"devouring plague", NextAction::array(0, new NextAction("devouring plague", ACTION_HIGH + 2), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"shadow word: pain", NextAction::array(0, new NextAction("shadow word: pain", ACTION_HIGH + 1), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("feedback", NextAction::array(0, new NextAction("feedback", 80.0f),
|
||||
|
||||
@@ -10,6 +10,8 @@ public:
|
||||
{
|
||||
creators["mutilate"] = &mutilate;
|
||||
creators["envenom"] = &envenom;
|
||||
creators["backstab"] = &backstab;
|
||||
creators["rupture"] = &rupture;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -17,16 +19,30 @@ private:
|
||||
{
|
||||
return new ActionNode("mutilate",
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("sinister strike"), NULL),
|
||||
/*A*/ NextAction::array(0, new NextAction("backstab"), nullptr),
|
||||
/*C*/ NULL);
|
||||
}
|
||||
static ActionNode* envenom(PlayerbotAI* ai)
|
||||
{
|
||||
return new ActionNode("envenom",
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("eviscerate"), NULL),
|
||||
/*A*/ NextAction::array(0, new NextAction("rupture"), nullptr),
|
||||
/*C*/ NULL);
|
||||
}
|
||||
static ActionNode* backstab(PlayerbotAI* ai)
|
||||
{
|
||||
return new ActionNode("backstab",
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("sinister strike"), nullptr),
|
||||
/*C*/ NULL);
|
||||
}
|
||||
static ActionNode* rupture(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("rupture",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("eviscerate"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
AssassinationRogueStrategy::AssassinationRogueStrategy(PlayerbotAI* ai) : MeleeCombatStrategy(ai)
|
||||
@@ -48,7 +64,7 @@ void AssassinationRogueStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
|
||||
new NextAction("ambush", ACTION_HIGH + 6), nullptr)));
|
||||
|
||||
triggers.push_back(new TriggerNode("high energy available",
|
||||
NextAction::array(0, new NextAction("mutilate", ACTION_NORMAL + 3), NULL)));
|
||||
NextAction::array(0, new NextAction("mutilate", ACTION_NORMAL + 3), nullptr)));
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"hunger for blood", NextAction::array(0, new NextAction("hunger for blood", ACTION_HIGH + 6), NULL)));
|
||||
@@ -57,8 +73,13 @@ void AssassinationRogueStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
|
||||
NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 5), NULL)));
|
||||
|
||||
triggers.push_back(new TriggerNode("combo points 3 available",
|
||||
NextAction::array(0, new NextAction("envenom", ACTION_HIGH + 4), NULL)));
|
||||
NextAction::array(0, new NextAction("envenom", ACTION_HIGH + 5),
|
||||
new NextAction("eviscerate", ACTION_HIGH + 3), nullptr)));
|
||||
|
||||
triggers.push_back(new TriggerNode("target with combo points almost dead",
|
||||
NextAction::array(0, new NextAction("envenom", ACTION_HIGH + 4),
|
||||
new NextAction("eviscerate", ACTION_HIGH + 2), nullptr)));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("expose armor", NextAction::array(0, new NextAction("expose armor", ACTION_HIGH + 3), NULL)));
|
||||
|
||||
@@ -69,8 +90,8 @@ void AssassinationRogueStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
|
||||
new TriggerNode("low health", NextAction::array(0, new NextAction("evasion", ACTION_HIGH + 9),
|
||||
new NextAction("feint", ACTION_HIGH + 8), nullptr)));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("critical health", NextAction::array(0, new NextAction("cloak of shadows", ACTION_HIGH + 7), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"critical health", NextAction::array(0, new NextAction("cloak of shadows", ACTION_HIGH + 7), nullptr)));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("kick", NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), NULL)));
|
||||
|
||||
@@ -44,6 +44,17 @@ bool CastVanishAction::isUseful()
|
||||
return !botAI->HasAura(23333, bot) && !botAI->HasAura(23335, bot) && !botAI->HasAura(34976, bot);
|
||||
}
|
||||
|
||||
bool CastEnvenomAction::isUseful()
|
||||
{
|
||||
return AI_VALUE2(uint8, "energy", "self target") >= 35;
|
||||
}
|
||||
|
||||
bool CastEnvenomAction::isPossible()
|
||||
{
|
||||
// alternate to eviscerate if talents unlearned
|
||||
return botAI->HasAura(58410, bot) /* Master Poisoner */;
|
||||
}
|
||||
|
||||
bool CastTricksOfTheTradeOnMainTankAction::isUseful()
|
||||
{
|
||||
return CastSpellAction::isUseful() && AI_VALUE2(float, "distance", GetTargetName()) < 20.0f;
|
||||
|
||||
@@ -127,10 +127,12 @@ public:
|
||||
CastKickOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "kick") {}
|
||||
};
|
||||
|
||||
class EnvenomAction : public CastMeleeSpellAction
|
||||
class CastEnvenomAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
EnvenomAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "envenom") {}
|
||||
CastEnvenomAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "envenom") {}
|
||||
bool isUseful() override;
|
||||
bool isPossible() override;
|
||||
};
|
||||
|
||||
class CastTricksOfTheTradeOnMainTankAction : public BuffOnMainTankAction
|
||||
|
||||
@@ -173,7 +173,7 @@ private:
|
||||
static Action* check_stealth(PlayerbotAI* botAI) { return new CheckStealthAction(botAI); }
|
||||
static Action* sap(PlayerbotAI* botAI) { return new CastSapAction(botAI); }
|
||||
static Action* unstealth(PlayerbotAI* botAI) { return new UnstealthAction(botAI); }
|
||||
static Action* envenom(PlayerbotAI* ai) { return new EnvenomAction(ai); }
|
||||
static Action* envenom(PlayerbotAI* ai) { return new CastEnvenomAction(ai); }
|
||||
static Action* tricks_of_the_trade_on_main_tank(PlayerbotAI* ai)
|
||||
{
|
||||
return new CastTricksOfTheTradeOnMainTankAction(ai);
|
||||
|
||||
@@ -27,9 +27,9 @@ private:
|
||||
static ActionNode* totem_of_wrath(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("totem of wrath",
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("flametongue totem"), NULL),
|
||||
/*C*/ NULL);
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("flametongue totem"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -67,7 +67,11 @@ void CasterShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
// triggers.push_back(new TriggerNode("frost shock snare", NextAction::array(0, new NextAction("frost
|
||||
// shock", 21.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("no fire totem", NextAction::array(0, new NextAction("totem of wrath", 15.0f), NULL)));
|
||||
new TriggerNode("no fire totem", NextAction::array(0,
|
||||
new NextAction("totem of wrath", 15.0f),
|
||||
new NextAction("searing totem", 6.0f),
|
||||
nullptr)));
|
||||
|
||||
triggers.push_back(new TriggerNode("fire elemental totem",
|
||||
NextAction::array(0, new NextAction("fire elemental totem", 32.0f), nullptr)));
|
||||
|
||||
@@ -86,4 +90,7 @@ void CasterAoeShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("light aoe", NextAction::array(0, new NextAction("chain lightning", 25.0f), nullptr)));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("medium aoe", NextAction::array(0, new NextAction("fire nova", 24.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public:
|
||||
creators["riptide"] = &riptide;
|
||||
creators["riptide on party"] = &riptide_on_party;
|
||||
creators["earth shock"] = &earth_shock;
|
||||
creators["water shield"] = &water_shield;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -97,6 +98,15 @@ private:
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* water_shield([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("water shield",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("lightning shield"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
GenericShamanStrategy::GenericShamanStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
|
||||
@@ -198,6 +198,13 @@ bool MyAttackerCountTrigger::IsActive()
|
||||
return AI_VALUE2(bool, "combat", "self target") && AI_VALUE(uint8, "my attacker count") >= amount;
|
||||
}
|
||||
|
||||
bool MediumThreatTrigger::IsActive()
|
||||
{
|
||||
if (!AI_VALUE(Unit*, "main tank"))
|
||||
return false;
|
||||
return MyAttackerCountTrigger::IsActive();
|
||||
}
|
||||
|
||||
bool LowTankThreatTrigger::IsActive()
|
||||
{
|
||||
Unit* mt = AI_VALUE(Unit*, "main tank");
|
||||
|
||||
@@ -243,10 +243,18 @@ public:
|
||||
std::string const getName() override { return "my attacker count"; }
|
||||
};
|
||||
|
||||
class BeingAttackedTrigger : public MyAttackerCountTrigger
|
||||
{
|
||||
public:
|
||||
BeingAttackedTrigger(PlayerbotAI* botAI) : MyAttackerCountTrigger(botAI, 1) {}
|
||||
std::string const getName() override { return "being attacked"; }
|
||||
};
|
||||
|
||||
class MediumThreatTrigger : public MyAttackerCountTrigger
|
||||
{
|
||||
public:
|
||||
MediumThreatTrigger(PlayerbotAI* botAI) : MyAttackerCountTrigger(botAI, 2) {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class LowTankThreatTrigger : public Trigger
|
||||
|
||||
@@ -19,7 +19,7 @@ static float GetSpeedInMotion(Unit* target)
|
||||
bool EnemyTooCloseForSpellTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return target && (target->GetVictim() != bot || target->isFrozen() || !target->CanFreeMove()) &&
|
||||
return target && (target->GetVictim() != bot || target->isFrozen() || target->HasRootAura()) &&
|
||||
target->GetObjectSize() <= 10.0f && target->IsWithinCombatRange(bot, MIN_MELEE_REACH);
|
||||
// Unit* target = AI_VALUE(Unit*, "current target");
|
||||
// if (!target) {
|
||||
@@ -69,7 +69,7 @@ bool EnemyTooCloseForAutoShotTrigger::IsActive()
|
||||
if (spellId && bot->HasSpellCooldown(spellId))
|
||||
trapToCast = false;
|
||||
|
||||
return !trapToCast && (target->GetVictim() != bot || target->isFrozen() || !target->CanFreeMove()) &&
|
||||
return !trapToCast && (target->GetVictim() != bot || target->isFrozen() || target->HasRootAura()) &&
|
||||
bot->IsWithinMeleeRange(target);
|
||||
|
||||
// if (target->GetTarget() == bot->GetGUID() && !bot->GetGroup() && !target->HasUnitState(UNIT_STATE_ROOT) &&
|
||||
@@ -100,7 +100,7 @@ bool EnemyTooCloseForShootTrigger::IsActive()
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
// target->IsWithinCombatRange()
|
||||
|
||||
return target && (target->GetVictim() != bot || target->isFrozen() || !target->CanFreeMove()) &&
|
||||
return target && (target->GetVictim() != bot || target->isFrozen() || target->HasRootAura()) &&
|
||||
target->IsWithinCombatRange(bot, MIN_MELEE_REACH);
|
||||
|
||||
// Unit* target = AI_VALUE(Unit*, "current target");
|
||||
|
||||
@@ -107,6 +107,7 @@ public:
|
||||
creators["combo points not full"] = &TriggerContext::ComboPointsNotFull;
|
||||
creators["combo points not full and high energy"] = &TriggerContext::ComboPointsNotFullAndHighEnergy;
|
||||
|
||||
creators["being attacked"] = &TriggerContext::BeingAttacked;
|
||||
creators["medium threat"] = &TriggerContext::MediumThreat;
|
||||
creators["low tank threat"] = &TriggerContext::low_tank_threat;
|
||||
|
||||
@@ -333,6 +334,7 @@ private:
|
||||
}
|
||||
static Trigger* ComboPointsNotFull(PlayerbotAI* botAI) { return new ComboPointsNotFullTrigger(botAI); }
|
||||
static Trigger* ComboPointsNotFullAndHighEnergy(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "combo points not full", "high energy available"); }
|
||||
static Trigger* BeingAttacked(PlayerbotAI* botAI) { return new BeingAttackedTrigger(botAI); }
|
||||
static Trigger* MediumThreat(PlayerbotAI* botAI) { return new MediumThreatTrigger(botAI); }
|
||||
static Trigger* low_tank_threat(PlayerbotAI* botAI) { return new LowTankThreatTrigger(botAI); }
|
||||
// static Trigger* MediumThreat(PlayerbotAI* botAI) { return new MediumThreatTrigger(botAI); }
|
||||
|
||||
Reference in New Issue
Block a user