shaman, rogue strategy port, use item action.

This commit is contained in:
Yunfan Li
2023-06-08 10:37:13 +08:00
parent 231b0b51e4
commit 89d24b646c
34 changed files with 664 additions and 109 deletions

View File

@@ -4,6 +4,7 @@
#include "AiFactory.h" #include "AiFactory.h"
#include "BattlegroundMgr.h" #include "BattlegroundMgr.h"
#include "Item.h"
#include "PlayerbotAI.h" #include "PlayerbotAI.h"
#include "Playerbots.h" #include "Playerbots.h"
#include "Engine.h" #include "Engine.h"
@@ -300,7 +301,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa
else if (tab == 2) else if (tab == 2)
engine->addStrategies("heal", "bmana", "ranged", nullptr); engine->addStrategies("heal", "bmana", "ranged", nullptr);
else else
engine->addStrategies("dps", "melee aoe", "bdps", "threat", "close", nullptr); engine->addStrategies("melee", "melee aoe", "bdps", "threat", "close", nullptr);
engine->addStrategies("dps assist", "cure", "totems", nullptr); engine->addStrategies("dps assist", "cure", "totems", nullptr);
break; break;
@@ -344,7 +345,11 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa
engine->addStrategy("dps debuff"); engine->addStrategy("dps debuff");
break; break;
case CLASS_ROGUE: case CLASS_ROGUE:
engine->addStrategies("dps", "threat", "dps assist", "aoe", "close", "behind", "stealth", nullptr); if (tab == ROGUE_TAB_ASSASSINATION) {
engine->addStrategies("melee", "threat", "dps assist", "aoe", "close", "behind", nullptr);
} else {
engine->addStrategies("dps", "threat", "dps assist", "aoe", "close", "behind", nullptr);
}
break; break;
case CLASS_WARLOCK: case CLASS_WARLOCK:
engine->addStrategies("dps assist", "dps", "dps debuff", "aoe", "ranged", "threat", nullptr); engine->addStrategies("dps assist", "dps", "dps debuff", "aoe", "ranged", "threat", nullptr);

View File

@@ -2264,6 +2264,8 @@ void PlayerbotFactory::InitMounts()
fslow = { 32244, 32245, 32243 }; fslow = { 32244, 32245, 32243 };
ffast = { 32295, 32297, 32246, 32296 }; ffast = { 32295, 32297, 32246, 32296 };
break; break;
default:
break;
} }
mounts[bot->getRace()][0] = slow; mounts[bot->getRace()][0] = slow;

View File

@@ -88,5 +88,5 @@ bool FindItemUsageVisitor::Accept(ItemTemplate const* proto)
bool FindUsableNamedItemVisitor::Accept(ItemTemplate const* proto) bool FindUsableNamedItemVisitor::Accept(ItemTemplate const* proto)
{ {
return true; return proto && !proto->Name1.empty() && strstri(proto->Name1.c_str(), name.c_str());
} }

View File

@@ -414,9 +414,10 @@ class FindItemUsageVisitor : public FindUsableItemVisitor
class FindUsableNamedItemVisitor : public FindUsableItemVisitor class FindUsableNamedItemVisitor : public FindUsableItemVisitor
{ {
public: public:
FindUsableNamedItemVisitor(Player* bot): FindUsableItemVisitor(bot) {} FindUsableNamedItemVisitor(Player* bot, std::string name): FindUsableItemVisitor(bot), name(name) {}
bool Accept(ItemTemplate const* proto) override; bool Accept(ItemTemplate const* proto) override;
private:
std::string name;
}; };
#endif #endif

View File

@@ -288,12 +288,10 @@ std::vector<Item*> InventoryAction::parseItems(std::string const text, IterateIt
IterateItems(&visitor, ITERATE_ITEMS_IN_BAGS); IterateItems(&visitor, ITERATE_ITEMS_IN_BAGS);
found.insert(visitor.GetResult().begin(), visitor.GetResult().end()); found.insert(visitor.GetResult().begin(), visitor.GetResult().end());
} }
if (text == "")
{ FindUsableNamedItemVisitor visitor(bot, text);
FindUsableNamedItemVisitor visitor(bot); IterateItems(&visitor, ITERATE_ITEMS_IN_BAGS);
IterateItems(&visitor, ITERATE_ITEMS_IN_BAGS); found.insert(visitor.GetResult().begin(), visitor.GetResult().end());
found.insert(visitor.GetResult().begin(), visitor.GetResult().end());
}
uint32 quality = chat->parseItemQuality(text); uint32 quality = chat->parseItemQuality(text);
if (quality != MAX_ITEM_QUALITY) if (quality != MAX_ITEM_QUALITY)

View File

@@ -19,7 +19,9 @@ bool UseItemAction::Execute(Event event)
if (gos.empty()) if (gos.empty())
{ {
return UseItemAuto(*items.begin()); if (!items.empty()) {
return UseItemAuto(*items.begin());
}
} }
else else
{ {

View File

@@ -122,6 +122,9 @@ void CasterDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("moonfire", NextAction::array(0, new NextAction("moonfire", ACTION_NORMAL + 4), nullptr))); triggers.push_back(new TriggerNode("moonfire", NextAction::array(0, new NextAction("moonfire", ACTION_NORMAL + 4), nullptr)));
triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 5), NULL))); triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 5), NULL)));
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 49.0f), NULL))); triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 49.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member remove curse",
NextAction::array(0, new NextAction("remove curse on party", ACTION_DISPEL + 7), NULL)));
} }
void CasterDruidAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void CasterDruidAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -253,4 +253,10 @@ class CastPartyNourishAction : public HealPartyMemberAction
public: public:
CastPartyNourishAction(PlayerbotAI* ai) : HealPartyMemberAction(ai, "nourish") {} CastPartyNourishAction(PlayerbotAI* ai) : HealPartyMemberAction(ai, "nourish") {}
}; };
class CastDruidRemoveCurseOnPartyAction : public CurePartyMemberAction
{
public:
CastDruidRemoveCurseOnPartyAction(PlayerbotAI* ai) : CurePartyMemberAction(ai, "remove curse", DISPEL_CURSE) {}
};
#endif #endif

View File

@@ -95,6 +95,7 @@ class DruidTriggerFactoryInternal : public NamedObjectContext<Trigger>
creators["eclipse (lunar)"] = &DruidTriggerFactoryInternal::eclipse_lunar; creators["eclipse (lunar)"] = &DruidTriggerFactoryInternal::eclipse_lunar;
creators["bash on enemy healer"] = &DruidTriggerFactoryInternal::bash_on_enemy_healer; creators["bash on enemy healer"] = &DruidTriggerFactoryInternal::bash_on_enemy_healer;
creators["nature's swiftness"] = &DruidTriggerFactoryInternal::natures_swiftness; creators["nature's swiftness"] = &DruidTriggerFactoryInternal::natures_swiftness;
creators["party member remove curse"] = &DruidTriggerFactoryInternal::party_member_remove_curse;
} }
private: private:
@@ -123,6 +124,7 @@ class DruidTriggerFactoryInternal : public NamedObjectContext<Trigger>
static Trigger* tree_form(PlayerbotAI* botAI) { return new TreeFormTrigger(botAI); } static Trigger* tree_form(PlayerbotAI* botAI) { return new TreeFormTrigger(botAI); }
static Trigger* bash_on_enemy_healer(PlayerbotAI* botAI) { return new BashInterruptEnemyHealerSpellTrigger(botAI); } static Trigger* bash_on_enemy_healer(PlayerbotAI* botAI) { return new BashInterruptEnemyHealerSpellTrigger(botAI); }
static Trigger* omen_of_clarity(PlayerbotAI* botAI) { return new OmenOfClarityTrigger(botAI); } static Trigger* omen_of_clarity(PlayerbotAI* botAI) { return new OmenOfClarityTrigger(botAI); }
static Trigger* party_member_remove_curse(PlayerbotAI* ai) { return new DruidPartyMemberRemoveCurseTrigger(ai); }
}; };
class DruidAiObjectContextInternal : public NamedObjectContext<Action> class DruidAiObjectContextInternal : public NamedObjectContext<Action>
@@ -202,6 +204,7 @@ class DruidAiObjectContextInternal : public NamedObjectContext<Action>
creators["wild growth on party"] = &DruidAiObjectContextInternal::wild_growth_on_party; creators["wild growth on party"] = &DruidAiObjectContextInternal::wild_growth_on_party;
creators["swiftmend on party"] = &DruidAiObjectContextInternal::swiftmend_on_party; creators["swiftmend on party"] = &DruidAiObjectContextInternal::swiftmend_on_party;
creators["nourish on party"] = &DruidAiObjectContextInternal::nourish_on_party; creators["nourish on party"] = &DruidAiObjectContextInternal::nourish_on_party;
creators["remove curse on party"] = &DruidAiObjectContextInternal::remove_curse_on_party;
} }
private: private:
@@ -276,6 +279,7 @@ class DruidAiObjectContextInternal : public NamedObjectContext<Action>
static Action* wild_growth_on_party(PlayerbotAI* ai) { return new CastWildGrowthOnPartyAction(ai); } static Action* wild_growth_on_party(PlayerbotAI* ai) { return new CastWildGrowthOnPartyAction(ai); }
static Action* swiftmend_on_party(PlayerbotAI *ai) { return new CastPartySwiftmendAction(ai); } static Action* swiftmend_on_party(PlayerbotAI *ai) { return new CastPartySwiftmendAction(ai); }
static Action* nourish_on_party(PlayerbotAI *ai) { return new CastPartyNourishAction(ai); } static Action* nourish_on_party(PlayerbotAI *ai) { return new CastPartyNourishAction(ai); }
static Action* remove_curse_on_party(PlayerbotAI *ai) { return new CastDruidRemoveCurseOnPartyAction(ai); }
}; };
DruidAiObjectContext::DruidAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI) DruidAiObjectContext::DruidAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)

View File

@@ -178,4 +178,9 @@ class NaturesSwiftnessTrigger : public BuffTrigger
NaturesSwiftnessTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "nature's swiftness") { } NaturesSwiftnessTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "nature's swiftness") { }
}; };
class DruidPartyMemberRemoveCurseTrigger : public PartyMemberNeedCureTrigger
{
public:
DruidPartyMemberRemoveCurseTrigger(PlayerbotAI* ai) : PartyMemberNeedCureTrigger(ai, "druid remove curse", DISPEL_CURSE) {}
};
#endif #endif

View File

@@ -23,7 +23,9 @@ void HealDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr))); triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr)));
triggers.push_back(new TriggerNode("tree form", NextAction::array(0, new NextAction("tree form", ACTION_HIGH + 1), nullptr))); triggers.push_back(new TriggerNode("tree form", NextAction::array(0, new NextAction("tree form", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("party member to heal out of spell range", NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 9), nullptr))); triggers.push_back(new TriggerNode("party member to heal out of spell range", NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 9), nullptr)));
triggers.push_back(new TriggerNode(
"party member remove curse",
NextAction::array(0, new NextAction("remove curse on party", ACTION_DISPEL + 7), NULL)));
// CRITICAL // CRITICAL
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"party member critical health", "party member critical health",

View File

@@ -0,0 +1,93 @@
#include "AssassinationRogueStrategy.h"
#include "Playerbots.h"
class AssassinationRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
AssassinationRogueStrategyActionNodeFactory()
{
creators["mutilate"] = &mutilate;
creators["envenom"] = &envenom;
}
private:
static ActionNode* mutilate(PlayerbotAI* ai)
{
return new ActionNode ("mutilate",
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("sinister strike"), NULL),
/*C*/ NULL);
}
static ActionNode* envenom(PlayerbotAI* ai)
{
return new ActionNode ("envenom",
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("eviscerate"), NULL),
/*C*/ NULL);
}
};
AssassinationRogueStrategy::AssassinationRogueStrategy(PlayerbotAI* ai) : MeleeCombatStrategy(ai)
{
actionNodeFactories.Add(new AssassinationRogueStrategyActionNodeFactory());
}
NextAction** AssassinationRogueStrategy::getDefaultActions()
{
return NextAction::array(0,
new NextAction("melee", ACTION_NORMAL),
NULL);
}
void AssassinationRogueStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
{
MeleeCombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode(
"high energy available",
NextAction::array(0, new NextAction("mutilate", ACTION_NORMAL + 3), NULL)));
triggers.push_back(new TriggerNode(
"slice and dice",
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)));
triggers.push_back(new TriggerNode(
"expose armor",
NextAction::array(0, new NextAction("expose armor", ACTION_HIGH + 3), NULL)));
triggers.push_back(new TriggerNode(
"medium threat",
NextAction::array(0, new NextAction("vanish", ACTION_HIGH), NULL)));
triggers.push_back(new TriggerNode(
"low health",
NextAction::array(0, new NextAction("evasion", ACTION_EMERGENCY), new NextAction("feint", ACTION_EMERGENCY), NULL)));
triggers.push_back(new TriggerNode(
"kick",
NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), NULL)));
triggers.push_back(new TriggerNode(
"kick on enemy healer",
NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), NULL)));
triggers.push_back(new TriggerNode(
"medium aoe",
NextAction::array(0, new NextAction("fan of knives", ACTION_NORMAL + 5), NULL)));
triggers.push_back(new TriggerNode(
"tricks of the trade on main tank",
NextAction::array(0, new NextAction("tricks of the trade on main tank", ACTION_HIGH + 7), NULL)));
triggers.push_back(new TriggerNode(
"enemy out of melee",
NextAction::array(0,
new NextAction("stealth", ACTION_NORMAL + 9),
new NextAction("sprint", ACTION_NORMAL + 8),
new NextAction("reach melee", ACTION_NORMAL + 7),
NULL)));
}

View File

@@ -0,0 +1,19 @@
#ifndef _PLAYERBOT_ASSASSINATIONROGUESTRATEGY_H
#define _PLAYERBOT_ASSASSINATIONROGUESTRATEGY_H
#include "MeleeCombatStrategy.h"
class AssassinationRogueStrategy : public MeleeCombatStrategy
{
public:
AssassinationRogueStrategy(PlayerbotAI* ai);
public:
virtual void InitTriggers(std::vector<TriggerNode*> &triggers) override;
virtual std::string const getName() override { return "melee"; }
virtual NextAction** getDefaultActions() override;
virtual int GetType() { return MeleeCombatStrategy::GetType() | STRATEGY_TYPE_DPS; }
};
#endif

View File

@@ -10,101 +10,116 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
public: public:
DpsRogueStrategyActionNodeFactory() DpsRogueStrategyActionNodeFactory()
{ {
creators["riposte"] = &riposte;
creators["mutilate"] = &mutilate; creators["mutilate"] = &mutilate;
creators["sinister strike"] = &sinister_strike; creators["sinister strike"] = &sinister_strike;
creators["kick"] = &kick; creators["kick"] = &kick;
creators["kidney shot"] = &kidney_shot; creators["kidney shot"] = &kidney_shot;
creators["slice and dice"] = &slice_and_dice;
creators["rupture"] = &rupture;
creators["backstab"] = &backstab; creators["backstab"] = &backstab;
creators["melee"] = &melee;
} }
private: private:
static ActionNode* riposte([[maybe_unused]] PlayerbotAI* botAI) static ActionNode* melee(PlayerbotAI* botAI)
{ {
return new ActionNode ("riposte", return new ActionNode ("melee",
/*P*/ nullptr, /*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr), /*A*/ NextAction::array(0, new NextAction("mutilate"), NULL),
/*C*/ nullptr); /*C*/ NULL);
} }
static ActionNode* mutilate(PlayerbotAI* botAI)
static ActionNode* mutilate([[maybe_unused]] PlayerbotAI* botAI)
{ {
return new ActionNode ("mutilate", return new ActionNode ("mutilate",
/*P*/ nullptr, /*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("sinister strike"), nullptr), /*A*/ NextAction::array(0, new NextAction("sinister strike"), NULL),
/*C*/ nullptr); /*C*/ NULL);
} }
static ActionNode* sinister_strike(PlayerbotAI* botAI)
static ActionNode* sinister_strike([[maybe_unused]] PlayerbotAI* botAI)
{ {
return new ActionNode ("sinister strike", return new ActionNode ("sinister strike",
/*P*/ nullptr, /*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("melee"), nullptr), /*A*/ NextAction::array(0, new NextAction("melee"), NULL),
/*C*/ nullptr); /*C*/ NULL);
} }
static ActionNode* kick(PlayerbotAI* botAI)
static ActionNode* kick([[maybe_unused]] PlayerbotAI* botAI)
{ {
return new ActionNode ("kick", return new ActionNode ("kick",
/*P*/ nullptr, /*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("kidney shot"), nullptr), /*A*/ NextAction::array(0, new NextAction("kidney shot"), NULL),
/*C*/ nullptr); /*C*/ NULL);
} }
static ActionNode* kidney_shot(PlayerbotAI* botAI)
static ActionNode* kidney_shot([[maybe_unused]] PlayerbotAI* botAI)
{ {
return new ActionNode ("kidney shot", return new ActionNode ("kidney shot",
/*P*/ nullptr, /*P*/ NULL,
/*A*/ nullptr, /*A*/ NULL,
/*C*/ nullptr); /*C*/ NULL);
} }
static ActionNode* backstab(PlayerbotAI* botAI)
static ActionNode* rupture([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode ("rupture",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("eviscerate"), nullptr),
/*C*/ nullptr);
}
ACTION_NODE_A(slice_and_dice, "slice and dice", "rupture");
static ActionNode* backstab([[maybe_unused]] PlayerbotAI* botAI)
{ {
return new ActionNode ("backstab", return new ActionNode ("backstab",
/*P*/ nullptr, /*P*/ NULL,
/*A*/ nullptr, /*A*/ NextAction::array(0, new NextAction("mutilate"), NULL),
/*C*/ nullptr); /*C*/ NULL);
} }
}; };
DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(botAI)
{ {
actionNodeFactories.Add(new DpsRogueStrategyActionNodeFactory()); actionNodeFactories.Add(new DpsRogueStrategyActionNodeFactory());
} }
NextAction** DpsRogueStrategy::getDefaultActions() NextAction** DpsRogueStrategy::getDefaultActions()
{ {
return NextAction::array(0, new NextAction("riposte", ACTION_NORMAL), nullptr); return NextAction::array(0, new NextAction("melee", ACTION_NORMAL), NULL);
} }
void DpsRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void DpsRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
CombatStrategy::InitTriggers(triggers); MeleeCombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("combo points available", NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 2), nullptr))); triggers.push_back(new TriggerNode(
triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("feint", ACTION_HIGH), nullptr))); "high energy available",
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("evasion", ACTION_EMERGENCY), new NextAction("feint", ACTION_EMERGENCY), nullptr))); NextAction::array(0, new NextAction("sinister strike", ACTION_NORMAL + 3), NULL)));
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("blind", ACTION_EMERGENCY), new NextAction("vanish", ACTION_EMERGENCY), nullptr)));
triggers.push_back(new TriggerNode("kick", NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), nullptr))); triggers.push_back(new TriggerNode(
triggers.push_back(new TriggerNode("kick on enemy healer", NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), nullptr))); "slice and dice",
triggers.push_back(new TriggerNode("behind target", NextAction::array(0, new NextAction("backstab", ACTION_HIGH + 1), nullptr))); NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 2), NULL)));
triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 2), nullptr)));
triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 1), nullptr))); triggers.push_back(new TriggerNode(
triggers.push_back(new TriggerNode("in stealth", NextAction::array(0, new NextAction("check stealth", ACTION_EMERGENCY), nullptr))); "combo points available",
triggers.push_back(new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", ACTION_NORMAL), nullptr))); NextAction::array(0, new NextAction("rupture", ACTION_HIGH + 1), NULL)));
triggers.push_back(new TriggerNode("sprint", NextAction::array(0, new NextAction("sprint", ACTION_INTERRUPT), nullptr)));
triggers.push_back(new TriggerNode(
"medium threat",
NextAction::array(0, new NextAction("vanish", ACTION_HIGH), NULL)));
triggers.push_back(new TriggerNode(
"low health",
NextAction::array(0, new NextAction("evasion", ACTION_EMERGENCY), new NextAction("feint", ACTION_EMERGENCY), NULL)));
triggers.push_back(new TriggerNode(
"kick",
NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), NULL)));
triggers.push_back(new TriggerNode(
"kick on enemy healer",
NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), NULL)));
triggers.push_back(new TriggerNode(
"behind target",
NextAction::array(0, new NextAction("backstab", ACTION_NORMAL), NULL)));
triggers.push_back(new TriggerNode(
"light aoe",
NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH + 3), NULL)));
triggers.push_back(new TriggerNode(
"enemy out of melee",
NextAction::array(0, new NextAction("stealth", ACTION_NORMAL + 9), new NextAction("reach melee", ACTION_NORMAL + 8), NULL)));
triggers.push_back(new TriggerNode(
"expose armor",
NextAction::array(0, new NextAction("expose armor", ACTION_HIGH + 3), NULL)));
} }
class StealthedRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode> class StealthedRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>

View File

@@ -6,10 +6,11 @@
#define _PLAYERBOT_DPSROGUESTRATEGY_H #define _PLAYERBOT_DPSROGUESTRATEGY_H
#include "CombatStrategy.h" #include "CombatStrategy.h"
#include "MeleeCombatStrategy.h"
class PlayerbotAI; class PlayerbotAI;
class DpsRogueStrategy : public CombatStrategy class DpsRogueStrategy : public MeleeCombatStrategy
{ {
public: public:
DpsRogueStrategy(PlayerbotAI* botAI); DpsRogueStrategy(PlayerbotAI* botAI);
@@ -17,6 +18,7 @@ class DpsRogueStrategy : public CombatStrategy
void InitTriggers(std::vector<TriggerNode*>& triggers) override; void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "dps"; } std::string const getName() override { return "dps"; }
NextAction** getDefaultActions() override; NextAction** getDefaultActions() override;
virtual int GetType() { return MeleeCombatStrategy::GetType() | STRATEGY_TYPE_DPS; }
}; };
class StealthedRogueStrategy : public Strategy class StealthedRogueStrategy : public Strategy

View File

@@ -11,6 +11,22 @@ void GenericRogueNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& trig
triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 1), nullptr))); triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 1), nullptr)));
triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 2), nullptr))); triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 2), nullptr)));
triggers.push_back(new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", 1.0f), nullptr))); // triggers.push_back(new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", 1.0f), nullptr)));
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply poison", 1.0f), nullptr))); // triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply poison", 1.0f), nullptr)));
triggers.push_back(new TriggerNode(
"main hand weapon no enchant",
NextAction::array(0, new NextAction("use instant poison", 20.0f), NULL)));
triggers.push_back(new TriggerNode(
"off hand weapon no enchant",
NextAction::array(0, new NextAction("use deadly poison", 19.0f), NULL)));
triggers.push_back(new TriggerNode(
"off hand weapon no enchant",
NextAction::array(0, new NextAction("use instant poison", 18.0f), NULL)));
triggers.push_back(new TriggerNode(
"often",
NextAction::array(0, new NextAction("unstealth", 10.0f), NULL)));
} }

View File

@@ -16,7 +16,7 @@ bool CastStealthAction::Execute(Event event)
{ {
if (botAI->CastSpell("stealth", bot)) if (botAI->CastSpell("stealth", bot))
{ {
botAI->ChangeStrategy("-dps,+stealthed", BOT_STATE_COMBAT); // botAI->ChangeStrategy("-dps,+stealthed", BOT_STATE_COMBAT);
} }
return true; return true;
@@ -25,7 +25,7 @@ bool CastStealthAction::Execute(Event event)
bool UnstealthAction::Execute(Event event) bool UnstealthAction::Execute(Event event)
{ {
botAI->RemoveAura("stealth"); botAI->RemoveAura("stealth");
botAI->ChangeStrategy("+dps,-stealthed", BOT_STATE_COMBAT); // botAI->ChangeStrategy("+dps,-stealthed", BOT_STATE_COMBAT);
return true; return true;
} }
@@ -49,3 +49,69 @@ bool CastVanishAction::isUseful()
// do not use with WSG flag or EYE flag // do not use with WSG flag or EYE flag
return !botAI->HasAura(23333, bot) && !botAI->HasAura(23335, bot) && !botAI->HasAura(34976, bot); return !botAI->HasAura(23333, bot) && !botAI->HasAura(23335, bot) && !botAI->HasAura(34976, bot);
} }
bool CastTricksOfTheTradeOnMainTankAction::isUseful() {
return CastSpellAction::isUseful() && AI_VALUE2(float, "distance", GetTargetName()) < 20.0f;
}
bool UseDeadlyPoisonAction::Execute(Event event) {
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
poison_name = getName() + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
break;
}
}
if (items.empty()) {
return false;
}
return UseItemAuto(*items.begin());
}
bool UseDeadlyPoisonAction::isPossible() {
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
poison_name = getName() + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
break;
}
}
return !items.empty();
}
bool UseInstantPoisonAction::Execute(Event event) {
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
poison_name = getName() + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
break;
}
}
if (items.empty()) {
return false;
}
return UseItemAuto(*items.begin());
}
bool UseInstantPoisonAction::isPossible() {
std::vector<std::string> poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""};
std::vector<Item*> items;
std::string poison_name;
for (std::string& suffix: poison_suffixs) {
poison_name = getName() + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
break;
}
}
return !items.empty();
}

View File

@@ -6,6 +6,7 @@
#define _PLAYERBOT_ROGUEACTIONS_H #define _PLAYERBOT_ROGUEACTIONS_H
#include "GenericSpellActions.h" #include "GenericSpellActions.h"
#include "UseItemAction.h"
class PlayerbotAI; class PlayerbotAI;
@@ -113,4 +114,32 @@ class CastKickOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
CastKickOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "kick") { } CastKickOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "kick") { }
}; };
class EnvenomAction : public CastMeleeSpellAction
{
public:
EnvenomAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "envenom") {}
};
class CastTricksOfTheTradeOnMainTankAction : public BuffOnMainTankAction
{
public:
CastTricksOfTheTradeOnMainTankAction(PlayerbotAI* ai) : BuffOnMainTankAction(ai, "tricks of the trade", true) {}
virtual bool isUseful() override;
};
class UseDeadlyPoisonAction : public UseItemAction
{
public:
UseDeadlyPoisonAction(PlayerbotAI* ai) : UseItemAction(ai, "Deadly Poison") {}
virtual bool Execute(Event event) override;
virtual bool isPossible() override;
};
class UseInstantPoisonAction : public UseItemAction
{
public:
UseInstantPoisonAction(PlayerbotAI* ai) : UseItemAction(ai, "Instant Poison") {}
virtual bool Execute(Event event) override;
virtual bool isPossible() override;
};
#endif #endif

View File

@@ -13,6 +13,7 @@
#include "NamedObjectContext.h" #include "NamedObjectContext.h"
#include "PullStrategy.h" #include "PullStrategy.h"
#include "Playerbots.h" #include "Playerbots.h"
#include "AssassinationRogueStrategy.h"
class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy> class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy>
{ {
@@ -27,6 +28,7 @@ class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy>
creators["stealthed"] = &RogueStrategyFactoryInternal::stealthed; creators["stealthed"] = &RogueStrategyFactoryInternal::stealthed;
creators["stealth"] = &RogueStrategyFactoryInternal::stealth; creators["stealth"] = &RogueStrategyFactoryInternal::stealth;
creators["cc"] = &RogueStrategyFactoryInternal::cc; creators["cc"] = &RogueStrategyFactoryInternal::cc;
creators["melee"] = &RogueStrategyFactoryInternal::melee;
} }
private: private:
@@ -38,6 +40,7 @@ class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy>
static Strategy* stealthed(PlayerbotAI* botAI) { return new StealthedRogueStrategy(botAI); } static Strategy* stealthed(PlayerbotAI* botAI) { return new StealthedRogueStrategy(botAI); }
static Strategy* stealth(PlayerbotAI* botAI) { return new StealthStrategy(botAI); } static Strategy* stealth(PlayerbotAI* botAI) { return new StealthStrategy(botAI); }
static Strategy* cc(PlayerbotAI* botAI) { return new RogueCcStrategy(botAI); } static Strategy* cc(PlayerbotAI* botAI) { return new RogueCcStrategy(botAI); }
static Strategy* melee(PlayerbotAI* botAI) { return new AssassinationRogueStrategy(botAI); }
}; };
class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger> class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
@@ -56,6 +59,9 @@ class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
creators["no stealth"] = &RogueTriggerFactoryInternal::no_stealth; creators["no stealth"] = &RogueTriggerFactoryInternal::no_stealth;
creators["stealth"] = &RogueTriggerFactoryInternal::stealth; creators["stealth"] = &RogueTriggerFactoryInternal::stealth;
creators["sprint"] = &RogueTriggerFactoryInternal::sprint; creators["sprint"] = &RogueTriggerFactoryInternal::sprint;
creators["main hand weapon no enchant"] = &RogueTriggerFactoryInternal::main_hand_weapon_no_enchant;
creators["off hand weapon no enchant"] = &RogueTriggerFactoryInternal::off_hand_weapon_no_enchant;
creators["tricks of the trade on main tank"] = &RogueTriggerFactoryInternal::tricks_of_the_trade_on_main_tank;
} }
private: private:
@@ -71,6 +77,9 @@ class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
static Trigger* no_stealth(PlayerbotAI* botAI) { return new NoStealthTrigger(botAI); } static Trigger* no_stealth(PlayerbotAI* botAI) { return new NoStealthTrigger(botAI); }
static Trigger* stealth(PlayerbotAI* botAI) { return new StealthTrigger(botAI); } static Trigger* stealth(PlayerbotAI* botAI) { return new StealthTrigger(botAI); }
static Trigger* sprint(PlayerbotAI* botAI) { return new SprintTrigger(botAI); } static Trigger* sprint(PlayerbotAI* botAI) { return new SprintTrigger(botAI); }
static Trigger* main_hand_weapon_no_enchant(PlayerbotAI* ai) { return new MainHandWeaponNoEnchantTrigger(ai); }
static Trigger* off_hand_weapon_no_enchant(PlayerbotAI* ai) { return new OffHandWeaponNoEnchantTrigger(ai); }
static Trigger* tricks_of_the_trade_on_main_tank(PlayerbotAI* ai) { return new TricksOfTheTradeOnMainTankTrigger(ai); }
}; };
class RogueAiObjectContextInternal : public NamedObjectContext<Action> class RogueAiObjectContextInternal : public NamedObjectContext<Action>
@@ -104,6 +113,10 @@ class RogueAiObjectContextInternal : public NamedObjectContext<Action>
creators["unstealth"] = &RogueAiObjectContextInternal::unstealth; creators["unstealth"] = &RogueAiObjectContextInternal::unstealth;
creators["sap"] = &RogueAiObjectContextInternal::sap; creators["sap"] = &RogueAiObjectContextInternal::sap;
creators["check stealth"] = &RogueAiObjectContextInternal::check_stealth; creators["check stealth"] = &RogueAiObjectContextInternal::check_stealth;
creators["envenom"] = &RogueAiObjectContextInternal::envenom;
creators["tricks of the trade on main tank"] = &RogueAiObjectContextInternal::tricks_of_the_trade_on_main_tank;
creators["use instant poison"] = &RogueAiObjectContextInternal::use_instant_poison;
creators["use deadly poison"] = &RogueAiObjectContextInternal::use_deadly_poison;
} }
private: private:
@@ -133,6 +146,10 @@ class RogueAiObjectContextInternal : public NamedObjectContext<Action>
static Action* check_stealth(PlayerbotAI* botAI) { return new CheckStealthAction(botAI); } static Action* check_stealth(PlayerbotAI* botAI) { return new CheckStealthAction(botAI); }
static Action* sap(PlayerbotAI* botAI) { return new CastSapAction(botAI); } static Action* sap(PlayerbotAI* botAI) { return new CastSapAction(botAI); }
static Action* unstealth(PlayerbotAI* botAI) { return new UnstealthAction(botAI); } static Action* unstealth(PlayerbotAI* botAI) { return new UnstealthAction(botAI); }
static Action* envenom(PlayerbotAI* ai) { return new EnvenomAction(ai); }
static Action* tricks_of_the_trade_on_main_tank(PlayerbotAI* ai) { return new CastTricksOfTheTradeOnMainTankAction(ai); }
static Action* use_instant_poison(PlayerbotAI* ai) { return new UseInstantPoisonAction(ai); }
static Action* use_deadly_poison(PlayerbotAI* ai) { return new UseDeadlyPoisonAction(ai); }
}; };
RogueAiObjectContext::RogueAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI) RogueAiObjectContext::RogueAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)

View File

@@ -92,3 +92,21 @@ bool SprintTrigger::IsActive()
targeted && (sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "dps target"), distance) || targeted && (sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "dps target"), distance) ||
sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), distance)); sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), distance));
} }
bool ExposeArmorTrigger::IsActive() {
return DebuffTrigger::IsActive() && !botAI->HasAura("sunder armor", bot, false, false, -1, true) && AI_VALUE2(uint8, "combo", "current target") <= 3;
}
bool MainHandWeaponNoEnchantTrigger::IsActive() {
Item* const itemForSpell = bot->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND );
if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
return false;
return true;
}
bool OffHandWeaponNoEnchantTrigger::IsActive() {
Item* const itemForSpell = bot->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
return false;
return true;
}

View File

@@ -39,6 +39,7 @@ class ExposeArmorTrigger : public DebuffTrigger
{ {
public: public:
ExposeArmorTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "expose armor") { } ExposeArmorTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "expose armor") { }
virtual bool IsActive() override;
}; };
class KickInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger class KickInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger
@@ -92,4 +93,24 @@ class SprintTrigger : public BuffTrigger
bool IsActive() override; bool IsActive() override;
}; };
class MainHandWeaponNoEnchantTrigger : public BuffTrigger
{
public:
MainHandWeaponNoEnchantTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "main hand", 1) {}
virtual bool IsActive();
};
class OffHandWeaponNoEnchantTrigger : public BuffTrigger
{
public:
OffHandWeaponNoEnchantTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "off hand", 1) {}
virtual bool IsActive();
};
class TricksOfTheTradeOnMainTankTrigger : public BuffOnMainTankTrigger
{
public:
TricksOfTheTradeOnMainTankTrigger(PlayerbotAI* ai) : BuffOnMainTankTrigger(ai, "tricks of the trade", true) {}
};
#endif #endif

View File

@@ -11,6 +11,7 @@ class CasterShamanStrategyActionNodeFactory : public NamedObjectFactory<ActionNo
CasterShamanStrategyActionNodeFactory() CasterShamanStrategyActionNodeFactory()
{ {
creators["magma totem"] = &magma_totem; creators["magma totem"] = &magma_totem;
creators["totem of wrath"] = &totem_of_wrath;
} }
private: private:
@@ -21,6 +22,13 @@ class CasterShamanStrategyActionNodeFactory : public NamedObjectFactory<ActionNo
/*A*/ nullptr, /*A*/ nullptr,
/*C*/ NextAction::array(0, new NextAction("fire nova"), nullptr)); /*C*/ NextAction::array(0, new NextAction("fire nova"), nullptr));
} }
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);
}
}; };
CasterShamanStrategy::CasterShamanStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) CasterShamanStrategy::CasterShamanStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI)
@@ -30,7 +38,10 @@ CasterShamanStrategy::CasterShamanStrategy(PlayerbotAI* botAI) : GenericShamanSt
NextAction** CasterShamanStrategy::getDefaultActions() NextAction** CasterShamanStrategy::getDefaultActions()
{ {
return NextAction::array(0, new NextAction("lightning bolt", 10.0f), nullptr); return NextAction::array(0,
new NextAction("lava burst", 11.0f),
new NextAction("lightning bolt", 10.0f),
NULL);
} }
void CasterShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void CasterShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
@@ -39,10 +50,16 @@ void CasterShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr))); triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr)));
triggers.push_back(new TriggerNode("shaman weapon", NextAction::array(0, new NextAction("flametongue weapon", 23.0f), nullptr))); triggers.push_back(new TriggerNode("shaman weapon", NextAction::array(0, new NextAction("flametongue weapon", 23.0f), nullptr)));
triggers.push_back(new TriggerNode("searing totem", NextAction::array(0, new NextAction("searing totem", 19.0f), nullptr))); // triggers.push_back(new TriggerNode("searing totem", NextAction::array(0, new NextAction("searing totem", 19.0f), nullptr)));
triggers.push_back(new TriggerNode("shock", NextAction::array(0, new NextAction("earth shock", 20.0f), nullptr))); triggers.push_back(new TriggerNode("flame shock", NextAction::array(0, new NextAction("flame shock", 20.0f), nullptr)));
triggers.push_back(new TriggerNode("frost shock snare", NextAction::array(0, new NextAction("frost shock", 21.0f), nullptr))); // triggers.push_back(new TriggerNode("frost shock snare", NextAction::array(0, new NextAction("frost shock", 21.0f), nullptr)));
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("flametongue totem", ACTION_LIGHT_HEAL), nullptr))); triggers.push_back(new TriggerNode(
"no fire totem",
NextAction::array(0, new NextAction("totem of wrath", 15.0f), NULL)));
triggers.push_back(new TriggerNode(
"enemy too close for spell",
NextAction::array(0, new NextAction("flee", 49.0f), NULL)));
} }
void CasterAoeShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void CasterAoeShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -99,7 +99,8 @@ class GenericShamanStrategyActionNodeFactory : public NamedObjectFactory<ActionN
{ {
return new ActionNode ("riptide on party", return new ActionNode ("riptide on party",
/*P*/ nullptr, /*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("healing wave on party"), nullptr), // /*A*/ NextAction::array(0, new NextAction("healing wave on party"), nullptr),
/*A*/ nullptr,
/*C*/ nullptr); /*C*/ nullptr);
} }
}; };
@@ -116,13 +117,16 @@ void GenericShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("wind shear", NextAction::array(0, new NextAction("wind shear", 23.0f), nullptr))); triggers.push_back(new TriggerNode("wind shear", NextAction::array(0, new NextAction("wind shear", 23.0f), nullptr)));
triggers.push_back(new TriggerNode("wind shear on enemy healer", NextAction::array(0, new NextAction("wind shear on enemy healer", 23.0f), nullptr))); triggers.push_back(new TriggerNode("wind shear on enemy healer", NextAction::array(0, new NextAction("wind shear on enemy healer", 23.0f), nullptr)));
triggers.push_back(new TriggerNode("purge", NextAction::array(0, new NextAction("purge", 10.0f), nullptr))); triggers.push_back(new TriggerNode("purge", NextAction::array(0, new NextAction("purge", 10.0f), nullptr)));
triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, new NextAction("lesser healing wave on party", 25.0f), nullptr))); // triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, new NextAction("lesser healing wave on party", 25.0f), nullptr)));
triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, new NextAction("riptide on party", 25.0f), nullptr))); // triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, new NextAction("riptide on party", 25.0f), nullptr)));
triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("chain heal", 27.0f), nullptr))); // triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("chain heal", 27.0f), nullptr)));
triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("lesser healing wave", 26.0f), nullptr))); // triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("lesser healing wave", 26.0f), nullptr)));
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("riptide", 26.0f), nullptr))); // triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("riptide", 26.0f), nullptr)));
triggers.push_back(new TriggerNode("heroism", NextAction::array(0, new NextAction("heroism", 31.0f), nullptr))); triggers.push_back(new TriggerNode("heroism", NextAction::array(0, new NextAction("heroism", 31.0f), nullptr)));
triggers.push_back(new TriggerNode("bloodlust", NextAction::array(0, new NextAction("bloodlust", 30.0f), nullptr))); triggers.push_back(new TriggerNode("bloodlust", NextAction::array(0, new NextAction("bloodlust", 30.0f), nullptr)));
triggers.push_back(new TriggerNode(
"medium mana",
NextAction::array(0, new NextAction("mana tide totem", ACTION_EMERGENCY + 5), NULL)));
} }
void ShamanBuffDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void ShamanBuffDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -43,7 +43,59 @@ void HealShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr))); triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr)));
triggers.push_back(new TriggerNode("shaman weapon", NextAction::array(0, new NextAction("earthliving weapon", 22.0f), nullptr))); triggers.push_back(new TriggerNode("shaman weapon", NextAction::array(0, new NextAction("earthliving weapon", 22.0f), nullptr)));
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("mana tide totem", ACTION_EMERGENCY + 5), nullptr))); triggers.push_back(new TriggerNode(
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("healing stream totem", ACTION_LIGHT_HEAL), nullptr))); "group heal occasion",
NextAction::array(0, new NextAction("chain heal", 22.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member critical health",
NextAction::array(0, new NextAction("riptide on party", 24.0f), new NextAction("lesser healing wave on party", 23.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member low health",
NextAction::array(0, new NextAction("riptide on party", 18.0f), new NextAction("lesser healing wave on party", 17.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member medium health",
NextAction::array(0, new NextAction("riptide on party", 15.0f), new NextAction("lesser healing wave on party", 14.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member almost full health",
NextAction::array(0, new NextAction("riptide on party", 12.0f), new NextAction("lesser healing wave on party", 11.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member cleanse spirit poison",
NextAction::array(0,
new NextAction("cleanse spirit poison on party", ACTION_DISPEL + 2),
new NextAction("cleansing totem", ACTION_DISPEL + 2),
NULL)));
triggers.push_back(new TriggerNode(
"party member cleanse spirit disease",
NextAction::array(0,
new NextAction("cleanse spirit disease on party", ACTION_DISPEL + 2),
new NextAction("cleansing totem", ACTION_DISPEL + 1),
NULL)));
triggers.push_back(new TriggerNode(
"party member cleanse spirit curse",
NextAction::array(0, new NextAction("cleanse spirit curse on party", ACTION_DISPEL + 2), NULL)));
triggers.push_back(new TriggerNode(
"no fire totem",
NextAction::array(0, new NextAction("fire elemental totem", 11.0f), new NextAction("flametongue totem", 10.0f), NULL)));
triggers.push_back(new TriggerNode(
"no water totem",
NextAction::array(0, new NextAction("healing stream totem", 13.0f), NULL)));
triggers.push_back(new TriggerNode(
"earth shield on main tank",
NextAction::array(0, new NextAction("earth shield on main tank", ACTION_HIGH + 7), NULL)));
triggers.push_back(new TriggerNode(
"enemy too close for spell",
NextAction::array(0, new NextAction("flee", 49.0f), NULL)));
triggers.push_back(new TriggerNode("party member to heal out of spell range", NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 1), nullptr))); triggers.push_back(new TriggerNode("party member to heal out of spell range", NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 1), nullptr)));
} }

View File

@@ -20,7 +20,8 @@ class MeleeShamanStrategyActionNodeFactory : public NamedObjectFactory<ActionNod
{ {
return new ActionNode ("stormstrike", return new ActionNode ("stormstrike",
/*P*/ nullptr, /*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("lava lash"), nullptr), // /*A*/ NextAction::array(0, new NextAction("lava lash"), nullptr),
nullptr,
/*C*/ nullptr); /*C*/ nullptr);
} }
@@ -35,9 +36,9 @@ class MeleeShamanStrategyActionNodeFactory : public NamedObjectFactory<ActionNod
static ActionNode* magma_totem([[maybe_unused]] PlayerbotAI* botAI) static ActionNode* magma_totem([[maybe_unused]] PlayerbotAI* botAI)
{ {
return new ActionNode ("magma totem", return new ActionNode ("magma totem",
/*P*/ nullptr, /*P*/ NULL,
/*A*/ nullptr, /*A*/ NextAction::array(0, new NextAction("searing totem"), NULL),
/*C*/ NextAction::array(0, new NextAction("fire nova"), nullptr)); /*C*/ NULL);
} }
}; };
@@ -48,24 +49,37 @@ MeleeShamanStrategy::MeleeShamanStrategy(PlayerbotAI* botAI) : GenericShamanStra
NextAction** MeleeShamanStrategy::getDefaultActions() NextAction** MeleeShamanStrategy::getDefaultActions()
{ {
return NextAction::array(0, new NextAction("stormstrike", 10.0f), nullptr); return NextAction::array(0,
new NextAction("stormstrike", ACTION_NORMAL + 6),
new NextAction("earth shock", ACTION_NORMAL + 5),
new NextAction("fire nova", ACTION_NORMAL + 4),
new NextAction("lava lash", ACTION_NORMAL + 1),
new NextAction("melee", ACTION_NORMAL),
NULL);
} }
void MeleeShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void MeleeShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
GenericShamanStrategy::InitTriggers(triggers); GenericShamanStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("shaman weapon", NextAction::array(0, new NextAction("windfury weapon", 22.0f), nullptr))); triggers.push_back(new TriggerNode("shaman weapon", NextAction::array(0, new NextAction("flametongue weapon", 22.0f), nullptr)));
triggers.push_back(new TriggerNode("searing totem", NextAction::array(0, new NextAction("reach melee", 22.0f), new NextAction("searing totem", 22.0f), nullptr))); // triggers.push_back(new TriggerNode("searing totem", NextAction::array(0, new NextAction("reach melee", 22.0f), new NextAction("searing totem", 22.0f), nullptr)));
triggers.push_back(new TriggerNode("shock", NextAction::array(0, new NextAction("earth shock", 20.0f), nullptr))); triggers.push_back(new TriggerNode("flame shock", NextAction::array(0, new NextAction("flame shock", 20.0f), nullptr)));
triggers.push_back(new TriggerNode(
"maelstrom weapon",
NextAction::array(0, new NextAction("lightning bolt", 25.0f), NULL)));
triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_NORMAL + 7), nullptr))); triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_NORMAL + 7), nullptr)));
triggers.push_back(new TriggerNode("enemy too close for melee", NextAction::array(0, new NextAction("move out of enemy contact", ACTION_NORMAL + 8), nullptr))); // triggers.push_back(new TriggerNode("enemy too close for melee", NextAction::array(0, new NextAction("move out of enemy contact", ACTION_NORMAL + 8), nullptr)));
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("strength of earth totem", ACTION_LIGHT_HEAL), nullptr))); triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("strength of earth totem", ACTION_LIGHT_HEAL), nullptr)));
triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_NORMAL + 8), nullptr)));
triggers.push_back(new TriggerNode(
"no fire totem",
NextAction::array(0, new NextAction("reach melee", 23.0f), new NextAction("magma totem", 22.0f), NULL)));
} }
void MeleeAoeShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void MeleeAoeShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_NORMAL + 8), nullptr)));
triggers.push_back(new TriggerNode("magma totem", NextAction::array(0, new NextAction("magma totem", 26.0f), nullptr))); triggers.push_back(new TriggerNode("magma totem", NextAction::array(0, new NextAction("magma totem", 26.0f), nullptr)));
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("fire nova", 25.0f), nullptr))); triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("fire nova", 25.0f), nullptr)));
} }

View File

@@ -29,3 +29,8 @@ bool CastMagmaTotemAction::isUseful()
{ {
return CastMeleeSpellAction::isUseful() && !AI_VALUE2(bool, "has totem", name); return CastMeleeSpellAction::isUseful() && !AI_VALUE2(bool, "has totem", name);
} }
bool CastCleansingTotemAction::isUseful()
{
return CastTotemAction::isUseful() && !AI_VALUE2(bool, "has totem", "mana tide totem");
}

View File

@@ -158,6 +158,7 @@ class CastCleansingTotemAction : public CastTotemAction
{ {
public: public:
CastCleansingTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "cleansing totem") { } CastCleansingTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "cleansing totem") { }
virtual bool isUseful();
}; };
class CastFlametongueTotemAction : public CastTotemAction class CastFlametongueTotemAction : public CastTotemAction
@@ -368,4 +369,37 @@ class CastWindShearOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
// std::string const getName() override { return "cure disease on party"; } // std::string const getName() override { return "cure disease on party"; }
// }; // };
class CastLavaBurstAction : public CastSpellAction
{
public:
CastLavaBurstAction(PlayerbotAI* ai) : CastSpellAction(ai, "lava burst") {}
};
class CastEarthShieldOnMainTankAction : public BuffOnMainTankAction
{
public:
CastEarthShieldOnMainTankAction(PlayerbotAI* ai) : BuffOnMainTankAction(ai, "earth shield", true) {}
};
class CastTotemOfWrathAction : public CastTotemAction
{
public:
CastTotemOfWrathAction(PlayerbotAI* ai) : CastTotemAction(ai, "totem of wrath") {}
virtual std::string const GetTargetName() override { return "self target"; }
virtual bool isUseful() override { return CastTotemAction::isUseful(); }
};
class CastFireElementalTotemAction : public CastTotemAction
{
public:
CastFireElementalTotemAction(PlayerbotAI* ai) : CastTotemAction(ai, "fire elemental totem") {}
virtual std::string const GetTargetName() override { return "self target"; }
virtual bool isUseful() override { return CastTotemAction::isUseful(); }
};
class CastWrathOfAirTotemAction : public CastTotemAction
{
public:
CastWrathOfAirTotemAction(PlayerbotAI* ai) : CastTotemAction(ai, "wrath of air totem") {}
};
#endif #endif

View File

@@ -95,12 +95,17 @@ class ShamanATriggerFactoryInternal : public NamedObjectContext<Trigger>
creators["frost shock snare"] = &ShamanATriggerFactoryInternal::frost_shock_snare; creators["frost shock snare"] = &ShamanATriggerFactoryInternal::frost_shock_snare;
creators["heroism"] = &ShamanATriggerFactoryInternal::heroism; creators["heroism"] = &ShamanATriggerFactoryInternal::heroism;
creators["bloodlust"] = &ShamanATriggerFactoryInternal::bloodlust; creators["bloodlust"] = &ShamanATriggerFactoryInternal::bloodlust;
creators["maelstrom weapon"] = &ShamanATriggerFactoryInternal::maelstrom_weapon;
creators["wind shear on enemy healer"] = &ShamanATriggerFactoryInternal::wind_shear_on_enemy_healer; creators["wind shear on enemy healer"] = &ShamanATriggerFactoryInternal::wind_shear_on_enemy_healer;
creators["cure poison"] = &ShamanATriggerFactoryInternal::cure_poison; creators["cure poison"] = &ShamanATriggerFactoryInternal::cure_poison;
creators["party member cure poison"] = &ShamanATriggerFactoryInternal::party_member_cure_poison; creators["party member cure poison"] = &ShamanATriggerFactoryInternal::party_member_cure_poison;
// creators["cure disease"] = &ShamanATriggerFactoryInternal::cure_disease; creators["cure disease"] = &ShamanATriggerFactoryInternal::cure_disease;
creators["party member cure disease"] = &ShamanATriggerFactoryInternal::party_member_cure_disease; creators["party member cure disease"] = &ShamanATriggerFactoryInternal::party_member_cure_disease;
creators["no fire totem"] = &ShamanATriggerFactoryInternal::no_fire_totem;
creators["no water totem"] = &ShamanATriggerFactoryInternal::no_water_totem;
creators["earth shield on main tank"] = &ShamanATriggerFactoryInternal::earth_shield_on_main_tank;
creators["maelstrom weapon"] = &ShamanATriggerFactoryInternal::maelstrom_weapon;
creators["flame shock"] = &ShamanATriggerFactoryInternal::flame_shock;
creators["wrath of air totem"] = &ShamanATriggerFactoryInternal::wrath_of_air_totem;
} }
private: private:
@@ -136,6 +141,11 @@ class ShamanATriggerFactoryInternal : public NamedObjectContext<Trigger>
static Trigger* party_member_cure_poison(PlayerbotAI* botAI) { return new PartyMemberCurePoisonTrigger(botAI); } static Trigger* party_member_cure_poison(PlayerbotAI* botAI) { return new PartyMemberCurePoisonTrigger(botAI); }
static Trigger* cure_disease(PlayerbotAI* botAI) { return new CureDiseaseTrigger(botAI); } static Trigger* cure_disease(PlayerbotAI* botAI) { return new CureDiseaseTrigger(botAI); }
static Trigger* party_member_cure_disease(PlayerbotAI* botAI) { return new PartyMemberCureDiseaseTrigger(botAI); } static Trigger* party_member_cure_disease(PlayerbotAI* botAI) { return new PartyMemberCureDiseaseTrigger(botAI); }
static Trigger* no_fire_totem(PlayerbotAI* ai) { return new NoFireTotemTrigger(ai); }
static Trigger* no_water_totem(PlayerbotAI* ai) { return new NoWaterTotemTrigger(ai); }
static Trigger* earth_shield_on_main_tank(PlayerbotAI* ai) { return new EarthShieldOnMainTankTrigger(ai); }
static Trigger* flame_shock(PlayerbotAI* ai) { return new FlameShockTrigger(ai); }
static Trigger* wrath_of_air_totem(PlayerbotAI* ai) { return new WrathOfAirTotemTrigger(ai); }
}; };
class ShamanAiObjectContextInternal : public NamedObjectContext<Action> class ShamanAiObjectContextInternal : public NamedObjectContext<Action>
@@ -196,6 +206,12 @@ class ShamanAiObjectContextInternal : public NamedObjectContext<Action>
// creators["cure disease on party"] = &ShamanAiObjectContextInternal::cure_disease_on_party; // creators["cure disease on party"] = &ShamanAiObjectContextInternal::cure_disease_on_party;
// creators["cure poison"] = &ShamanAiObjectContextInternal::cure_poison; // creators["cure poison"] = &ShamanAiObjectContextInternal::cure_poison;
// creators["cure poison on party"] = &ShamanAiObjectContextInternal::cure_poison_on_party; // creators["cure poison on party"] = &ShamanAiObjectContextInternal::cure_poison_on_party;
creators["lava burst"] = &ShamanAiObjectContextInternal::lava_burst;
creators["earth shield on main tank"] = &ShamanAiObjectContextInternal::earth_shield_on_main_tank;
creators["fire elemental totem"] = &ShamanAiObjectContextInternal::fire_elemental_totem;
creators["totem of wrath"] = &ShamanAiObjectContextInternal::totem_of_wrath;
creators["fire elemental totem"] = &ShamanAiObjectContextInternal::fire_elemental_totem;
creators["wrath of air totem"] = &ShamanAiObjectContextInternal::wrath_of_air_totem;
} }
private: private:
@@ -252,6 +268,12 @@ class ShamanAiObjectContextInternal : public NamedObjectContext<Action>
// static Action* cure_poison_on_party(PlayerbotAI* botAI) { return new CastCurePoisonOnPartyAction(botAI); } // static Action* cure_poison_on_party(PlayerbotAI* botAI) { return new CastCurePoisonOnPartyAction(botAI); }
// static Action* cure_disease(PlayerbotAI* botAI) { return new CastCureDiseaseAction(botAI); } // static Action* cure_disease(PlayerbotAI* botAI) { return new CastCureDiseaseAction(botAI); }
// static Action* cure_disease_on_party(PlayerbotAI* botAI) { return new CastCureDiseaseOnPartyAction(botAI); } // static Action* cure_disease_on_party(PlayerbotAI* botAI) { return new CastCureDiseaseOnPartyAction(botAI); }
static Action* lava_burst(PlayerbotAI* ai) { return new CastLavaBurstAction(ai); }
static Action* earth_shield_on_main_tank(PlayerbotAI* ai) { return new CastEarthShieldOnMainTankAction(ai); }
static Action* totem_of_wrath(PlayerbotAI* ai) { return new CastTotemOfWrathAction(ai); }
static Action* fire_elemental_totem(PlayerbotAI* ai) { return new CastFireElementalTotemAction(ai); }
static Action* wrath_of_air_totem(PlayerbotAI* ai) { return new CastWrathOfAirTotemAction(ai); }
}; };
ShamanAiObjectContext::ShamanAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI) ShamanAiObjectContext::ShamanAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)

View File

@@ -14,9 +14,26 @@ void ShamanNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("water walking", NextAction::array(0, new NextAction("water walking", 12.0f), nullptr))); triggers.push_back(new TriggerNode("water walking", NextAction::array(0, new NextAction("water walking", 12.0f), nullptr)));
triggers.push_back(new TriggerNode("water breathing on party", NextAction::array(0, new NextAction("water breathing on party", 11.0f), nullptr))); triggers.push_back(new TriggerNode("water breathing on party", NextAction::array(0, new NextAction("water breathing on party", 11.0f), nullptr)));
triggers.push_back(new TriggerNode("water walking on party", NextAction::array(0, new NextAction("water walking on party", 11.0f), nullptr))); triggers.push_back(new TriggerNode("water walking on party", NextAction::array(0, new NextAction("water walking on party", 11.0f), nullptr)));
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("healing wave", 70.0f), nullptr))); triggers.push_back(new TriggerNode(
triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, new NextAction("healing wave on party", 60.0f), nullptr))); "party member critical health",
triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("chain heal", 27.0f), nullptr))); NextAction::array(0, new NextAction("healing wave on party", 27.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member low health",
NextAction::array(0, new NextAction("healing wave on party", 26.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member medium health",
NextAction::array(0, new NextAction("healing wave on party", 25.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member almost full health",
NextAction::array(0, new NextAction("healing wave on party", 24.0f), NULL)));
triggers.push_back(new TriggerNode(
"medium aoe heal",
NextAction::array(0, new NextAction("chain heal", 27.0f), NULL)));
triggers.push_back(new TriggerNode("cure poison", NextAction::array(0, new NextAction("cure poison", 21.0f), nullptr))); triggers.push_back(new TriggerNode("cure poison", NextAction::array(0, new NextAction("cure poison", 21.0f), nullptr)));
triggers.push_back(new TriggerNode("party member cure poison", NextAction::array(0, new NextAction("cure poison on party", 21.0f), nullptr))); triggers.push_back(new TriggerNode("party member cure poison", NextAction::array(0, new NextAction("cure poison on party", 21.0f), nullptr)));
triggers.push_back(new TriggerNode("cure disease", NextAction::array(0, new NextAction("cure disease", 31.0f), nullptr))); triggers.push_back(new TriggerNode("cure disease", NextAction::array(0, new NextAction("cure disease", 31.0f), nullptr)));

View File

@@ -66,3 +66,22 @@ bool WaterBreathingOnPartyTrigger::IsActive()
{ {
return BuffOnPartyTrigger::IsActive() && AI_VALUE2(bool, "swimming", "self target"); return BuffOnPartyTrigger::IsActive() && AI_VALUE2(bool, "swimming", "self target");
} }
bool NoFireTotemTrigger::IsActive()
{
return !AI_VALUE2(bool, "has totem", "magma totem") &&
!AI_VALUE2(bool, "has totem", "flametongue totem") &&
!AI_VALUE2(bool, "has totem", "searing totem") &&
!AI_VALUE2(bool, "has totem", "fire elemental totem") &&
!AI_VALUE2(bool, "has totem", "frost resistance totem") &&
!AI_VALUE2(bool, "has totem", "totem of wrath");
}
bool NoWaterTotemTrigger::IsActive()
{
return !AI_VALUE2(bool, "has totem", "fire resistance totem") &&
!AI_VALUE2(bool, "has totem", "mana tide totem") &&
!AI_VALUE2(bool, "has totem", "cleansing totem") &&
!AI_VALUE2(bool, "has totem", "mana spring totem") &&
!AI_VALUE2(bool, "has totem", "healing stream totem");
}

View File

@@ -6,6 +6,7 @@
#define _PLAYERBOT_SHAMANTRIGGERS_H #define _PLAYERBOT_SHAMANTRIGGERS_H
#include "CureTriggers.h" #include "CureTriggers.h"
#include "GenericTriggers.h"
#include "SharedDefines.h" #include "SharedDefines.h"
class PlayerbotAI; class PlayerbotAI;
@@ -194,10 +195,10 @@ class BloodlustTrigger : public BoostTrigger
BloodlustTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "bloodlust") { } BloodlustTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "bloodlust") { }
}; };
class MaelstromWeaponTrigger : public HasAuraTrigger class MaelstromWeaponTrigger : public HasAuraStackTrigger
{ {
public: public:
MaelstromWeaponTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "maelstrom weapon") { } MaelstromWeaponTrigger(PlayerbotAI* botAI) : HasAuraStackTrigger(botAI, "maelstrom weapon", 5) { }
}; };
class WindShearInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger class WindShearInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger
@@ -230,4 +231,32 @@ class PartyMemberCureDiseaseTrigger : public PartyMemberNeedCureTrigger
PartyMemberCureDiseaseTrigger(PlayerbotAI* botAI) : PartyMemberNeedCureTrigger(botAI, "cure disease", DISPEL_DISEASE) { } PartyMemberCureDiseaseTrigger(PlayerbotAI* botAI) : PartyMemberNeedCureTrigger(botAI, "cure disease", DISPEL_DISEASE) { }
}; };
class NoFireTotemTrigger : public Trigger {
public:
NoFireTotemTrigger(PlayerbotAI* ai) : Trigger(ai, "no fire totem") {}
virtual bool IsActive() override;
};
class NoWaterTotemTrigger : public Trigger {
public:
NoWaterTotemTrigger(PlayerbotAI* ai) : Trigger(ai, "no water totem") {}
virtual bool IsActive() override;
};
class EarthShieldOnMainTankTrigger : public BuffOnMainTankTrigger
{
public:
EarthShieldOnMainTankTrigger(PlayerbotAI* botAI) : BuffOnMainTankTrigger(botAI, "earth shield", true) {}
};
class FlameShockTrigger : public DebuffTrigger {
public:
FlameShockTrigger(PlayerbotAI* ai) : DebuffTrigger(ai, "flame shock", 1, true) {}
};
class WrathOfAirTotemTrigger : public TotemTrigger
{
public:
WrathOfAirTotemTrigger(PlayerbotAI* ai) : TotemTrigger(ai, "wrath of air totem") {}
};
#endif #endif

View File

@@ -13,8 +13,19 @@ void TotemsShamanStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
GenericShamanStrategy::InitTriggers(triggers); GenericShamanStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("grace of air totem", NextAction::array(0, new NextAction("grace of air totem", 16.0f), nullptr))); triggers.push_back(new TriggerNode(
triggers.push_back(new TriggerNode("mana spring totem", NextAction::array(0, new NextAction("mana spring totem", 19.0f), nullptr))); "wrath of air totem",
triggers.push_back(new TriggerNode("strength of earth totem", NextAction::array(0, new NextAction("strength of earth totem", 18.0f), nullptr))); NextAction::array(0, new NextAction("wrath of air totem", 8.0f), NULL)));
triggers.push_back(new TriggerNode("flametongue totem", NextAction::array(0, new NextAction("flametongue totem", 17.0f), nullptr)));
triggers.push_back(new TriggerNode(
"no water totem",
NextAction::array(0, new NextAction("mana spring totem", 7.0f), NULL)));
triggers.push_back(new TriggerNode(
"strength of earth totem",
NextAction::array(0, new NextAction("strength of earth totem", 6.0f), NULL)));
triggers.push_back(new TriggerNode(
"no fire totem",
NextAction::array(0, new NextAction("flametongue totem", 5.0f), NULL)));
} }

View File

@@ -91,6 +91,7 @@ class TriggerContext : public NamedObjectContext<Trigger>
creators["party member to heal out of spell range"] = &TriggerContext::party_member_to_heal_out_of_spell_range; creators["party member to heal out of spell range"] = &TriggerContext::party_member_to_heal_out_of_spell_range;
creators["combo points available"] = &TriggerContext::ComboPointsAvailable; creators["combo points available"] = &TriggerContext::ComboPointsAvailable;
creators["combo points 3 available"] = &TriggerContext::ComboPoints3Available;
creators["medium threat"] = &TriggerContext::MediumThreat; creators["medium threat"] = &TriggerContext::MediumThreat;
@@ -303,6 +304,7 @@ class TriggerContext : public NamedObjectContext<Trigger>
static Trigger* enemy_is_close(PlayerbotAI* botAI) { return new EnemyIsCloseTrigger(botAI); } static Trigger* enemy_is_close(PlayerbotAI* botAI) { return new EnemyIsCloseTrigger(botAI); }
static Trigger* party_member_to_heal_out_of_spell_range(PlayerbotAI* botAI) { return new PartyMemberToHealOutOfSpellRangeTrigger(botAI); } static Trigger* party_member_to_heal_out_of_spell_range(PlayerbotAI* botAI) { return new PartyMemberToHealOutOfSpellRangeTrigger(botAI); }
static Trigger* ComboPointsAvailable(PlayerbotAI* botAI) { return new ComboPointsAvailableTrigger(botAI); } static Trigger* ComboPointsAvailable(PlayerbotAI* botAI) { return new ComboPointsAvailableTrigger(botAI); }
static Trigger* ComboPoints3Available(PlayerbotAI* botAI) { return new ComboPointsAvailableTrigger(botAI, 3); }
static Trigger* MediumThreat(PlayerbotAI* botAI) { return new MediumThreatTrigger(botAI); } static Trigger* MediumThreat(PlayerbotAI* botAI) { return new MediumThreatTrigger(botAI); }
static Trigger* Dead(PlayerbotAI* botAI) { return new DeadTrigger(botAI); } static Trigger* Dead(PlayerbotAI* botAI) { return new DeadTrigger(botAI); }
static Trigger* corpse_near(PlayerbotAI* botAI) { return new CorpseNearTrigger(botAI); } static Trigger* corpse_near(PlayerbotAI* botAI) { return new CorpseNearTrigger(botAI); }
@@ -391,3 +393,4 @@ class TriggerContext : public NamedObjectContext<Trigger>
}; };
#endif #endif

View File

@@ -20,6 +20,10 @@ bool HasTotemValue::Calculate()
if (!creature || !creature->IsTotem()) if (!creature || !creature->IsTotem())
continue; continue;
if (creature->GetOwner() != bot) {
continue;
}
if (strstri(creature->GetName().c_str(), qualifier.c_str()) && bot->GetDistance(creature) <= botAI->GetRange("spell")) if (strstri(creature->GetName().c_str(), qualifier.c_str()) && bot->GetDistance(creature) <= botAI->GetRange("spell"))
return true; return true;
} }