Big update.

This commit is contained in:
UltraNix
2022-03-12 22:27:09 +01:00
parent b3d00ccb26
commit b952636f0d
843 changed files with 1534330 additions and 99 deletions

View File

@@ -0,0 +1,205 @@
/*
* 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["riposte"] = &riposte;
creators["mutilate"] = &mutilate;
creators["sinister strike"] = &sinister_strike;
creators["kick"] = &kick;
creators["kidney shot"] = &kidney_shot;
creators["rupture"] = &rupture;
creators["backstab"] = &backstab;
}
private:
static ActionNode* riposte(PlayerbotAI* botAI)
{
return new ActionNode ("riposte",
/*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* rupture(PlayerbotAI* botAI)
{
return new ActionNode ("rupture",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("eviscerate"), nullptr),
/*C*/ nullptr);
}
static ActionNode* backstab(PlayerbotAI* botAI)
{
return new ActionNode ("backstab",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
};
DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
{
actionNodeFactories.Add(new DpsRogueStrategyActionNodeFactory());
}
NextAction** DpsRogueStrategy::getDefaultActions()
{
return NextAction::array(0, new NextAction("riposte", ACTION_NORMAL), nullptr);
}
void DpsRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
CombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("combo points available", NextAction::array(0, new NextAction("rupture", 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)));
}
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;
}
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* 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* 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)
{
actionNodeFactories.Add(new StealthedRogueStrategyActionNodeFactory());
}
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);
}
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)));
}
void StealthStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
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)));
}
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)));
}
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)));
}

View File

@@ -0,0 +1,69 @@
/*
* 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
#define _PLAYERBOT_DPSROGUESTRATEGY_H
#include "CombatStrategy.h"
class PlayerbotAI;
class DpsRogueStrategy : public CombatStrategy
{
public:
DpsRogueStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "dps"; }
NextAction** getDefaultActions() override;
};
class StealthedRogueStrategy : public Strategy
{
public:
StealthedRogueStrategy(PlayerbotAI* botAI);
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) { };
//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) { }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "aoe"; }
};
class RogueBoostStrategy : public Strategy
{
public:
RogueBoostStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "boost"; }
};
class RogueCcStrategy : public Strategy
{
public:
RogueCcStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "cc"; }
};
#endif

View File

@@ -0,0 +1,16 @@
/*
* 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"
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)));
}

View File

@@ -0,0 +1,21 @@
/*
* 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
#define _PLAYERBOT_GENERICROGUENONCOMBATSTRATEGY_H
#include "NonCombatStrategy.h"
class PlayerbotAI;
class GenericRogueNonCombatStrategy : public NonCombatStrategy
{
public:
GenericRogueNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
std::string const getName() override { return "nc"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
};
#endif

View File

@@ -0,0 +1,51 @@
/*
* 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 "Playerbots.h"
bool CastStealthAction::isPossible()
{
// do not use with WSG flag or EYE flag
return !botAI->HasAura(23333, bot) && !botAI->HasAura(23335, bot) && !botAI->HasAura(34976, bot);
}
bool CastStealthAction::Execute(Event event)
{
if (botAI->CastSpell("stealth", bot))
{
botAI->ChangeStrategy("-dps,+stealthed", BOT_STATE_COMBAT);
}
return true;
}
bool UnstealthAction::Execute(Event event)
{
botAI->RemoveAura("stealth");
botAI->ChangeStrategy("+dps,-stealthed", BOT_STATE_COMBAT);
return true;
}
bool CheckStealthAction::Execute(Event event)
{
if (botAI->HasAura("stealth", bot))
{
botAI->ChangeStrategy("-dps,+stealthed", BOT_STATE_COMBAT);
}
else
{
botAI->ChangeStrategy("+dps,-stealthed", BOT_STATE_COMBAT);
}
return true;
}
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);
}

View File

@@ -0,0 +1,116 @@
/*
* 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
#define _PLAYERBOT_ROGUEACTIONS_H
#include "GenericSpellActions.h"
class PlayerbotAI;
class CastEvasionAction : public CastBuffSpellAction
{
public:
CastEvasionAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "evasion") { }
};
class CastSprintAction : public CastBuffSpellAction
{
public:
CastSprintAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "sprint") { }
std::string const GetTargetName() override { return "self target"; }
};
class CastStealthAction : public CastBuffSpellAction
{
public:
CastStealthAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "stealth") { }
std::string const GetTargetName() override { return "self target"; }
bool isPossible() override;
bool Execute(Event event) override;
};
class UnstealthAction : public Action
{
public:
UnstealthAction(PlayerbotAI* botAI) : Action(botAI, "unstealth") { }
bool Execute(Event event) override;
};
class CheckStealthAction : public Action
{
public:
CheckStealthAction(PlayerbotAI* botAI) : Action(botAI, "check stealth") { }
bool isPossible() override { return true; }
bool Execute(Event event) override;
};
class CastKickAction : public CastSpellAction
{
public:
CastKickAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "kick") { }
};
class CastFeintAction : public CastBuffSpellAction
{
public:
CastFeintAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "feint") { }
};
class CastDismantleAction : public CastSpellAction
{
public:
CastDismantleAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "dismantle") { }
};
class CastDistractAction : public CastSpellAction
{
public:
CastDistractAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "distract") { }
};
class CastVanishAction : public CastBuffSpellAction
{
public:
CastVanishAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "vanish") { }
bool isUseful() override;
};
class CastBlindAction : public CastDebuffSpellAction
{
public:
CastBlindAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "blind") { }
};
class CastBladeFlurryAction : public CastBuffSpellAction
{
public:
CastBladeFlurryAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blade flurry") { }
};
class CastAdrenalineRushAction : public CastBuffSpellAction
{
public:
CastAdrenalineRushAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "adrenaline rush") { }
};
class CastKillingSpreeAction : public CastBuffSpellAction
{
public:
CastKillingSpreeAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "killing spree") { }
};
class CastKickOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
{
public:
CastKickOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "kick") { }
};
#endif

View File

@@ -0,0 +1,141 @@
/*
* 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 "DpsRogueStrategy.h"
#include "GenericRogueNonCombatStrategy.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"
class RogueStrategyFactoryInternal : public NamedObjectContext<Strategy>
{
public:
RogueStrategyFactoryInternal()
{
creators["dps"] = &RogueStrategyFactoryInternal::dps;
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* dps(PlayerbotAI* botAI) { return new DpsRogueStrategy(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 RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
{
public:
RogueTriggerFactoryInternal()
{
creators["kick"] = &RogueTriggerFactoryInternal::kick;
creators["rupture"] = &RogueTriggerFactoryInternal::rupture;
creators["slice and dice"] = &RogueTriggerFactoryInternal::slice_and_dice;
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;
}
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* 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); }
};
class RogueAiObjectContextInternal : public NamedObjectContext<Action>
{
public:
RogueAiObjectContextInternal()
{
creators["riposte"] = &RogueAiObjectContextInternal::riposte;
creators["mutilate"] = &RogueAiObjectContextInternal::mutilate;
creators["sinister strike"] = &RogueAiObjectContextInternal::sinister_strike;
creators["kidney shot"] = &RogueAiObjectContextInternal::kidney_shot;
creators["rupture"] = &RogueAiObjectContextInternal::rupture;
creators["slice and dice"] = &RogueAiObjectContextInternal::slice_and_dice;
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;
}
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* 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* 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); }
};
RogueAiObjectContext::RogueAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)
{
strategyContexts.Add(new RogueStrategyFactoryInternal());
actionContexts.Add(new RogueAiObjectContextInternal());
triggerContexts.Add(new RogueTriggerFactoryInternal());
}

View File

@@ -0,0 +1,18 @@
/*
* 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
#define _PLAYERBOT_ROGUEAIOBJECTCONTEXT_H
#include "AiObjectContext.h"
class PlayerbotAI;
class RogueAiObjectContext : public AiObjectContext
{
public:
RogueAiObjectContext(PlayerbotAI* botAI);
};
#endif

View File

@@ -0,0 +1,11 @@
/*
* 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", "self target") < 5;
}

View File

@@ -0,0 +1,50 @@
/*
* 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
#define _PLAYERBOT_ROGUECOMBOACTIONS_H
#include "GenericSpellActions.h"
class PlayerbotAI;
class CastComboAction : public CastMeleeSpellAction
{
public:
CastComboAction(PlayerbotAI* botAI, std::string const name) : CastMeleeSpellAction(botAI, name) { }
bool isUseful() override;
};
class CastSinisterStrikeAction : public CastComboAction
{
public:
CastSinisterStrikeAction(PlayerbotAI* botAI) : CastComboAction(botAI, "sinister strike") { }
};
class CastMutilateAction : public CastComboAction
{
public:
CastMutilateAction(PlayerbotAI* botAI) : CastComboAction(botAI, "mutilate") { }
};
class CastRiposteAction : public CastComboAction
{
public:
CastRiposteAction(PlayerbotAI* botAI) : CastComboAction(botAI, "riposte") { }
};
class CastGougeAction : public CastComboAction
{
public:
CastGougeAction(PlayerbotAI* botAI) : CastComboAction(botAI, "gouge") { }
};
class CastBackstabAction : public CastComboAction
{
public:
CastBackstabAction(PlayerbotAI* botAI) : CastComboAction(botAI, "backstab") { }
};
#endif

View File

@@ -0,0 +1,42 @@
/*
* 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
#define _PLAYERBOT_ROGUEFINISHINGACTIONS_H
#include "GenericSpellActions.h"
class PlayerbotAI;
class CastEviscerateAction : public CastMeleeSpellAction
{
public:
CastEviscerateAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "eviscerate") { }
};
class CastSliceAndDiceAction : public CastMeleeSpellAction
{
public:
CastSliceAndDiceAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "slice and dice") { }
};
class CastExposeArmorAction : public CastMeleeSpellAction
{
public:
CastExposeArmorAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "expose armor") { }
};
class CastRuptureAction : public CastMeleeSpellAction
{
public:
CastRuptureAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "rupture") { }
};
class CastKidneyShotAction : public CastMeleeSpellAction
{
public:
CastKidneyShotAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "kidney shot") { }
};
#endif

View File

@@ -0,0 +1,11 @@
/*
* 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());
}

View File

@@ -0,0 +1,40 @@
/*
* 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
#define _PLAYERBOT_ROGUEOPENINGACTIONS_H
#include "GenericSpellActions.h"
class PlayerbotAI;
class Unit;
class CastSapAction : public CastMeleeSpellAction
{
public:
CastSapAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "sap") { }
Value<Unit*>* GetTargetValue() override;
bool isUseful() override { return true; }
};
class CastGarroteAction : public CastMeleeSpellAction
{
public:
CastGarroteAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "garrote") { }
};
class CastCheapShotAction : public CastMeleeSpellAction
{
public:
CastCheapShotAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "cheap shot") { }
};
class CastAmbushAction : public CastMeleeSpellAction
{
public:
CastAmbushAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "ambush") { }
};
#endif

View File

@@ -0,0 +1,94 @@
/*
* 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 "Playerbots.h"
#include "ServerFacade.h"
bool AdrenalineRushTrigger::isPossible()
{
return !botAI->HasAura("stealth", bot);
}
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")));
}
bool StealthTrigger::IsActive()
{
if (botAI->HasAura("stealth", bot) || bot->IsInCombat() || bot->HasSpellCooldown(1784))
return false;
float distance = 30.f;
Unit* target = AI_VALUE(Unit*, "enemy player target");
if (!target)
target = AI_VALUE(Unit*, "grind target");
if (!target)
target = AI_VALUE(Unit*, "dps target");
if (!target)
return false;
if (target && target->GetVictim())
distance -= 10;
if (target->isMoving() && target->GetVictim())
distance -= 10;
if (bot->InBattleground())
distance += 15;
if (bot->InArena())
distance += 15;
return target && sServerFacade->GetDistance2d(bot, target) < distance;
}
bool SapTrigger::IsPossible()
{
return bot->getLevel() > 10 && bot->HasSpell(6770) && !bot->IsInCombat();
}
bool SprintTrigger::IsPossible()
{
return bot->HasSpell(2983);
}
bool SprintTrigger::IsActive()
{
if (bot->HasSpellCooldown(2983))
return false;
float distance = botAI->GetMaster() ? 45.0f : 35.0f;
if (botAI->HasAura("stealth", bot))
distance -= 10;
bool targeted = false;
Unit* dps = AI_VALUE(Unit*, "dps target");
Unit* enemyPlayer = AI_VALUE(Unit*, "enemy player target");
if (dps)
targeted = (dps == AI_VALUE(Unit*, "current target"));
if (enemyPlayer && !targeted)
targeted = (enemyPlayer == AI_VALUE(Unit*, "current target"));
if (!targeted)
return false;
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) ||
sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), distance));
}

View File

@@ -0,0 +1,95 @@
/*
* 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
#define _PLAYERBOT_ROGUETRIGGERS_H
#include "GenericTriggers.h"
class PlayerbotAI;
class KickInterruptSpellTrigger : public InterruptSpellTrigger
{
public:
KickInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "kick") { }
};
class SliceAndDiceTrigger : public BuffTrigger
{
public:
SliceAndDiceTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "slice and dice") { }
};
class AdrenalineRushTrigger : public BuffTrigger
{
public:
AdrenalineRushTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "adrenaline rush") { }
bool isPossible();
};
class RuptureTrigger : public DebuffTrigger
{
public:
RuptureTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "rupture") { }
};
class ExposeArmorTrigger : public DebuffTrigger
{
public:
ExposeArmorTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "expose armor") { }
};
class KickInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger
{
public:
KickInterruptEnemyHealerSpellTrigger(PlayerbotAI* botAI) : InterruptEnemyHealerTrigger(botAI, "kick") { }
};
class InStealthTrigger : public HasAuraTrigger
{
public:
InStealthTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "stealth") { }
};
class NoStealthTrigger : public HasNoAuraTrigger
{
public:
NoStealthTrigger(PlayerbotAI* botAI) : HasNoAuraTrigger(botAI, "stealth") { }
};
class UnstealthTrigger : public BuffTrigger
{
public:
UnstealthTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "stealth", 3) { }
bool IsActive() override;
};
class StealthTrigger : public Trigger
{
public:
StealthTrigger(PlayerbotAI* botAI) : Trigger(botAI, "stealth") { }
bool IsActive() override;
};
class SapTrigger : public HasCcTargetTrigger
{
public:
SapTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "sap") { }
bool IsPossible();
};
class SprintTrigger : public BuffTrigger
{
public:
SprintTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "sprint", 3) { }
bool IsPossible();
bool IsActive() override;
};
#endif