Hunter/Warlock AoE Fix (#1440)

Hello everyone,

This fixes these two classes so they respond to the command "co -aoe" and "co +aoe". This also fixes the survival hunter so that trap weave is not a default strategy - they will not walk into melee anymore.
This commit is contained in:
ThePenguinMan96
2025-07-14 01:15:11 -07:00
committed by GitHub
parent 5202ac8db3
commit 96cc0daea6
19 changed files with 54 additions and 136 deletions

View File

@@ -368,13 +368,13 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa
break;
case CLASS_HUNTER:
if (tab == 0) // Beast Mastery
engine->addStrategiesNoInit("bm", "bm aoe", nullptr);
engine->addStrategiesNoInit("bm", nullptr);
else if (tab == 1) // Marksmanship
engine->addStrategiesNoInit("mm", "mm aoe", nullptr);
engine->addStrategiesNoInit("mm", nullptr);
else if (tab == 2) // Survival
engine->addStrategiesNoInit("surv", "surv aoe", "trap weave", nullptr);
engine->addStrategiesNoInit("surv", nullptr);
engine->addStrategiesNoInit("cc", "dps assist", nullptr);
engine->addStrategiesNoInit("cc", "dps assist", "aoe", nullptr);
break;
case CLASS_ROGUE:
if (tab == ROGUE_TAB_ASSASSINATION || tab == ROGUE_TAB_SUBTLETY)
@@ -388,13 +388,13 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa
break;
case CLASS_WARLOCK:
if (tab == 0) // Affliction
engine->addStrategiesNoInit("affli", "affli aoe", "curse of agony", nullptr);
engine->addStrategiesNoInit("affli", "curse of agony", nullptr);
else if (tab == 1) // Demonology
engine->addStrategiesNoInit("demo", "demo aoe", "curse of agony", "meta melee", nullptr);
engine->addStrategiesNoInit("demo", "curse of agony", "meta melee", nullptr);
else if (tab == 2) // Destruction
engine->addStrategiesNoInit("destro", "destro aoe", "curse of elements", nullptr);
engine->addStrategiesNoInit("destro", "curse of elements", nullptr);
engine->addStrategiesNoInit("cc", "dps assist", nullptr);
engine->addStrategiesNoInit("cc", "dps assist", "aoe", nullptr);
break;
case CLASS_DEATH_KNIGHT:

View File

@@ -67,12 +67,3 @@ void BeastMasteryHunterStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 17.0f), nullptr)));
triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 16.5f), nullptr)));
}
// ===== AoE Strategy, 2/3+ enemies =====
BeastMasteryHunterAoeStrategy::BeastMasteryHunterAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
void BeastMasteryHunterAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr)));
triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr)));
}

View File

@@ -21,12 +21,4 @@ public:
NextAction** getDefaultActions() override;
};
class BeastMasteryHunterAoeStrategy : public CombatStrategy
{
public:
BeastMasteryHunterAoeStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "bm aoe"; }
};
#endif

View File

@@ -131,6 +131,16 @@ void GenericHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
new NextAction("flee", 34.0f), nullptr)));
}
// ===== AoE Strategy, 2/3+ enemies =====
AoEHunterStrategy::AoEHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
void AoEHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr)));
triggers.push_back(
new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr)));
}
void HunterBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
}

View File

@@ -21,6 +21,16 @@ public:
uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; }
};
class AoEHunterStrategy : public CombatStrategy
{
public:
AoEHunterStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "aoe"; }
};
class HunterBoostStrategy : public Strategy
{
public:

View File

@@ -28,9 +28,7 @@ public:
creators["bm"] = &HunterStrategyFactoryInternal::beast_mastery;
creators["mm"] = &HunterStrategyFactoryInternal::marksmanship;
creators["surv"] = &HunterStrategyFactoryInternal::survival;
creators["bm aoe"] = &HunterStrategyFactoryInternal::beast_mastery_aoe;
creators["mm aoe"] = &HunterStrategyFactoryInternal::marksmanship_aoe;
creators["surv aoe"] = &HunterStrategyFactoryInternal::survival_aoe;
creators["aoe"] = &HunterStrategyFactoryInternal::aoe;
}
private:
@@ -42,9 +40,7 @@ private:
static Strategy* beast_mastery(PlayerbotAI* botAI) { return new BeastMasteryHunterStrategy(botAI); }
static Strategy* marksmanship(PlayerbotAI* botAI) { return new MarksmanshipHunterStrategy(botAI); }
static Strategy* survival(PlayerbotAI* botAI) { return new SurvivalHunterStrategy(botAI); }
static Strategy* beast_mastery_aoe(PlayerbotAI* botAI) { return new BeastMasteryHunterAoeStrategy(botAI); }
static Strategy* marksmanship_aoe(PlayerbotAI* botAI) { return new MarksmanshipHunterAoeStrategy(botAI); }
static Strategy* survival_aoe(PlayerbotAI* botAI) { return new SurvivalHunterAoeStrategy(botAI); }
static Strategy* aoe(PlayerbotAI* botAI) { return new AoEHunterStrategy(botAI); }
};
class HunterBuffStrategyFactoryInternal : public NamedObjectContext<Strategy>

View File

@@ -72,12 +72,3 @@ void MarksmanshipHunterStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 17.0f), nullptr)));
triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 16.5f), nullptr)));
}
// ===== AoE Strategy, 2/3+ enemies =====
MarksmanshipHunterAoeStrategy::MarksmanshipHunterAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
void MarksmanshipHunterAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr)));
triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr)));
}

View File

@@ -21,12 +21,4 @@ public:
NextAction** getDefaultActions() override;
};
class MarksmanshipHunterAoeStrategy : public CombatStrategy
{
public:
MarksmanshipHunterAoeStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "mm aoe"; }
};
#endif

View File

@@ -80,12 +80,3 @@ void SurvivalHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 15.5f), nullptr)));
triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 15.0f), nullptr)));
}
// ===== AoE Strategy, 2/3+ enemies =====
SurvivalHunterAoeStrategy::SurvivalHunterAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
void SurvivalHunterAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr)));
triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr)));
}

View File

@@ -21,12 +21,4 @@ public:
NextAction** getDefaultActions() override;
};
class SurvivalHunterAoeStrategy : public CombatStrategy
{
public:
SurvivalHunterAoeStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "surv aoe"; }
};
#endif

View File

@@ -80,15 +80,3 @@ void AfflictionWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 39.0f), nullptr)));
}
// ===== AoE Strategy, 3+ enemies =====
AfflictionWarlockAoeStrategy::AfflictionWarlockAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
void AfflictionWarlockAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0,
new NextAction("shadowflame", 22.5f),
new NextAction("seed of corruption on attacker", 22.0f),
new NextAction("seed of corruption", 21.5f),
new NextAction("rain of fire", 21.0f), nullptr)));
}

View File

@@ -21,12 +21,4 @@ public:
NextAction** getDefaultActions() override;
};
class AfflictionWarlockAoeStrategy : public CombatStrategy
{
public:
AfflictionWarlockAoeStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "affli aoe"; }
};
#endif

View File

@@ -92,19 +92,6 @@ void DemonologyWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers
triggers.push_back(new TriggerNode("meta melee flee check", NextAction::array(0, new NextAction("flee", 39.0f), nullptr)));
}
// ===== AoE Strategy, 3+ enemies =====
DemonologyWarlockAoeStrategy::DemonologyWarlockAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
void DemonologyWarlockAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0,
new NextAction("immolation aura", 26.0f),
new NextAction("shadowflame", 22.5f),
new NextAction("seed of corruption on attacker", 22.0f),
new NextAction("seed of corruption", 21.5f),
new NextAction("rain of fire", 21.0f), nullptr)));
}
// Combat strategy to run to melee for Immolation Aura
// Enabled by default for the Demonology spec
// To enable, type "co +meta melee"

View File

@@ -21,15 +21,6 @@ public:
NextAction** getDefaultActions() override;
};
class DemonologyWarlockAoeStrategy : public CombatStrategy
{
public:
DemonologyWarlockAoeStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "demo aoe"; }
};
class MetaMeleeAoeStrategy : public CombatStrategy
{
public:

View File

@@ -87,16 +87,3 @@ void DestructionWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 39.0f), nullptr)));
}
// ===== AoE Strategy, 3+ enemies =====
DestructionWarlockAoeStrategy::DestructionWarlockAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
void DestructionWarlockAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0,
new NextAction("shadowfury", 23.0f),
new NextAction("shadowflame", 22.5f),
new NextAction("seed of corruption on attacker", 22.0f),
new NextAction("seed of corruption", 21.5f),
new NextAction("rain of fire", 21.0f), nullptr)));
}

View File

@@ -21,13 +21,4 @@ public:
NextAction** getDefaultActions() override;
};
class DestructionWarlockAoeStrategy : public CombatStrategy
{
public:
DestructionWarlockAoeStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "destro aoe"; }
};
#endif

View File

@@ -47,6 +47,19 @@ void GenericWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("devour magic cleanse", NextAction::array(0, new NextAction("devour magic cleanse", 50.0f), nullptr)));
}
// ===== AoE Strategy, 3+ enemies =====
void AoEWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0,
new NextAction("immolation aura", 26.0f),
new NextAction("shadowfury", 23.0f),
new NextAction("shadowflame", 22.5f),
new NextAction("seed of corruption on attacker", 22.0f),
new NextAction("seed of corruption", 21.5f),
new NextAction("rain of fire", 21.0f), nullptr)));
}
void WarlockBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
// Placeholder for future boost triggers

View File

@@ -21,6 +21,15 @@ public:
uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; }
};
class AoEWarlockStrategy : public CombatStrategy
{
public:
AoEWarlockStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
std::string const getName() override { return "aoe"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
};
class WarlockBoostStrategy : public Strategy
{
public:

View File

@@ -30,12 +30,9 @@ public:
creators["pet"] = &WarlockStrategyFactoryInternal::pet;
creators["spellstone"] = &WarlockStrategyFactoryInternal::spellstone;
creators["firestone"] = &WarlockStrategyFactoryInternal::firestone;
creators["affli aoe"] = &WarlockStrategyFactoryInternal::affliction_aoe;
creators["demo aoe"] = &WarlockStrategyFactoryInternal::demonology_aoe;
creators["destro aoe"] = &WarlockStrategyFactoryInternal::destruction_aoe;
creators["meta melee"] = &WarlockStrategyFactoryInternal::meta_melee_aoe;
creators["tank"] = &WarlockStrategyFactoryInternal::tank;
creators["aoe"] = &WarlockStrategyFactoryInternal::aoe;
}
private:
@@ -46,11 +43,9 @@ private:
static Strategy* pet(PlayerbotAI* botAI) { return new WarlockPetStrategy(botAI); }
static Strategy* spellstone(PlayerbotAI* botAI) { return new UseSpellstoneStrategy(botAI); }
static Strategy* firestone(PlayerbotAI* botAI) { return new UseFirestoneStrategy(botAI); }
static Strategy* affliction_aoe(PlayerbotAI* botAI) { return new AfflictionWarlockAoeStrategy(botAI); }
static Strategy* demonology_aoe(PlayerbotAI* botAI) { return new DemonologyWarlockAoeStrategy(botAI); }
static Strategy* destruction_aoe(PlayerbotAI* botAI) { return new DestructionWarlockAoeStrategy(botAI); }
static Strategy* meta_melee_aoe(PlayerbotAI* botAI) { return new MetaMeleeAoeStrategy(botAI); }
static Strategy* tank(PlayerbotAI* botAI) { return new TankWarlockStrategy(botAI); }
static Strategy* aoe(PlayerbotAI* botAI) { return new AoEWarlockStrategy(botAI); }
};
class WarlockCombatStrategyFactoryInternal : public NamedObjectContext<Strategy>