mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Eureka!
I re-implemented the pet strategies into the "general" strategy area of the WarlockAiObjectContext, and it worked!!! Finally! The issue before was they were under the "Buff" area of the aiobjectcontext, which can only have 1 active at any given time - this is why the soulstone strategy and the pet strategy were cancelling out each other. Now, pets are summoned via a non-combat strategy that is assigned with aifactory by spec!
This commit is contained in:
@@ -594,6 +594,18 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const
|
||||
nonCombatEngine->addStrategy("dps assist", false);
|
||||
break;
|
||||
case CLASS_WARLOCK:
|
||||
if (tab == WARLOCK_TAB_AFFLICATION)
|
||||
{
|
||||
nonCombatEngine->addStrategiesNoInit("felhunter", nullptr);
|
||||
}
|
||||
else if (tab == WARLOCK_TAB_DEMONOLOGY)
|
||||
{
|
||||
nonCombatEngine->addStrategiesNoInit("felguard", nullptr);
|
||||
}
|
||||
else if (tab == WARLOCK_TAB_DESTRUCTION)
|
||||
{
|
||||
nonCombatEngine->addStrategiesNoInit("imp", nullptr);
|
||||
}
|
||||
nonCombatEngine->addStrategiesNoInit("dps assist", nullptr);
|
||||
break;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
|
||||
@@ -101,19 +101,61 @@ void GenericWarlockNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& tr
|
||||
triggers.push_back(new TriggerNode("spellstone", NextAction::array(0, new NextAction("spellstone", 24.0f), nullptr)));
|
||||
}
|
||||
|
||||
// Pet-summoning triggers based on spec
|
||||
if (tab == 0) // Affliction
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon felhunter", 29.0f), nullptr)));
|
||||
}
|
||||
else if (tab == 1) // Demonology
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon felguard", 29.0f), nullptr)));
|
||||
}
|
||||
else if (tab == 2) // Destruction
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon imp", 29.0f), nullptr)));
|
||||
}
|
||||
}
|
||||
|
||||
// Non-combat strategy for summoning a Imp
|
||||
// Enabled by default for the Destruction spec
|
||||
// To enable, type "nc +imp"
|
||||
// To disable, type "nc -imp"
|
||||
SummonImpStrategy::SummonImpStrategy(PlayerbotAI* ai) : NonCombatStrategy(ai) {}
|
||||
|
||||
void SummonImpStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon imp", 29.0f), NULL)));
|
||||
}
|
||||
|
||||
// Non-combat strategy for summoning a Voidwalker
|
||||
// Disabled by default
|
||||
// To enable, type "nc +voidwalker"
|
||||
// To disable, type "nc -voidwalker"
|
||||
SummonVoidwalkerStrategy::SummonVoidwalkerStrategy(PlayerbotAI* ai) : NonCombatStrategy(ai) {}
|
||||
|
||||
void SummonVoidwalkerStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon voidwalker", 29.0f), NULL)));
|
||||
}
|
||||
|
||||
// Non-combat strategy for summoning a Succubus
|
||||
// Disabled by default
|
||||
// To enable, type "nc +succubus"
|
||||
// To disable, type "nc -succubus"
|
||||
SummonSuccubusStrategy::SummonSuccubusStrategy(PlayerbotAI* ai) : NonCombatStrategy(ai) {}
|
||||
|
||||
void SummonSuccubusStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon succubus", 29.0f), NULL)));
|
||||
}
|
||||
|
||||
// Non-combat strategy for summoning a Felhunter
|
||||
// Enabled by default for the Affliction spec
|
||||
// To enable, type "nc +felhunter"
|
||||
// To disable, type "nc -felhunter"
|
||||
SummonFelhunterStrategy::SummonFelhunterStrategy(PlayerbotAI* ai) : NonCombatStrategy(ai) {}
|
||||
|
||||
void SummonFelhunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon felhunter", 29.0f), NULL)));
|
||||
}
|
||||
|
||||
// Non-combat strategy for summoning a Felguard
|
||||
// Enabled by default for the Demonology spec
|
||||
// To enable, type "nc +felguard"
|
||||
// To disable, type "nc -felguard"
|
||||
SummonFelguardStrategy::SummonFelguardStrategy(PlayerbotAI* ai) : NonCombatStrategy(ai) {}
|
||||
|
||||
void SummonFelguardStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon felguard", 29.0f), NULL)));
|
||||
}
|
||||
|
||||
// Non-combat strategy for selecting themselves to receive soulstone
|
||||
|
||||
@@ -19,6 +19,56 @@ public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class SummonImpStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
SummonImpStrategy(PlayerbotAI* ai);
|
||||
virtual std::string const getName() override { return "imp"; }
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class SummonVoidwalkerStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
SummonVoidwalkerStrategy(PlayerbotAI* ai);
|
||||
virtual std::string const getName() override { return "voidwalker"; }
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class SummonSuccubusStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
SummonSuccubusStrategy(PlayerbotAI* ai);
|
||||
virtual std::string const getName() override { return "succubus"; }
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class SummonFelhunterStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
SummonFelhunterStrategy(PlayerbotAI* ai);
|
||||
virtual std::string const getName() override { return "felhunter"; }
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class SummonFelguardStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
SummonFelguardStrategy(PlayerbotAI* ai);
|
||||
virtual std::string const getName() override { return "felguard"; }
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class SoulstoneSelfStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -33,6 +33,11 @@ public:
|
||||
creators["destro aoe"] = &WarlockStrategyFactoryInternal::destruction_aoe;
|
||||
creators["meta melee"] = &WarlockStrategyFactoryInternal::meta_melee_aoe;
|
||||
creators["curse of elements"] = &WarlockStrategyFactoryInternal::curse_of_elements;
|
||||
creators["imp"] = &WarlockStrategyFactoryInternal::imp;
|
||||
creators["voidwalker"] = &WarlockStrategyFactoryInternal::voidwalker;
|
||||
creators["succubus"] = &WarlockStrategyFactoryInternal::succubus;
|
||||
creators["felhunter"] = &WarlockStrategyFactoryInternal::felhunter;
|
||||
creators["felguard"] = &WarlockStrategyFactoryInternal::felguard;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -46,6 +51,11 @@ private:
|
||||
static Strategy* destruction_aoe(PlayerbotAI* botAI) { return new DestructionWarlockAoeStrategy(botAI); }
|
||||
static Strategy* meta_melee_aoe(PlayerbotAI* botAI) { return new MetaMeleeAoeStrategy(botAI); }
|
||||
static Strategy* curse_of_elements(PlayerbotAI* botAI) { return new WarlockCurseOfTheElementsStrategy(botAI); }
|
||||
static Strategy* imp(PlayerbotAI* ai) { return new SummonImpStrategy(ai); }
|
||||
static Strategy* voidwalker(PlayerbotAI* ai) { return new SummonVoidwalkerStrategy(ai); }
|
||||
static Strategy* succubus(PlayerbotAI* ai) { return new SummonSuccubusStrategy(ai); }
|
||||
static Strategy* felhunter(PlayerbotAI* ai) { return new SummonFelhunterStrategy(ai); }
|
||||
static Strategy* felguard(PlayerbotAI* ai) { return new SummonFelguardStrategy(ai); }
|
||||
};
|
||||
|
||||
class WarlockCombatStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
|
||||
Reference in New Issue
Block a user