mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
shaman, rogue strategy port, use item action.
This commit is contained in:
93
src/strategy/rogue/AssassinationRogueStrategy.cpp
Normal file
93
src/strategy/rogue/AssassinationRogueStrategy.cpp
Normal 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)));
|
||||
}
|
||||
19
src/strategy/rogue/AssassinationRogueStrategy.h
Normal file
19
src/strategy/rogue/AssassinationRogueStrategy.h
Normal 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
|
||||
@@ -10,101 +10,116 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
public:
|
||||
DpsRogueStrategyActionNodeFactory()
|
||||
{
|
||||
creators["riposte"] = &riposte;
|
||||
creators["mutilate"] = &mutilate;
|
||||
creators["sinister strike"] = &sinister_strike;
|
||||
creators["kick"] = &kick;
|
||||
creators["kidney shot"] = &kidney_shot;
|
||||
creators["slice and dice"] = &slice_and_dice;
|
||||
creators["rupture"] = &rupture;
|
||||
creators["backstab"] = &backstab;
|
||||
creators["melee"] = &melee;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* riposte([[maybe_unused]] PlayerbotAI* botAI)
|
||||
static ActionNode* melee(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("riposte",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
return new ActionNode ("melee",
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("mutilate"), NULL),
|
||||
/*C*/ NULL);
|
||||
}
|
||||
|
||||
static ActionNode* mutilate([[maybe_unused]] PlayerbotAI* botAI)
|
||||
static ActionNode* mutilate(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("mutilate",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("sinister strike"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("sinister strike"), NULL),
|
||||
/*C*/ NULL);
|
||||
}
|
||||
|
||||
static ActionNode* sinister_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
static ActionNode* sinister_strike(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("sinister strike",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("melee"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("melee"), NULL),
|
||||
/*C*/ NULL);
|
||||
}
|
||||
|
||||
static ActionNode* kick([[maybe_unused]] PlayerbotAI* botAI)
|
||||
static ActionNode* kick(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("kick",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("kidney shot"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("kidney shot"), NULL),
|
||||
/*C*/ NULL);
|
||||
}
|
||||
|
||||
static ActionNode* kidney_shot([[maybe_unused]] PlayerbotAI* botAI)
|
||||
static ActionNode* kidney_shot(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("kidney shot",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
/*P*/ NULL,
|
||||
/*A*/ NULL,
|
||||
/*C*/ NULL);
|
||||
}
|
||||
|
||||
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)
|
||||
static ActionNode* backstab(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("backstab",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
/*P*/ NULL,
|
||||
/*A*/ NextAction::array(0, new NextAction("mutilate"), NULL),
|
||||
/*C*/ NULL);
|
||||
}
|
||||
};
|
||||
|
||||
DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new DpsRogueStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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("medium threat", NextAction::array(0, new NextAction("feint", 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("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("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_HIGH + 1), nullptr)));
|
||||
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("in stealth", NextAction::array(0, new NextAction("check stealth", ACTION_EMERGENCY), nullptr)));
|
||||
triggers.push_back(new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", ACTION_NORMAL), nullptr)));
|
||||
triggers.push_back(new TriggerNode("sprint", NextAction::array(0, new NextAction("sprint", ACTION_INTERRUPT), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"high energy available",
|
||||
NextAction::array(0, new NextAction("sinister strike", ACTION_NORMAL + 3), NULL)));
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"slice and dice",
|
||||
NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 2), NULL)));
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"combo points available",
|
||||
NextAction::array(0, new NextAction("rupture", ACTION_HIGH + 1), 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(
|
||||
"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>
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
#define _PLAYERBOT_DPSROGUESTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
#include "MeleeCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DpsRogueStrategy : public CombatStrategy
|
||||
class DpsRogueStrategy : public MeleeCombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsRogueStrategy(PlayerbotAI* botAI);
|
||||
@@ -17,6 +18,7 @@ class DpsRogueStrategy : public CombatStrategy
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dps"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
virtual int GetType() { return MeleeCombatStrategy::GetType() | STRATEGY_TYPE_DPS; }
|
||||
};
|
||||
|
||||
class StealthedRogueStrategy : public Strategy
|
||||
|
||||
@@ -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("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("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", 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)));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ bool CastStealthAction::Execute(Event event)
|
||||
{
|
||||
if (botAI->CastSpell("stealth", bot))
|
||||
{
|
||||
botAI->ChangeStrategy("-dps,+stealthed", BOT_STATE_COMBAT);
|
||||
// botAI->ChangeStrategy("-dps,+stealthed", BOT_STATE_COMBAT);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -25,7 +25,7 @@ bool CastStealthAction::Execute(Event event)
|
||||
bool UnstealthAction::Execute(Event event)
|
||||
{
|
||||
botAI->RemoveAura("stealth");
|
||||
botAI->ChangeStrategy("+dps,-stealthed", BOT_STATE_COMBAT);
|
||||
// botAI->ChangeStrategy("+dps,-stealthed", BOT_STATE_COMBAT);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -49,3 +49,69 @@ bool CastVanishAction::isUseful()
|
||||
// do not use with WSG flag or EYE flag
|
||||
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();
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
#define _PLAYERBOT_ROGUEACTIONS_H
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "UseItemAction.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
@@ -113,4 +114,32 @@ class CastKickOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
|
||||
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
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "NamedObjectContext.h"
|
||||
#include "PullStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
#include "AssassinationRogueStrategy.h"
|
||||
|
||||
class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
@@ -27,6 +28,7 @@ class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
creators["stealthed"] = &RogueStrategyFactoryInternal::stealthed;
|
||||
creators["stealth"] = &RogueStrategyFactoryInternal::stealth;
|
||||
creators["cc"] = &RogueStrategyFactoryInternal::cc;
|
||||
creators["melee"] = &RogueStrategyFactoryInternal::melee;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -38,6 +40,7 @@ class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
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); }
|
||||
static Strategy* melee(PlayerbotAI* botAI) { return new AssassinationRogueStrategy(botAI); }
|
||||
};
|
||||
|
||||
class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
@@ -56,6 +59,9 @@ class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
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;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -71,6 +77,9 @@ class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
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); }
|
||||
};
|
||||
|
||||
class RogueAiObjectContextInternal : public NamedObjectContext<Action>
|
||||
@@ -104,6 +113,10 @@ class RogueAiObjectContextInternal : public NamedObjectContext<Action>
|
||||
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"] = &RogueAiObjectContextInternal::use_instant_poison;
|
||||
creators["use deadly poison"] = &RogueAiObjectContextInternal::use_deadly_poison;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -133,6 +146,10 @@ class RogueAiObjectContextInternal : public NamedObjectContext<Action>
|
||||
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); }
|
||||
};
|
||||
|
||||
RogueAiObjectContext::RogueAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)
|
||||
|
||||
@@ -92,3 +92,21 @@ bool SprintTrigger::IsActive()
|
||||
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 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;
|
||||
}
|
||||
@@ -39,6 +39,7 @@ class ExposeArmorTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
ExposeArmorTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "expose armor") { }
|
||||
virtual bool IsActive() override;
|
||||
};
|
||||
|
||||
class KickInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger
|
||||
@@ -92,4 +93,24 @@ class SprintTrigger : public BuffTrigger
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user