Run clang-format

This commit is contained in:
Yunfan Li
2024-08-04 10:23:36 +08:00
parent 44da167492
commit 53611c9040
835 changed files with 35085 additions and 31861 deletions

View File

@@ -1,5 +1,6 @@
#include "AssassinationRogueStrategy.h"
#include "Playerbots.h"
class AssassinationRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
@@ -10,20 +11,21 @@ public:
creators["mutilate"] = &mutilate;
creators["envenom"] = &envenom;
}
private:
private:
static ActionNode* mutilate(PlayerbotAI* ai)
{
return new ActionNode ("mutilate",
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("sinister strike"), NULL),
/*C*/ NULL);
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);
return new ActionNode("envenom",
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("eviscerate"), NULL),
/*C*/ NULL);
}
};
@@ -34,70 +36,55 @@ AssassinationRogueStrategy::AssassinationRogueStrategy(PlayerbotAI* ai) : MeleeC
NextAction** AssassinationRogueStrategy::getDefaultActions()
{
return NextAction::array(0,
new NextAction("melee", ACTION_DEFAULT),
NULL);
return NextAction::array(0, new NextAction("melee", ACTION_DEFAULT), NULL);
}
void AssassinationRogueStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
void AssassinationRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
MeleeCombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode(
"high energy available",
NextAction::array(0,
new NextAction("garrote", ACTION_HIGH + 7),
new NextAction("ambush", ACTION_HIGH + 6), nullptr)));
triggers.push_back(new TriggerNode("high energy available",
NextAction::array(0, new NextAction("garrote", ACTION_HIGH + 7),
new NextAction("ambush", ACTION_HIGH + 6), nullptr)));
triggers.push_back(new TriggerNode("high energy available",
NextAction::array(0, new NextAction("mutilate", ACTION_NORMAL + 3), NULL)));
triggers.push_back(new TriggerNode(
"high energy available",
NextAction::array(0, new NextAction("mutilate", ACTION_NORMAL + 3), NULL)));
"hunger for blood", NextAction::array(0, new NextAction("hunger for blood", ACTION_HIGH + 6), 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(
"hunger for blood",
NextAction::array(0, new NextAction("hunger for blood", ACTION_HIGH + 6), NULL)));
"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(
"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)));
"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

@@ -10,7 +10,7 @@ public:
AssassinationRogueStrategy(PlayerbotAI* ai);
public:
virtual void InitTriggers(std::vector<TriggerNode*> &triggers) override;
virtual void InitTriggers(std::vector<TriggerNode*>& triggers) override;
virtual std::string const getName() override { return "melee"; }
virtual NextAction** getDefaultActions() override;
uint32 GetType() const override { return MeleeCombatStrategy::GetType() | STRATEGY_TYPE_DPS; }

View File

@@ -1,75 +1,76 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "DpsRogueStrategy.h"
#include "Playerbots.h"
class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
DpsRogueStrategyActionNodeFactory()
{
creators["mutilate"] = &mutilate;
creators["sinister strike"] = &sinister_strike;
creators["kick"] = &kick;
creators["kidney shot"] = &kidney_shot;
creators["backstab"] = &backstab;
creators["melee"] = &melee;
creators["rupture"] = &rupture;
}
public:
DpsRogueStrategyActionNodeFactory()
{
creators["mutilate"] = &mutilate;
creators["sinister strike"] = &sinister_strike;
creators["kick"] = &kick;
creators["kidney shot"] = &kidney_shot;
creators["backstab"] = &backstab;
creators["melee"] = &melee;
creators["rupture"] = &rupture;
}
private:
static ActionNode* melee(PlayerbotAI* botAI)
{
return new ActionNode ("melee",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr),
/*C*/ nullptr);
}
static ActionNode* mutilate(PlayerbotAI* botAI)
{
return new ActionNode ("mutilate",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("sinister strike"), nullptr),
/*C*/ nullptr);
}
static ActionNode* sinister_strike(PlayerbotAI* botAI)
{
return new ActionNode ("sinister strike",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("melee"), nullptr),
/*C*/ nullptr);
}
static ActionNode* kick(PlayerbotAI* botAI)
{
return new ActionNode ("kick",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("kidney shot"), nullptr),
/*C*/ nullptr);
}
static ActionNode* kidney_shot(PlayerbotAI* botAI)
{
return new ActionNode ("kidney shot",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* backstab(PlayerbotAI* botAI)
{
return new ActionNode ("backstab",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr),
/*C*/ nullptr);
}
static ActionNode* rupture(PlayerbotAI* botAI)
{
return new ActionNode ("rupture",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("eviscerate"), nullptr),
/*C*/ nullptr);
}
private:
static ActionNode* melee(PlayerbotAI* botAI)
{
return new ActionNode("melee",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr),
/*C*/ nullptr);
}
static ActionNode* mutilate(PlayerbotAI* botAI)
{
return new ActionNode("mutilate",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("sinister strike"), nullptr),
/*C*/ nullptr);
}
static ActionNode* sinister_strike(PlayerbotAI* botAI)
{
return new ActionNode("sinister strike",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("melee"), nullptr),
/*C*/ nullptr);
}
static ActionNode* kick(PlayerbotAI* botAI)
{
return new ActionNode("kick",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("kidney shot"), nullptr),
/*C*/ nullptr);
}
static ActionNode* kidney_shot(PlayerbotAI* botAI)
{
return new ActionNode("kidney shot",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* backstab(PlayerbotAI* botAI)
{
return new ActionNode("backstab",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr),
/*C*/ nullptr);
}
static ActionNode* rupture(PlayerbotAI* botAI)
{
return new ActionNode("rupture",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("eviscerate"), nullptr),
/*C*/ nullptr);
}
};
DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(botAI)
@@ -79,132 +80,116 @@ DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(bot
NextAction** DpsRogueStrategy::getDefaultActions()
{
return NextAction::array(0,
new NextAction("killing spree", ACTION_DEFAULT + 0.1f),
new NextAction("melee", ACTION_DEFAULT), nullptr);
return NextAction::array(0, new NextAction("killing spree", ACTION_DEFAULT + 0.1f),
new NextAction("melee", ACTION_DEFAULT), nullptr);
}
void DpsRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
MeleeCombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode(
"high energy available",
NextAction::array(0,
new NextAction("garrote", ACTION_HIGH + 7),
new NextAction("ambush", ACTION_HIGH + 6), nullptr)));
triggers.push_back(new TriggerNode("high energy available",
NextAction::array(0, new NextAction("garrote", ACTION_HIGH + 7),
new NextAction("ambush", ACTION_HIGH + 6), nullptr)));
triggers.push_back(new TriggerNode(
"high energy available",
NextAction::array(0, new NextAction("sinister strike", ACTION_NORMAL + 3), nullptr)));
"high energy available", NextAction::array(0, new NextAction("sinister strike", ACTION_NORMAL + 3), nullptr)));
triggers.push_back(new TriggerNode(
"slice and dice",
NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 2), nullptr)));
"slice and dice", NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 2), nullptr)));
triggers.push_back(new TriggerNode(
"combo points available",
NextAction::array(0,
new NextAction("rupture", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("combo points available",
NextAction::array(0, new NextAction("rupture", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode(
"target with combo points almost dead",
NextAction::array(0,
new NextAction("eviscerate", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("target with combo points almost dead",
NextAction::array(0, new NextAction("eviscerate", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode(
"medium threat",
NextAction::array(0, new NextAction("vanish", ACTION_HIGH), nullptr)));
triggers.push_back(
new TriggerNode("medium threat", NextAction::array(0, new NextAction("vanish", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode(
"low health",
NextAction::array(0, new NextAction("evasion", ACTION_EMERGENCY), new NextAction("feint", ACTION_EMERGENCY), nullptr)));
triggers.push_back(
new TriggerNode("low health", NextAction::array(0, new NextAction("evasion", ACTION_EMERGENCY),
new NextAction("feint", ACTION_EMERGENCY), nullptr)));
triggers.push_back(new TriggerNode(
"kick",
NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), nullptr)));
triggers.push_back(
new TriggerNode("kick", NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), nullptr)));
triggers.push_back(new TriggerNode(
"kick on enemy healer",
NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), nullptr)));
triggers.push_back(
new TriggerNode("kick on enemy healer",
NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), nullptr)));
// triggers.push_back(new TriggerNode(
// "behind target",
// NextAction::array(0, new NextAction("backstab", ACTION_NORMAL), nullptr)));
triggers.push_back(new TriggerNode(
"light aoe",
NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH + 3), nullptr)));
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),
nullptr)));
triggers.push_back(
new TriggerNode("light aoe", NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH + 3), nullptr)));
triggers.push_back(new TriggerNode(
"expose armor",
NextAction::array(0, new NextAction("expose armor", ACTION_HIGH + 3), nullptr)));
"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), nullptr)));
triggers.push_back(new TriggerNode("expose armor",
NextAction::array(0, new NextAction("expose armor", ACTION_HIGH + 3), nullptr)));
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), nullptr)));
"tricks of the trade on main tank",
NextAction::array(0, new NextAction("tricks of the trade on main tank", ACTION_HIGH + 7), nullptr)));
}
class StealthedRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
StealthedRogueStrategyActionNodeFactory()
{
creators["ambush"] = &ambush;
creators["cheap shot"] = &cheap_shot;
creators["garrote"] = &garrote;
creators["sap"] = &sap;
creators["sinister strike"] = &sinister_strike;
}
public:
StealthedRogueStrategyActionNodeFactory()
{
creators["ambush"] = &ambush;
creators["cheap shot"] = &cheap_shot;
creators["garrote"] = &garrote;
creators["sap"] = &sap;
creators["sinister strike"] = &sinister_strike;
}
private:
static ActionNode* ambush(PlayerbotAI* botAI)
{
return new ActionNode("ambush",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("garrote"), nullptr),
/*C*/ nullptr);
}
private:
static ActionNode* ambush(PlayerbotAI* botAI)
{
return new ActionNode("ambush",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("garrote"), nullptr),
/*C*/ nullptr);
}
static ActionNode* cheap_shot(PlayerbotAI* botAI)
{
return new ActionNode("cheap shot",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* cheap_shot(PlayerbotAI* botAI)
{
return new ActionNode("cheap shot",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* garrote(PlayerbotAI* botAI)
{
return new ActionNode("garrote",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* garrote(PlayerbotAI* botAI)
{
return new ActionNode("garrote",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* sap(PlayerbotAI* botAI)
{
return new ActionNode("sap",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* sap(PlayerbotAI* botAI)
{
return new ActionNode("sap",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* sinister_strike(PlayerbotAI* botAI)
{
return new ActionNode("sinister strike",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("cheap shot"), nullptr),
/*C*/ nullptr);
}
static ActionNode* sinister_strike(PlayerbotAI* botAI)
{
return new ActionNode("sinister strike",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("cheap shot"), nullptr),
/*C*/ nullptr);
}
};
StealthedRogueStrategy::StealthedRogueStrategy(PlayerbotAI* botAI) : Strategy(botAI)
@@ -214,44 +199,58 @@ StealthedRogueStrategy::StealthedRogueStrategy(PlayerbotAI* botAI) : Strategy(bo
NextAction** StealthedRogueStrategy::getDefaultActions()
{
return NextAction::array(0, new NextAction("ambush", ACTION_NORMAL + 4), new NextAction("backstab", ACTION_NORMAL + 3), new NextAction("cheap shot", ACTION_NORMAL + 2),
new NextAction("sinister strike", ACTION_NORMAL + 1), new NextAction("melee", ACTION_NORMAL), nullptr);
return NextAction::array(
0, new NextAction("ambush", ACTION_NORMAL + 4), new NextAction("backstab", ACTION_NORMAL + 3),
new NextAction("cheap shot", ACTION_NORMAL + 2), new NextAction("sinister strike", ACTION_NORMAL + 1),
new NextAction("melee", ACTION_NORMAL), nullptr);
}
void StealthedRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("combo points available", NextAction::array(0, new NextAction("eviscerate", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode("kick", NextAction::array(0, new NextAction("cheap shot", ACTION_INTERRUPT), nullptr)));
triggers.push_back(new TriggerNode("kick on enemy healer", NextAction::array(0, new NextAction("cheap shot", ACTION_INTERRUPT), nullptr)));
triggers.push_back(new TriggerNode("behind target", NextAction::array(0, new NextAction("ambush", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode("not behind target", NextAction::array(0, new NextAction("cheap shot", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 1), nullptr)));
triggers.push_back(new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", ACTION_NORMAL), nullptr)));
/*triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", ACTION_EMERGENCY + 1), nullptr)));*/
triggers.push_back(new TriggerNode("no stealth", NextAction::array(0, new NextAction("check stealth", ACTION_EMERGENCY), nullptr)));
triggers.push_back(new TriggerNode("sprint", NextAction::array(0, new NextAction("sprint", ACTION_INTERRUPT), nullptr)));
triggers.push_back(new TriggerNode("combo points available",
NextAction::array(0, new NextAction("eviscerate", ACTION_HIGH), nullptr)));
triggers.push_back(
new TriggerNode("kick", NextAction::array(0, new NextAction("cheap shot", ACTION_INTERRUPT), nullptr)));
triggers.push_back(new TriggerNode("kick on enemy healer",
NextAction::array(0, new NextAction("cheap shot", ACTION_INTERRUPT), nullptr)));
triggers.push_back(
new TriggerNode("behind target", NextAction::array(0, new NextAction("ambush", ACTION_HIGH), nullptr)));
triggers.push_back(
new TriggerNode("not behind target", NextAction::array(0, new NextAction("cheap shot", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode("enemy flagcarrier near",
NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 1), nullptr)));
triggers.push_back(
new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", ACTION_NORMAL), nullptr)));
/*triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", ACTION_EMERGENCY +
* 1), nullptr)));*/
triggers.push_back(new TriggerNode(
"no stealth", NextAction::array(0, new NextAction("check stealth", ACTION_EMERGENCY), nullptr)));
triggers.push_back(
new TriggerNode("sprint", NextAction::array(0, new NextAction("sprint", ACTION_INTERRUPT), nullptr)));
}
void StealthStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("stealth", NextAction::array(0, new NextAction("stealth", ACTION_INTERRUPT), nullptr)));
triggers.push_back(
new TriggerNode("stealth", NextAction::array(0, new NextAction("stealth", ACTION_INTERRUPT), nullptr)));
}
void RogueAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH), nullptr)));
triggers.push_back(
new TriggerNode("light aoe", NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode(
"medium aoe",
NextAction::array(0, new NextAction("fan of knives", ACTION_NORMAL + 5), nullptr)));
"medium aoe", NextAction::array(0, new NextAction("fan of knives", ACTION_NORMAL + 5), nullptr)));
}
void RogueBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("adrenaline rush", NextAction::array(0, new NextAction("adrenaline rush", ACTION_HIGH + 2), nullptr)));
triggers.push_back(new TriggerNode(
"adrenaline rush", NextAction::array(0, new NextAction("adrenaline rush", ACTION_HIGH + 2), nullptr)));
}
void RogueCcStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("sap", NextAction::array(0, new NextAction("stealth", ACTION_INTERRUPT), new NextAction("sap", ACTION_INTERRUPT), nullptr)));
triggers.push_back(new TriggerNode("sap", NextAction::array(0, new NextAction("stealth", ACTION_INTERRUPT),
new NextAction("sap", ACTION_INTERRUPT), nullptr)));
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_DPSROGUESTRATEGY_H
@@ -12,60 +13,60 @@ class PlayerbotAI;
class DpsRogueStrategy : public MeleeCombatStrategy
{
public:
DpsRogueStrategy(PlayerbotAI* botAI);
public:
DpsRogueStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "dps"; }
NextAction** getDefaultActions() override;
uint32 GetType() const override { return MeleeCombatStrategy::GetType() | STRATEGY_TYPE_DPS; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "dps"; }
NextAction** getDefaultActions() override;
uint32 GetType() const override { return MeleeCombatStrategy::GetType() | STRATEGY_TYPE_DPS; }
};
class StealthedRogueStrategy : public Strategy
{
public:
StealthedRogueStrategy(PlayerbotAI* botAI);
public:
StealthedRogueStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "stealthed"; }
NextAction** getDefaultActions() override;
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "stealthed"; }
NextAction** getDefaultActions() override;
};
class StealthStrategy : public Strategy
{
public:
StealthStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
public:
StealthStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
//virtual int GetType() { return STRATEGY_TYPE_NONCOMBAT; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "stealth"; }
// virtual int GetType() { return STRATEGY_TYPE_NONCOMBAT; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "stealth"; }
};
class RogueAoeStrategy : public Strategy
{
public:
RogueAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
public:
RogueAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "aoe"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "aoe"; }
};
class RogueBoostStrategy : public Strategy
{
public:
RogueBoostStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
public:
RogueBoostStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "boost"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "boost"; }
};
class RogueCcStrategy : public Strategy
{
public:
RogueCcStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
public:
RogueCcStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "cc"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "cc"; }
};
#endif

View File

@@ -1,55 +1,58 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "GenericRogueNonCombatStrategy.h"
#include "Playerbots.h"
#include "Playerbots.h"
class GenericRogueNonCombatStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
GenericRogueNonCombatStrategyActionNodeFactory()
{
creators["use deadly poison on off hand"] = &use_deadly_poison_on_off_hand;
}
public:
GenericRogueNonCombatStrategyActionNodeFactory()
{
creators["use deadly poison on off hand"] = &use_deadly_poison_on_off_hand;
}
private:
static ActionNode* use_deadly_poison_on_off_hand(PlayerbotAI* botAI)
{
return new ActionNode ("use deadly poison on off hand",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("use instant poison on off hand"), nullptr),
/*C*/ nullptr);
}
private:
static ActionNode* use_deadly_poison_on_off_hand(PlayerbotAI* botAI)
{
return new ActionNode("use deadly poison on off hand",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("use instant poison on off hand"), nullptr),
/*C*/ nullptr);
}
};
GenericRogueNonCombatStrategy::GenericRogueNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {
actionNodeFactories.Add(new GenericRogueNonCombatStrategyActionNodeFactory());
GenericRogueNonCombatStrategy::GenericRogueNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
{
actionNodeFactories.Add(new GenericRogueNonCombatStrategyActionNodeFactory());
}
void GenericRogueNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
NonCombatStrategy::InitTriggers(triggers);
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("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("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("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(
"main hand weapon no enchant",
NextAction::array(0, new NextAction("use instant poison on main hand", 20.0f), NULL)));
triggers.push_back(new TriggerNode(
"off hand weapon no enchant",
NextAction::array(0, new NextAction("use deadly poison on off hand", 19.0f), NULL)));
triggers.push_back(
new TriggerNode("main hand weapon no enchant",
NextAction::array(0, new NextAction("use instant poison on main hand", 20.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("off hand weapon no enchant",
NextAction::array(0, new NextAction("use deadly poison on off hand", 19.0f), NULL)));
triggers.push_back(new TriggerNode(
"often",
NextAction::array(0, new NextAction("unstealth", 30.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", 30.0f), NULL)));
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_GENERICROGUENONCOMBATSTRATEGY_H
@@ -11,11 +12,11 @@ class PlayerbotAI;
class GenericRogueNonCombatStrategy : public NonCombatStrategy
{
public:
GenericRogueNonCombatStrategy(PlayerbotAI* botAI);
public:
GenericRogueNonCombatStrategy(PlayerbotAI* botAI);
std::string const getName() override { return "nc"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "nc"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
};
#endif

View File

@@ -1,8 +1,10 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "RogueActions.h"
#include "Event.h"
#include "ObjectGuid.h"
#include "Player.h"
@@ -42,101 +44,123 @@ bool CastVanishAction::isUseful()
return !botAI->HasAura(23333, bot) && !botAI->HasAura(23335, bot) && !botAI->HasAura(34976, bot);
}
bool CastTricksOfTheTradeOnMainTankAction::isUseful() {
bool CastTricksOfTheTradeOnMainTankAction::isUseful()
{
return CastSpellAction::isUseful() && AI_VALUE2(float, "distance", GetTargetName()) < 20.0f;
}
bool UseDeadlyPoisonAction::Execute(Event event) {
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) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Deadly Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
if (items.empty()) {
if (items.empty())
{
return false;
}
Item* const itemForSpell = bot->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
return UseItem(*items.begin(), ObjectGuid::Empty, itemForSpell);
// return UseItemAuto(*items.begin());
}
bool UseDeadlyPoisonAction::isPossible() {
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) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Deadly Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
return !items.empty();
}
bool UseInstantPoisonAction::Execute(Event event) {
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) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Instant Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
if (items.empty()) {
if (items.empty())
{
return false;
}
Item* const itemForSpell = bot->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND );
Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
return UseItem(*items.begin(), ObjectGuid::Empty, itemForSpell);
}
bool UseInstantPoisonAction::isPossible() {
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) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Instant Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
return !items.empty();
}
bool UseInstantPoisonOffHandAction::Execute(Event event) {
bool UseInstantPoisonOffHandAction::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) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Instant Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}
if (items.empty()) {
if (items.empty())
{
return false;
}
Item* const itemForSpell = bot->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
Item* const itemForSpell = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
return UseItem(*items.begin(), ObjectGuid::Empty, itemForSpell);
}
bool UseInstantPoisonOffHandAction::isPossible() {
bool UseInstantPoisonOffHandAction::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) {
for (std::string& suffix : poison_suffixs)
{
poison_name = "Instant Poison" + suffix;
items = AI_VALUE2(std::vector<Item*>, "inventory items", poison_name);
if (!items.empty()) {
if (!items.empty())
{
break;
}
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_ROGUEACTIONS_H
@@ -12,156 +13,156 @@ class PlayerbotAI;
class CastEvasionAction : public CastBuffSpellAction
{
public:
CastEvasionAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "evasion") { }
public:
CastEvasionAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "evasion") {}
};
class CastHungerForBloodAction : public CastBuffSpellAction
{
public:
CastHungerForBloodAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "hunger for blood") { }
std::string const GetTargetName() override { return "current target"; }
public:
CastHungerForBloodAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "hunger for blood") {}
std::string const GetTargetName() override { return "current target"; }
};
class CastSprintAction : public CastBuffSpellAction
{
public:
CastSprintAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "sprint") { }
public:
CastSprintAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "sprint") {}
std::string const GetTargetName() override { return "self target"; }
std::string const GetTargetName() override { return "self target"; }
};
class CastStealthAction : public CastBuffSpellAction
{
public:
CastStealthAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "stealth") { }
public:
CastStealthAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "stealth") {}
std::string const GetTargetName() override { return "self target"; }
std::string const GetTargetName() override { return "self target"; }
bool isPossible() override;
bool isPossible() override;
};
class UnstealthAction : public Action
{
public:
UnstealthAction(PlayerbotAI* botAI) : Action(botAI, "unstealth") { }
public:
UnstealthAction(PlayerbotAI* botAI) : Action(botAI, "unstealth") {}
bool Execute(Event event) override;
bool Execute(Event event) override;
};
class CheckStealthAction : public Action
{
public:
CheckStealthAction(PlayerbotAI* botAI) : Action(botAI, "check stealth") { }
public:
CheckStealthAction(PlayerbotAI* botAI) : Action(botAI, "check stealth") {}
bool isPossible() override { return true; }
bool Execute(Event event) override;
bool isPossible() override { return true; }
bool Execute(Event event) override;
};
class CastKickAction : public CastSpellAction
{
public:
CastKickAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "kick") { }
public:
CastKickAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "kick") {}
};
class CastFeintAction : public CastBuffSpellAction
{
public:
CastFeintAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "feint") { }
public:
CastFeintAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "feint") {}
};
class CastDismantleAction : public CastSpellAction
{
public:
CastDismantleAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "dismantle") { }
public:
CastDismantleAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "dismantle") {}
};
class CastDistractAction : public CastSpellAction
{
public:
CastDistractAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "distract") { }
public:
CastDistractAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "distract") {}
};
class CastVanishAction : public CastBuffSpellAction
{
public:
CastVanishAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "vanish") { }
public:
CastVanishAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "vanish") {}
bool isUseful() override;
bool isUseful() override;
};
class CastBlindAction : public CastDebuffSpellAction
{
public:
CastBlindAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "blind") { }
public:
CastBlindAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "blind") {}
};
class CastBladeFlurryAction : public CastBuffSpellAction
{
public:
CastBladeFlurryAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blade flurry") { }
public:
CastBladeFlurryAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blade flurry") {}
};
class CastAdrenalineRushAction : public CastBuffSpellAction
{
public:
CastAdrenalineRushAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "adrenaline rush") { }
public:
CastAdrenalineRushAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "adrenaline rush") {}
};
class CastKillingSpreeAction : public CastMeleeSpellAction
{
public:
CastKillingSpreeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "killing spree") { }
public:
CastKillingSpreeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "killing spree") {}
};
class CastKickOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
{
public:
CastKickOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "kick") { }
public:
CastKickOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "kick") {}
};
class EnvenomAction : public CastMeleeSpellAction
{
public:
EnvenomAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "envenom") {}
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;
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;
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;
public:
UseInstantPoisonAction(PlayerbotAI* ai) : UseItemAction(ai, "Instant Poison") {}
virtual bool Execute(Event event) override;
virtual bool isPossible() override;
};
class UseInstantPoisonOffHandAction : public UseItemAction
{
public:
UseInstantPoisonOffHandAction(PlayerbotAI* ai) : UseItemAction(ai, "Instant Poison Off Hand") {}
virtual bool Execute(Event event) override;
virtual bool isPossible() override;
public:
UseInstantPoisonOffHandAction(PlayerbotAI* ai) : UseItemAction(ai, "Instant Poison Off Hand") {}
virtual bool Execute(Event event) override;
virtual bool isPossible() override;
};
class FanOfKnivesAction : public CastMeleeSpellAction
{
public:
FanOfKnivesAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "fan of knives") {}
ActionThreatType getThreatType() override { return ActionThreatType::Aoe; }
public:
FanOfKnivesAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "fan of knives") {}
ActionThreatType getThreatType() override { return ActionThreatType::Aoe; }
};
#endif

View File

@@ -1,178 +1,190 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "RogueAiObjectContext.h"
#include "AssassinationRogueStrategy.h"
#include "DpsRogueStrategy.h"
#include "GenericRogueNonCombatStrategy.h"
#include "NamedObjectContext.h"
#include "Playerbots.h"
#include "PullStrategy.h"
#include "RogueActions.h"
#include "RogueComboActions.h"
#include "RogueFinishingActions.h"
#include "RogueOpeningActions.h"
#include "RogueTriggers.h"
#include "NamedObjectContext.h"
#include "PullStrategy.h"
#include "Playerbots.h"
#include "AssassinationRogueStrategy.h"
class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy>
{
public:
RogueStrategyFactoryInternal()
{
creators["nc"] = &RogueStrategyFactoryInternal::nc;
creators["pull"] = &RogueStrategyFactoryInternal::pull;
creators["aoe"] = &RogueStrategyFactoryInternal::aoe;
creators["boost"] = &RogueStrategyFactoryInternal::boost;
creators["stealthed"] = &RogueStrategyFactoryInternal::stealthed;
creators["stealth"] = &RogueStrategyFactoryInternal::stealth;
creators["cc"] = &RogueStrategyFactoryInternal::cc;
}
public:
RogueStrategyFactoryInternal()
{
creators["nc"] = &RogueStrategyFactoryInternal::nc;
creators["pull"] = &RogueStrategyFactoryInternal::pull;
creators["aoe"] = &RogueStrategyFactoryInternal::aoe;
creators["boost"] = &RogueStrategyFactoryInternal::boost;
creators["stealthed"] = &RogueStrategyFactoryInternal::stealthed;
creators["stealth"] = &RogueStrategyFactoryInternal::stealth;
creators["cc"] = &RogueStrategyFactoryInternal::cc;
}
private:
static Strategy* boost(PlayerbotAI* botAI) { return new RogueBoostStrategy(botAI); }
static Strategy* aoe(PlayerbotAI* botAI) { return new RogueAoeStrategy(botAI); }
static Strategy* nc(PlayerbotAI* botAI) { return new GenericRogueNonCombatStrategy(botAI); }
static Strategy* pull(PlayerbotAI* botAI) { return new PullStrategy(botAI, "shoot"); }
static Strategy* stealthed(PlayerbotAI* botAI) { return new StealthedRogueStrategy(botAI); }
static Strategy* stealth(PlayerbotAI* botAI) { return new StealthStrategy(botAI); }
static Strategy* cc(PlayerbotAI* botAI) { return new RogueCcStrategy(botAI); }
private:
static Strategy* boost(PlayerbotAI* botAI) { return new RogueBoostStrategy(botAI); }
static Strategy* aoe(PlayerbotAI* botAI) { return new RogueAoeStrategy(botAI); }
static Strategy* nc(PlayerbotAI* botAI) { return new GenericRogueNonCombatStrategy(botAI); }
static Strategy* pull(PlayerbotAI* botAI) { return new PullStrategy(botAI, "shoot"); }
static Strategy* stealthed(PlayerbotAI* botAI) { return new StealthedRogueStrategy(botAI); }
static Strategy* stealth(PlayerbotAI* botAI) { return new StealthStrategy(botAI); }
static Strategy* cc(PlayerbotAI* botAI) { return new RogueCcStrategy(botAI); }
};
class RogueCombatStrategyFactoryInternal : public NamedObjectContext<Strategy>
{
public:
RogueCombatStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
{
creators["dps"] = &RogueCombatStrategyFactoryInternal::dps;
creators["melee"] = &RogueCombatStrategyFactoryInternal::melee;
}
public:
RogueCombatStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
{
creators["dps"] = &RogueCombatStrategyFactoryInternal::dps;
creators["melee"] = &RogueCombatStrategyFactoryInternal::melee;
}
private:
static Strategy* dps(PlayerbotAI* botAI) { return new DpsRogueStrategy(botAI); }
static Strategy* melee(PlayerbotAI* botAI) { return new AssassinationRogueStrategy(botAI); }
private:
static Strategy* dps(PlayerbotAI* botAI) { return new DpsRogueStrategy(botAI); }
static Strategy* melee(PlayerbotAI* botAI) { return new AssassinationRogueStrategy(botAI); }
};
class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
{
public:
RogueTriggerFactoryInternal()
{
creators["kick"] = &RogueTriggerFactoryInternal::kick;
creators["rupture"] = &RogueTriggerFactoryInternal::rupture;
creators["slice and dice"] = &RogueTriggerFactoryInternal::slice_and_dice;
creators["hunger for blood"] = &RogueTriggerFactoryInternal::hunger_for_blood;
creators["expose armor"] = &RogueTriggerFactoryInternal::expose_armor;
creators["kick on enemy healer"] = &RogueTriggerFactoryInternal::kick_on_enemy_healer;
creators["unstealth"] = &RogueTriggerFactoryInternal::unstealth;
creators["sap"] = &RogueTriggerFactoryInternal::sap;
creators["in stealth"] = &RogueTriggerFactoryInternal::in_stealth;
creators["no stealth"] = &RogueTriggerFactoryInternal::no_stealth;
creators["stealth"] = &RogueTriggerFactoryInternal::stealth;
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;
creators["adrenaline rush"] = &RogueTriggerFactoryInternal::adrenaline_rush;
creators["target with combo points almost dead"] =&RogueTriggerFactoryInternal::target_with_combo_points_almost_dead;
}
public:
RogueTriggerFactoryInternal()
{
creators["kick"] = &RogueTriggerFactoryInternal::kick;
creators["rupture"] = &RogueTriggerFactoryInternal::rupture;
creators["slice and dice"] = &RogueTriggerFactoryInternal::slice_and_dice;
creators["hunger for blood"] = &RogueTriggerFactoryInternal::hunger_for_blood;
creators["expose armor"] = &RogueTriggerFactoryInternal::expose_armor;
creators["kick on enemy healer"] = &RogueTriggerFactoryInternal::kick_on_enemy_healer;
creators["unstealth"] = &RogueTriggerFactoryInternal::unstealth;
creators["sap"] = &RogueTriggerFactoryInternal::sap;
creators["in stealth"] = &RogueTriggerFactoryInternal::in_stealth;
creators["no stealth"] = &RogueTriggerFactoryInternal::no_stealth;
creators["stealth"] = &RogueTriggerFactoryInternal::stealth;
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;
creators["adrenaline rush"] = &RogueTriggerFactoryInternal::adrenaline_rush;
creators["target with combo points almost dead"] =
&RogueTriggerFactoryInternal::target_with_combo_points_almost_dead;
}
private:
static Trigger* adrenaline_rush(PlayerbotAI* botAI) { return new AdrenalineRushTrigger(botAI); }
static Trigger* kick(PlayerbotAI* botAI) { return new KickInterruptSpellTrigger(botAI); }
static Trigger* rupture(PlayerbotAI* botAI) { return new RuptureTrigger(botAI); }
static Trigger* slice_and_dice(PlayerbotAI* botAI) { return new SliceAndDiceTrigger(botAI); }
static Trigger* hunger_for_blood(PlayerbotAI* botAI) { return new HungerForBloodTrigger(botAI); }
static Trigger* expose_armor(PlayerbotAI* botAI) { return new ExposeArmorTrigger(botAI); }
static Trigger* kick_on_enemy_healer(PlayerbotAI* botAI) { return new KickInterruptEnemyHealerSpellTrigger(botAI); }
static Trigger* unstealth(PlayerbotAI* botAI) { return new UnstealthTrigger(botAI); }
static Trigger* sap(PlayerbotAI* botAI) { return new SapTrigger(botAI); }
static Trigger* in_stealth(PlayerbotAI* botAI) { return new InStealthTrigger(botAI); }
static Trigger* no_stealth(PlayerbotAI* botAI) { return new NoStealthTrigger(botAI); }
static Trigger* stealth(PlayerbotAI* botAI) { return new StealthTrigger(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); }
static Trigger* target_with_combo_points_almost_dead(PlayerbotAI* ai) { return new TargetWithComboPointsLowerHealTrigger(ai, 3, 3.0f); }
private:
static Trigger* adrenaline_rush(PlayerbotAI* botAI) { return new AdrenalineRushTrigger(botAI); }
static Trigger* kick(PlayerbotAI* botAI) { return new KickInterruptSpellTrigger(botAI); }
static Trigger* rupture(PlayerbotAI* botAI) { return new RuptureTrigger(botAI); }
static Trigger* slice_and_dice(PlayerbotAI* botAI) { return new SliceAndDiceTrigger(botAI); }
static Trigger* hunger_for_blood(PlayerbotAI* botAI) { return new HungerForBloodTrigger(botAI); }
static Trigger* expose_armor(PlayerbotAI* botAI) { return new ExposeArmorTrigger(botAI); }
static Trigger* kick_on_enemy_healer(PlayerbotAI* botAI) { return new KickInterruptEnemyHealerSpellTrigger(botAI); }
static Trigger* unstealth(PlayerbotAI* botAI) { return new UnstealthTrigger(botAI); }
static Trigger* sap(PlayerbotAI* botAI) { return new SapTrigger(botAI); }
static Trigger* in_stealth(PlayerbotAI* botAI) { return new InStealthTrigger(botAI); }
static Trigger* no_stealth(PlayerbotAI* botAI) { return new NoStealthTrigger(botAI); }
static Trigger* stealth(PlayerbotAI* botAI) { return new StealthTrigger(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);
}
static Trigger* target_with_combo_points_almost_dead(PlayerbotAI* ai)
{
return new TargetWithComboPointsLowerHealTrigger(ai, 3, 3.0f);
}
};
class RogueAiObjectContextInternal : public NamedObjectContext<Action>
{
public:
RogueAiObjectContextInternal()
{
creators["riposte"] = &RogueAiObjectContextInternal::riposte;
creators["mutilate"] = &RogueAiObjectContextInternal::mutilate;
creators["sinister strike"] = &RogueAiObjectContextInternal::sinister_strike;
creators["gouge"] = &RogueAiObjectContextInternal::gouge;
creators["kidney shot"] = &RogueAiObjectContextInternal::kidney_shot;
creators["rupture"] = &RogueAiObjectContextInternal::rupture;
creators["slice and dice"] = &RogueAiObjectContextInternal::slice_and_dice;
creators["hunger for blood"] = &RogueAiObjectContextInternal::hunger_for_blood;
creators["eviscerate"] = &RogueAiObjectContextInternal::eviscerate;
creators["vanish"] = &RogueAiObjectContextInternal::vanish;
creators["evasion"] = &RogueAiObjectContextInternal::evasion;
creators["kick"] = &RogueAiObjectContextInternal::kick;
creators["feint"] = &RogueAiObjectContextInternal::feint;
creators["backstab"] = &RogueAiObjectContextInternal::backstab;
creators["expose armor"] = &RogueAiObjectContextInternal::expose_armor;
creators["kick on enemy healer"] = &RogueAiObjectContextInternal::kick_on_enemy_healer;
creators["blade flurry"] = &RogueAiObjectContextInternal::blade_flurry;
creators["adrenaline rush"] = &RogueAiObjectContextInternal::adrenaline_rush;
creators["ambush"] = &RogueAiObjectContextInternal::ambush;
creators["stealth"] = &RogueAiObjectContextInternal::stealth;
creators["sprint"] = &RogueAiObjectContextInternal::sprint;
creators["garrote"] = &RogueAiObjectContextInternal::garrote;
creators["cheap shot"] = &RogueAiObjectContextInternal::cheap_shot;
creators["blind"] = &RogueAiObjectContextInternal::blind;
creators["unstealth"] = &RogueAiObjectContextInternal::unstealth;
creators["sap"] = &RogueAiObjectContextInternal::sap;
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 on main hand"] = &RogueAiObjectContextInternal::use_instant_poison;
creators["use deadly poison on off hand"] = &RogueAiObjectContextInternal::use_deadly_poison;
creators["use instant poison on off hand"] = &RogueAiObjectContextInternal::use_instant_poison_off_hand;
creators["fan of knives"] = &RogueAiObjectContextInternal::fan_of_knives;
creators["killing spree"] = &RogueAiObjectContextInternal::killing_spree;
}
public:
RogueAiObjectContextInternal()
{
creators["riposte"] = &RogueAiObjectContextInternal::riposte;
creators["mutilate"] = &RogueAiObjectContextInternal::mutilate;
creators["sinister strike"] = &RogueAiObjectContextInternal::sinister_strike;
creators["gouge"] = &RogueAiObjectContextInternal::gouge;
creators["kidney shot"] = &RogueAiObjectContextInternal::kidney_shot;
creators["rupture"] = &RogueAiObjectContextInternal::rupture;
creators["slice and dice"] = &RogueAiObjectContextInternal::slice_and_dice;
creators["hunger for blood"] = &RogueAiObjectContextInternal::hunger_for_blood;
creators["eviscerate"] = &RogueAiObjectContextInternal::eviscerate;
creators["vanish"] = &RogueAiObjectContextInternal::vanish;
creators["evasion"] = &RogueAiObjectContextInternal::evasion;
creators["kick"] = &RogueAiObjectContextInternal::kick;
creators["feint"] = &RogueAiObjectContextInternal::feint;
creators["backstab"] = &RogueAiObjectContextInternal::backstab;
creators["expose armor"] = &RogueAiObjectContextInternal::expose_armor;
creators["kick on enemy healer"] = &RogueAiObjectContextInternal::kick_on_enemy_healer;
creators["blade flurry"] = &RogueAiObjectContextInternal::blade_flurry;
creators["adrenaline rush"] = &RogueAiObjectContextInternal::adrenaline_rush;
creators["ambush"] = &RogueAiObjectContextInternal::ambush;
creators["stealth"] = &RogueAiObjectContextInternal::stealth;
creators["sprint"] = &RogueAiObjectContextInternal::sprint;
creators["garrote"] = &RogueAiObjectContextInternal::garrote;
creators["cheap shot"] = &RogueAiObjectContextInternal::cheap_shot;
creators["blind"] = &RogueAiObjectContextInternal::blind;
creators["unstealth"] = &RogueAiObjectContextInternal::unstealth;
creators["sap"] = &RogueAiObjectContextInternal::sap;
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 on main hand"] = &RogueAiObjectContextInternal::use_instant_poison;
creators["use deadly poison on off hand"] = &RogueAiObjectContextInternal::use_deadly_poison;
creators["use instant poison on off hand"] = &RogueAiObjectContextInternal::use_instant_poison_off_hand;
creators["fan of knives"] = &RogueAiObjectContextInternal::fan_of_knives;
creators["killing spree"] = &RogueAiObjectContextInternal::killing_spree;
}
private:
static Action* adrenaline_rush(PlayerbotAI* botAI) { return new CastAdrenalineRushAction(botAI); }
static Action* blade_flurry(PlayerbotAI* botAI) { return new CastBladeFlurryAction(botAI); }
static Action* riposte(PlayerbotAI* botAI) { return new CastRiposteAction(botAI); }
static Action* mutilate(PlayerbotAI* botAI) { return new CastMutilateAction(botAI); }
static Action* sinister_strike(PlayerbotAI* botAI) { return new CastSinisterStrikeAction(botAI); }
static Action* gouge(PlayerbotAI* botAI) { return new CastGougeAction(botAI); }
static Action* kidney_shot(PlayerbotAI* botAI) { return new CastKidneyShotAction(botAI); }
static Action* rupture(PlayerbotAI* botAI) { return new CastRuptureAction(botAI); }
static Action* slice_and_dice(PlayerbotAI* botAI) { return new CastSliceAndDiceAction(botAI); }
static Action* hunger_for_blood(PlayerbotAI* botAI) { return new CastHungerForBloodAction(botAI); }
static Action* eviscerate(PlayerbotAI* botAI) { return new CastEviscerateAction(botAI); }
static Action* vanish(PlayerbotAI* botAI) { return new CastVanishAction(botAI); }
static Action* evasion(PlayerbotAI* botAI) { return new CastEvasionAction(botAI); }
static Action* kick(PlayerbotAI* botAI) { return new CastKickAction(botAI); }
static Action* feint(PlayerbotAI* botAI) { return new CastFeintAction(botAI); }
static Action* backstab(PlayerbotAI* botAI) { return new CastBackstabAction(botAI); }
static Action* expose_armor(PlayerbotAI* botAI) { return new CastExposeArmorAction(botAI); }
static Action* kick_on_enemy_healer(PlayerbotAI* botAI) { return new CastKickOnEnemyHealerAction(botAI); }
static Action* ambush(PlayerbotAI* botAI) { return new CastAmbushAction(botAI); }
static Action* stealth(PlayerbotAI* botAI) { return new CastStealthAction(botAI); }
static Action* sprint(PlayerbotAI* botAI) { return new CastSprintAction(botAI); }
static Action* garrote(PlayerbotAI* botAI) { return new CastGarroteAction(botAI); }
static Action* cheap_shot(PlayerbotAI* botAI) { return new CastCheapShotAction(botAI); }
static Action* blind(PlayerbotAI* botAI) { return new CastBlindAction(botAI); }
static Action* check_stealth(PlayerbotAI* botAI) { return new CheckStealthAction(botAI); }
static Action* sap(PlayerbotAI* botAI) { return new CastSapAction(botAI); }
static Action* unstealth(PlayerbotAI* botAI) { return new UnstealthAction(botAI); }
static Action* envenom(PlayerbotAI* ai) { return new EnvenomAction(ai); }
static Action* 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); }
static Action* use_instant_poison_off_hand(PlayerbotAI* ai) { return new UseInstantPoisonOffHandAction(ai); }
static Action* fan_of_knives(PlayerbotAI* ai) { return new FanOfKnivesAction(ai); }
static Action* killing_spree(PlayerbotAI* ai) { return new CastKillingSpreeAction(ai); }
private:
static Action* adrenaline_rush(PlayerbotAI* botAI) { return new CastAdrenalineRushAction(botAI); }
static Action* blade_flurry(PlayerbotAI* botAI) { return new CastBladeFlurryAction(botAI); }
static Action* riposte(PlayerbotAI* botAI) { return new CastRiposteAction(botAI); }
static Action* mutilate(PlayerbotAI* botAI) { return new CastMutilateAction(botAI); }
static Action* sinister_strike(PlayerbotAI* botAI) { return new CastSinisterStrikeAction(botAI); }
static Action* gouge(PlayerbotAI* botAI) { return new CastGougeAction(botAI); }
static Action* kidney_shot(PlayerbotAI* botAI) { return new CastKidneyShotAction(botAI); }
static Action* rupture(PlayerbotAI* botAI) { return new CastRuptureAction(botAI); }
static Action* slice_and_dice(PlayerbotAI* botAI) { return new CastSliceAndDiceAction(botAI); }
static Action* hunger_for_blood(PlayerbotAI* botAI) { return new CastHungerForBloodAction(botAI); }
static Action* eviscerate(PlayerbotAI* botAI) { return new CastEviscerateAction(botAI); }
static Action* vanish(PlayerbotAI* botAI) { return new CastVanishAction(botAI); }
static Action* evasion(PlayerbotAI* botAI) { return new CastEvasionAction(botAI); }
static Action* kick(PlayerbotAI* botAI) { return new CastKickAction(botAI); }
static Action* feint(PlayerbotAI* botAI) { return new CastFeintAction(botAI); }
static Action* backstab(PlayerbotAI* botAI) { return new CastBackstabAction(botAI); }
static Action* expose_armor(PlayerbotAI* botAI) { return new CastExposeArmorAction(botAI); }
static Action* kick_on_enemy_healer(PlayerbotAI* botAI) { return new CastKickOnEnemyHealerAction(botAI); }
static Action* ambush(PlayerbotAI* botAI) { return new CastAmbushAction(botAI); }
static Action* stealth(PlayerbotAI* botAI) { return new CastStealthAction(botAI); }
static Action* sprint(PlayerbotAI* botAI) { return new CastSprintAction(botAI); }
static Action* garrote(PlayerbotAI* botAI) { return new CastGarroteAction(botAI); }
static Action* cheap_shot(PlayerbotAI* botAI) { return new CastCheapShotAction(botAI); }
static Action* blind(PlayerbotAI* botAI) { return new CastBlindAction(botAI); }
static Action* check_stealth(PlayerbotAI* botAI) { return new CheckStealthAction(botAI); }
static Action* sap(PlayerbotAI* botAI) { return new CastSapAction(botAI); }
static Action* unstealth(PlayerbotAI* botAI) { return new UnstealthAction(botAI); }
static Action* envenom(PlayerbotAI* ai) { return new EnvenomAction(ai); }
static Action* 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); }
static Action* use_instant_poison_off_hand(PlayerbotAI* ai) { return new UseInstantPoisonOffHandAction(ai); }
static Action* fan_of_knives(PlayerbotAI* ai) { return new FanOfKnivesAction(ai); }
static Action* killing_spree(PlayerbotAI* ai) { return new CastKillingSpreeAction(ai); }
};
RogueAiObjectContext::RogueAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_ROGUEAIOBJECTCONTEXT_H
@@ -11,8 +12,8 @@ class PlayerbotAI;
class RogueAiObjectContext : public AiObjectContext
{
public:
RogueAiObjectContext(PlayerbotAI* botAI);
public:
RogueAiObjectContext(PlayerbotAI* botAI);
};
#endif

View File

@@ -1,11 +1,13 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "RogueComboActions.h"
#include "Playerbots.h"
bool CastComboAction::isUseful()
{
return CastMeleeSpellAction::isUseful() && AI_VALUE2(uint8, "combo", "current target") < 5;
return CastMeleeSpellAction::isUseful() && AI_VALUE2(uint8, "combo", "current target") < 5;
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_ROGUECOMBOACTIONS_H
@@ -11,40 +12,40 @@ class PlayerbotAI;
class CastComboAction : public CastMeleeSpellAction
{
public:
CastComboAction(PlayerbotAI* botAI, std::string const name) : CastMeleeSpellAction(botAI, name) { }
public:
CastComboAction(PlayerbotAI* botAI, std::string const name) : CastMeleeSpellAction(botAI, name) {}
bool isUseful() override;
bool isUseful() override;
};
class CastSinisterStrikeAction : public CastComboAction
{
public:
CastSinisterStrikeAction(PlayerbotAI* botAI) : CastComboAction(botAI, "sinister strike") { }
public:
CastSinisterStrikeAction(PlayerbotAI* botAI) : CastComboAction(botAI, "sinister strike") {}
};
class CastMutilateAction : public CastComboAction
{
public:
CastMutilateAction(PlayerbotAI* botAI) : CastComboAction(botAI, "mutilate") { }
public:
CastMutilateAction(PlayerbotAI* botAI) : CastComboAction(botAI, "mutilate") {}
};
class CastRiposteAction : public CastComboAction
{
public:
CastRiposteAction(PlayerbotAI* botAI) : CastComboAction(botAI, "riposte") { }
public:
CastRiposteAction(PlayerbotAI* botAI) : CastComboAction(botAI, "riposte") {}
};
class CastGougeAction : public CastComboAction
{
public:
CastGougeAction(PlayerbotAI* botAI) : CastComboAction(botAI, "gouge") { }
public:
CastGougeAction(PlayerbotAI* botAI) : CastComboAction(botAI, "gouge") {}
};
class CastBackstabAction : public CastComboAction
{
public:
CastBackstabAction(PlayerbotAI* botAI) : CastComboAction(botAI, "backstab") { }
public:
CastBackstabAction(PlayerbotAI* botAI) : CastComboAction(botAI, "backstab") {}
};
#endif

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_ROGUEFINISHINGACTIONS_H
@@ -11,32 +12,32 @@ class PlayerbotAI;
class CastEviscerateAction : public CastMeleeSpellAction
{
public:
CastEviscerateAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "eviscerate") { }
public:
CastEviscerateAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "eviscerate") {}
};
class CastSliceAndDiceAction : public CastMeleeSpellAction
{
public:
CastSliceAndDiceAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "slice and dice") { }
public:
CastSliceAndDiceAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "slice and dice") {}
};
class CastExposeArmorAction : public CastDebuffSpellAction
{
public:
CastExposeArmorAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "expose armor", false, 25.0f) { }
public:
CastExposeArmorAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "expose armor", false, 25.0f) {}
};
class CastRuptureAction : public CastDebuffSpellAction
{
public:
CastRuptureAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "rupture", true, 6.0f) { }
public:
CastRuptureAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "rupture", true, 6.0f) {}
};
class CastKidneyShotAction : public CastMeleeSpellAction
{
public:
CastKidneyShotAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "kidney shot") { }
public:
CastKidneyShotAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "kidney shot") {}
};
#endif

View File

@@ -1,11 +1,10 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "RogueOpeningActions.h"
#include "Playerbots.h"
Value<Unit*>* CastSapAction::GetTargetValue()
{
return context->GetValue<Unit*>("cc target", getName());
}
Value<Unit*>* CastSapAction::GetTargetValue() { return context->GetValue<Unit*>("cc target", getName()); }

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_ROGUEOPENINGACTIONS_H
@@ -12,29 +13,29 @@ class Unit;
class CastSapAction : public CastMeleeSpellAction
{
public:
CastSapAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "sap") { }
public:
CastSapAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "sap") {}
Value<Unit*>* GetTargetValue() override;
bool isUseful() override { return true; }
Value<Unit*>* GetTargetValue() override;
bool isUseful() override { return true; }
};
class CastGarroteAction : public CastDebuffSpellAction
{
public:
CastGarroteAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "garrote", true, 8.0f) { }
public:
CastGarroteAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "garrote", true, 8.0f) {}
};
class CastCheapShotAction : public CastMeleeSpellAction
{
public:
CastCheapShotAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "cheap shot") { }
public:
CastCheapShotAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "cheap shot") {}
};
class CastAmbushAction : public CastMeleeSpellAction
{
public:
CastAmbushAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "ambush") { }
public:
CastAmbushAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "ambush") {}
};
#endif

View File

@@ -1,8 +1,10 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "RogueTriggers.h"
#include "GenericTriggers.h"
#include "Playerbots.h"
#include "ServerFacade.h"
@@ -17,9 +19,12 @@ bool UnstealthTrigger::IsActive()
if (!botAI->HasAura("stealth", bot))
return false;
return botAI->HasAura("stealth", bot) && !AI_VALUE(uint8, "attacker count") && (AI_VALUE2(bool, "moving", "self target") && ((botAI->GetMaster() &&
sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "master target"), 10.0f) && AI_VALUE2(bool, "moving", "master target")) ||
!AI_VALUE(uint8, "attacker count")));
return botAI->HasAura("stealth", bot) && !AI_VALUE(uint8, "attacker count") &&
(AI_VALUE2(bool, "moving", "self target") &&
((botAI->GetMaster() &&
sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "master target"), 10.0f) &&
AI_VALUE2(bool, "moving", "master target")) ||
!AI_VALUE(uint8, "attacker count")));
}
bool StealthTrigger::IsActive()
@@ -30,7 +35,8 @@ bool StealthTrigger::IsActive()
float distance = 30.f;
Unit* target = AI_VALUE(Unit*, "enemy player target");
if (target && !target->IsInWorld()) {
if (target && !target->IsInWorld())
{
return false;
}
if (!target)
@@ -57,15 +63,9 @@ bool StealthTrigger::IsActive()
return target && sServerFacade->GetDistance2d(bot, target) < distance;
}
bool SapTrigger::IsPossible()
{
return bot->GetLevel() > 10 && bot->HasSpell(6770) && !bot->IsInCombat();
}
bool SapTrigger::IsPossible() { return bot->GetLevel() > 10 && bot->HasSpell(6770) && !bot->IsInCombat(); }
bool SprintTrigger::IsPossible()
{
return bot->HasSpell(2983);
}
bool SprintTrigger::IsPossible() { return bot->HasSpell(2983); }
bool SprintTrigger::IsActive()
{
@@ -81,7 +81,8 @@ bool SprintTrigger::IsActive()
Unit* dps = AI_VALUE(Unit*, "dps target");
Unit* enemyPlayer = AI_VALUE(Unit*, "enemy player target");
if (enemyPlayer && !enemyPlayer->IsInWorld()) {
if (enemyPlayer && !enemyPlayer->IsInWorld())
{
return false;
}
if (dps)
@@ -96,33 +97,41 @@ bool SprintTrigger::IsActive()
if ((dps && dps->IsInCombat()) || enemyPlayer)
distance -= 10;
return AI_VALUE2(bool, "moving", "self target") && (AI_VALUE2(bool, "moving", "dps target") || AI_VALUE2(bool, "moving", "enemy player target")) &&
targeted && (sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "dps target"), distance) ||
return AI_VALUE2(bool, "moving", "self target") &&
(AI_VALUE2(bool, "moving", "dps target") || AI_VALUE2(bool, "moving", "enemy player target")) && targeted &&
(sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "dps 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 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 );
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 );
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;
}
bool TargetWithComboPointsLowerHealTrigger::IsActive() {
bool TargetWithComboPointsLowerHealTrigger::IsActive()
{
Unit* target = AI_VALUE(Unit*, "current target");
if (!target || !target->IsAlive() || !target->IsInWorld()) {
if (!target || !target->IsAlive() || !target->IsInWorld())
{
return false;
}
return ComboPointsAvailableTrigger::IsActive() && (target->GetHealth() / AI_VALUE(float, "expected group dps")) <= lifeTime;
return ComboPointsAvailableTrigger::IsActive() &&
(target->GetHealth() / AI_VALUE(float, "expected group dps")) <= lifeTime;
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_ROGUETRIGGERS_H
@@ -11,121 +12,125 @@ class PlayerbotAI;
class KickInterruptSpellTrigger : public InterruptSpellTrigger
{
public:
KickInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "kick") { }
public:
KickInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "kick") {}
};
class SliceAndDiceTrigger : public BuffTrigger
{
public:
SliceAndDiceTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "slice and dice") { }
public:
SliceAndDiceTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "slice and dice") {}
};
class HungerForBloodTrigger : public BuffTrigger
{
public:
HungerForBloodTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "hunger for blood") { }
public:
HungerForBloodTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "hunger for blood") {}
};
class AdrenalineRushTrigger : public BoostTrigger
{
public:
AdrenalineRushTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "adrenaline rush") { }
public:
AdrenalineRushTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "adrenaline rush") {}
// bool isPossible();
// bool isPossible();
};
class RuptureTrigger : public DebuffTrigger
{
public:
RuptureTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "rupture", 1, true) { }
public:
RuptureTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "rupture", 1, true) {}
};
class ExposeArmorTrigger : public DebuffTrigger
{
public:
ExposeArmorTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "expose armor") { }
virtual bool IsActive() override;
public:
ExposeArmorTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "expose armor") {}
virtual bool IsActive() override;
};
class KickInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger
{
public:
KickInterruptEnemyHealerSpellTrigger(PlayerbotAI* botAI) : InterruptEnemyHealerTrigger(botAI, "kick") { }
public:
KickInterruptEnemyHealerSpellTrigger(PlayerbotAI* botAI) : InterruptEnemyHealerTrigger(botAI, "kick") {}
};
class InStealthTrigger : public HasAuraTrigger
{
public:
InStealthTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "stealth") { }
public:
InStealthTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "stealth") {}
};
class NoStealthTrigger : public HasNoAuraTrigger
{
public:
NoStealthTrigger(PlayerbotAI* botAI) : HasNoAuraTrigger(botAI, "stealth") { }
public:
NoStealthTrigger(PlayerbotAI* botAI) : HasNoAuraTrigger(botAI, "stealth") {}
};
class UnstealthTrigger : public BuffTrigger
{
public:
UnstealthTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "stealth", 3) { }
public:
UnstealthTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "stealth", 3) {}
bool IsActive() override;
bool IsActive() override;
};
class StealthTrigger : public Trigger
{
public:
StealthTrigger(PlayerbotAI* botAI) : Trigger(botAI, "stealth") { }
public:
StealthTrigger(PlayerbotAI* botAI) : Trigger(botAI, "stealth") {}
bool IsActive() override;
bool IsActive() override;
};
class SapTrigger : public HasCcTargetTrigger
{
public:
SapTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "sap") { }
public:
SapTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "sap") {}
bool IsPossible();
bool IsPossible();
};
class SprintTrigger : public BuffTrigger
{
public:
SprintTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "sprint", 3) { }
public:
SprintTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "sprint", 3) {}
bool IsPossible();
bool IsActive() override;
bool IsPossible();
bool IsActive() override;
};
class MainHandWeaponNoEnchantTrigger : public BuffTrigger
{
public:
MainHandWeaponNoEnchantTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "main hand", 1) {}
virtual bool IsActive();
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();
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) {}
public:
TricksOfTheTradeOnMainTankTrigger(PlayerbotAI* ai) : BuffOnMainTankTrigger(ai, "tricks of the trade", true) {}
};
class TargetWithComboPointsLowerHealTrigger : public ComboPointsAvailableTrigger
{
public:
TargetWithComboPointsLowerHealTrigger(PlayerbotAI* ai, int32 combo_point = 5, float lifeTime = 8.0f) : ComboPointsAvailableTrigger(ai, combo_point), lifeTime(lifeTime) {}
bool IsActive() override;
private:
float lifeTime;
public:
TargetWithComboPointsLowerHealTrigger(PlayerbotAI* ai, int32 combo_point = 5, float lifeTime = 8.0f)
: ComboPointsAvailableTrigger(ai, combo_point), lifeTime(lifeTime)
{
}
bool IsActive() override;
private:
float lifeTime;
};
#endif