mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-21 20:46:22 +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:
@@ -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