mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-16 00:26:10 +00:00
Big update.
This commit is contained in:
11
src/strategy/generic/AttackEnemyPlayersStrategy.cpp
Normal file
11
src/strategy/generic/AttackEnemyPlayersStrategy.cpp
Normal 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 "AttackEnemyPlayersStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void AttackEnemyPlayersStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("enemy player near", NextAction::array(0, new NextAction("attack enemy player", 55.0f), nullptr)));
|
||||
}
|
||||
19
src/strategy/generic/AttackEnemyPlayersStrategy.h
Normal file
19
src/strategy/generic/AttackEnemyPlayersStrategy.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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_ATTACKENEMYPAYERSSTRATEGYACTION_H
|
||||
#define _PLAYERBOT_ATTACKENEMYPAYERSSTRATEGYACTION_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class AttackEnemyPlayersStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
AttackEnemyPlayersStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "pvp"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
82
src/strategy/generic/BattlegroundStrategy.cpp
Normal file
82
src/strategy/generic/BattlegroundStrategy.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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 "BattlegroundStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void BGStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("bg join", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg invite active", NextAction::array(0, new NextAction("bg status check", relevance), nullptr)));
|
||||
}
|
||||
|
||||
BGStrategy::BGStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
}
|
||||
|
||||
void WarsongStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
}
|
||||
|
||||
void AlteracStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
/* placeholder */
|
||||
}
|
||||
|
||||
void ArathiStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
}
|
||||
|
||||
void BattlegroundStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg waiting", NextAction::array(0, new NextAction("bg move to start", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg move to objective", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg check objective", 10.0f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", 80.0f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("team flagcarrier near", NextAction::array(0, new NextAction("bg protect fc", 40.0f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
}
|
||||
|
||||
void EyeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
}
|
||||
|
||||
void IsleStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("enter vehicle", 85.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("leave vehicle", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("hurl boulder", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("fire cannon", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("napalm", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("steam blast", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("ram", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("ram", 79.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("steam rush", 81.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("incendiary rocket", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("rocket blast", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("blade salvo", 71.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("glaive throw", 70.0f), nullptr)));
|
||||
}
|
||||
|
||||
void ArenaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no possible targets", NextAction::array(0, new NextAction("arena tactics", 1.0f), nullptr)));
|
||||
}
|
||||
90
src/strategy/generic/BattlegroundStrategy.h
Normal file
90
src/strategy/generic/BattlegroundStrategy.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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_BATTLEGROUNDSTRATEGY_H
|
||||
#define _PLAYERBOT_BATTLEGROUNDSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class BGStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
BGStrategy(PlayerbotAI* botAI);
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "bg"; }
|
||||
};
|
||||
|
||||
class BattlegroundStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
BattlegroundStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "Battleground"; }
|
||||
};
|
||||
|
||||
class WarsongStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
WarsongStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "warsong"; }
|
||||
};
|
||||
|
||||
class AlteracStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
AlteracStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "alterac"; }
|
||||
};
|
||||
|
||||
class ArathiStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ArathiStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "arathi"; }
|
||||
};
|
||||
|
||||
class EyeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
EyeStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "eye"; }
|
||||
};
|
||||
|
||||
class IsleStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
IsleStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "isle"; }
|
||||
};
|
||||
|
||||
class ArenaStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ArenaStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "arena"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
47
src/strategy/generic/CastTimeStrategy.cpp
Normal file
47
src/strategy/generic/CastTimeStrategy.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 "CastTimeStrategy.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
float CastTimeMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (action == nullptr)
|
||||
return 1.0f;
|
||||
|
||||
uint8 targetHealth = AI_VALUE2(uint8, "health", "current target");
|
||||
std::string const name = action->getName();
|
||||
|
||||
if (action->GetTarget() != AI_VALUE(Unit*, "current target"))
|
||||
return 1.0f;
|
||||
|
||||
if (targetHealth < sPlayerbotAIConfig->criticalHealth && dynamic_cast<CastSpellAction*>(action))
|
||||
{
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", name);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
return 1.0f;
|
||||
|
||||
if ((spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) != 0|| (spellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) != 0)
|
||||
return 1.0f;
|
||||
|
||||
uint32 castTime = spellInfo->CalcCastTime();
|
||||
if (castTime >= 3000)
|
||||
return 0.0f;
|
||||
|
||||
if (castTime >= 1500)
|
||||
return 0.5f;
|
||||
|
||||
if (castTime >= 1000)
|
||||
return 0.25f;
|
||||
}
|
||||
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void CastTimeStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers)
|
||||
{
|
||||
multipliers.push_back(new CastTimeMultiplier(botAI));
|
||||
}
|
||||
29
src/strategy/generic/CastTimeStrategy.h
Normal file
29
src/strategy/generic/CastTimeStrategy.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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_CASTTIMESTRATEGY_H
|
||||
#define _PLAYERBOT_CASTTIMESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CastTimeMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
CastTimeMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "cast time") { }
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class CastTimeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CastTimeStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "cast time"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
125
src/strategy/generic/ChatCommandHandlerStrategy.cpp
Normal file
125
src/strategy/generic/ChatCommandHandlerStrategy.cpp
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* 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 "ChatCommandHandlerStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
ChatCommandActionNodeFactoryInternal()
|
||||
{
|
||||
creators["tank attack chat shortcut"] = &tank_attack_chat_shortcut;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* tank_attack_chat_shortcut(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("tank attack chat shortcut",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ nullptr,
|
||||
/*C*/ NextAction::array(0, new NextAction("attack my target", 100.0f), nullptr));
|
||||
}
|
||||
};
|
||||
|
||||
void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("rep", NextAction::array(0, new NextAction("reputation", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("q", NextAction::array(0, new NextAction("query quest", relevance), new NextAction("query item usage", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("add all loot", NextAction::array(0, new NextAction("add all loot", relevance), new NextAction("loot", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("u", NextAction::array(0, new NextAction("use", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("c", NextAction::array(0, new NextAction("item count", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("items", NextAction::array(0, new NextAction("item count", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("inv", NextAction::array(0, new NextAction("item count", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("e", NextAction::array(0, new NextAction("equip", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("ue", NextAction::array(0, new NextAction("unequip", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("t", NextAction::array(0, new NextAction("trade", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("nt", NextAction::array(0, new NextAction("trade", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("s", NextAction::array(0, new NextAction("sell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("b", NextAction::array(0, new NextAction("buy", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("r", NextAction::array(0, new NextAction("reward", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("attack", NextAction::array(0, new NextAction("attack my target", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("accept", NextAction::array(0, new NextAction("accept quest", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("follow", NextAction::array(0, new NextAction("follow chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("stay", NextAction::array(0, new NextAction("stay chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("flee", NextAction::array(0, new NextAction("flee chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("tank attack", NextAction::array(0, new NextAction("tank attack chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("grind", NextAction::array(0, new NextAction("grind chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("talk", NextAction::array(0, new NextAction("gossip hello", relevance), new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("cast", NextAction::array(0, new NextAction("cast custom spell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("castnc", NextAction::array(0, new NextAction("cast custom nc spell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("revive", NextAction::array(0, new NextAction("spirit healer", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("runaway", NextAction::array(0, new NextAction("runaway chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("warning", NextAction::array(0, new NextAction("runaway chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("max dps", NextAction::array(0, new NextAction("max dps chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("attackers", NextAction::array(0, new NextAction("tell attackers", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("ready", NextAction::array(0, new NextAction("ready check", relevance), nullptr)));
|
||||
}
|
||||
|
||||
ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new ChatCommandActionNodeFactoryInternal());
|
||||
|
||||
supported.push_back("quests");
|
||||
supported.push_back("stats");
|
||||
supported.push_back("leave");
|
||||
supported.push_back("reputation");
|
||||
supported.push_back("log");
|
||||
supported.push_back("los");
|
||||
supported.push_back("drop");
|
||||
supported.push_back("share");
|
||||
supported.push_back("ll");
|
||||
supported.push_back("ss");
|
||||
supported.push_back("release");
|
||||
supported.push_back("teleport");
|
||||
supported.push_back("taxi");
|
||||
supported.push_back("repair");
|
||||
supported.push_back("talents");
|
||||
supported.push_back("spells");
|
||||
supported.push_back("co");
|
||||
supported.push_back("nc");
|
||||
supported.push_back("de");
|
||||
supported.push_back("trainer");
|
||||
supported.push_back("chat");
|
||||
supported.push_back("home");
|
||||
supported.push_back("destroy");
|
||||
supported.push_back("reset botAI");
|
||||
supported.push_back("emote");
|
||||
supported.push_back("buff");
|
||||
supported.push_back("help");
|
||||
supported.push_back("gb");
|
||||
supported.push_back("bank");
|
||||
supported.push_back("invite");
|
||||
supported.push_back("spell");
|
||||
supported.push_back("rti");
|
||||
supported.push_back("position");
|
||||
supported.push_back("summon");
|
||||
supported.push_back("who");
|
||||
supported.push_back("save mana");
|
||||
supported.push_back("formation");
|
||||
supported.push_back("stance");
|
||||
supported.push_back("sendmail");
|
||||
supported.push_back("mail");
|
||||
supported.push_back("outfit");
|
||||
supported.push_back("go");
|
||||
supported.push_back("debug");
|
||||
supported.push_back("cdebug");
|
||||
supported.push_back("cs");
|
||||
supported.push_back("wts");
|
||||
supported.push_back("hire");
|
||||
supported.push_back("craft");
|
||||
supported.push_back("flag");
|
||||
supported.push_back("range");
|
||||
supported.push_back("ra");
|
||||
supported.push_back("give leader");
|
||||
supported.push_back("cheat");
|
||||
supported.push_back("ginvite");
|
||||
supported.push_back("guild promote");
|
||||
supported.push_back("guild demote");
|
||||
supported.push_back("guild remove");
|
||||
supported.push_back("guild leave");
|
||||
supported.push_back("rtsc");
|
||||
}
|
||||
21
src/strategy/generic/ChatCommandHandlerStrategy.h
Normal file
21
src/strategy/generic/ChatCommandHandlerStrategy.h
Normal 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_CHATCOMMANDHANDLERSTRATEGY_H
|
||||
#define _PLAYERBOT_CHATCOMMANDHANDLERSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class ChatCommandHandlerStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
ChatCommandHandlerStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "chat"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
16
src/strategy/generic/CombatStrategy.cpp
Normal file
16
src/strategy/generic/CombatStrategy.cpp
Normal 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 "CombatStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void CombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr)));
|
||||
triggers.push_back(new TriggerNode("invalid target", NextAction::array(0, new NextAction("drop target", 55), nullptr)));
|
||||
triggers.push_back(new TriggerNode("mounted", NextAction::array(0, new NextAction("check mount state", 54), nullptr)));
|
||||
triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master", 55), nullptr)));
|
||||
triggers.push_back(new TriggerNode("combat stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("combat long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/CombatStrategy.h
Normal file
21
src/strategy/generic/CombatStrategy.h
Normal 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_COMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_COMBATSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT; }
|
||||
};
|
||||
|
||||
#endif
|
||||
87
src/strategy/generic/ConserveManaStrategy.cpp
Normal file
87
src/strategy/generic/ConserveManaStrategy.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* 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 "ConserveManaStrategy.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "LastSpellCastValue.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
float ConserveManaMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (!action)
|
||||
return 1.0f;
|
||||
|
||||
uint8 health = AI_VALUE2(uint8, "health", "self target");
|
||||
uint8 targetHealth = AI_VALUE2(uint8, "health", "current target");
|
||||
uint8 mana = AI_VALUE2(uint8, "mana", "self target");
|
||||
bool hasMana = AI_VALUE2(bool, "has mana", "self target");
|
||||
bool mediumMana = hasMana && mana < sPlayerbotAIConfig->mediumMana;
|
||||
|
||||
if (health < sPlayerbotAIConfig->lowHealth)
|
||||
return 1.0f;
|
||||
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
if (action->GetTarget() != target)
|
||||
return 1.0f;
|
||||
|
||||
CastSpellAction* spellAction = dynamic_cast<CastSpellAction*>(action);
|
||||
if (!spellAction)
|
||||
return 1.0f;
|
||||
|
||||
std::string const spell = spellAction->getName();
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", spell);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo || spellInfo->PowerType != POWER_MANA)
|
||||
return 1.0f;
|
||||
|
||||
if (mediumMana && dynamic_cast<CastBuffSpellAction*>(action))
|
||||
return 0.0f;
|
||||
|
||||
if (target && ((int)target->getLevel() - (int)bot->getLevel()) >= 0)
|
||||
return 1.0f;
|
||||
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float SaveManaMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (!action)
|
||||
return 1.0f;
|
||||
|
||||
if (action->GetTarget() != AI_VALUE(Unit*, "current target"))
|
||||
return 1.0f;
|
||||
|
||||
double saveLevel = AI_VALUE(double, "mana save level");
|
||||
if (saveLevel <= 1.0)
|
||||
return 1.0f;
|
||||
|
||||
CastSpellAction* spellAction = dynamic_cast<CastSpellAction*>(action);
|
||||
if (!spellAction)
|
||||
return 1.0f;
|
||||
|
||||
std::string const spell = spellAction->getName();
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", spell);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo || spellInfo->PowerType != POWER_MANA)
|
||||
return 1.0f;
|
||||
|
||||
int32 cost = spellInfo->ManaCost;
|
||||
if (!cost)
|
||||
return 1.0f;
|
||||
|
||||
time_t lastCastTime = AI_VALUE2(time_t, "last spell cast time", spell);
|
||||
if (!lastCastTime)
|
||||
return 1.0f;
|
||||
|
||||
time_t elapsed = time(nullptr) - lastCastTime;
|
||||
if ((double)elapsed < 10 * saveLevel)
|
||||
return 0.0f;
|
||||
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void ConserveManaStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new ConserveManaMultiplier(botAI));
|
||||
}
|
||||
37
src/strategy/generic/ConserveManaStrategy.h
Normal file
37
src/strategy/generic/ConserveManaStrategy.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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_CONSERVEMANASTRATEGY_H
|
||||
#define _PLAYERBOT_CONSERVEMANASTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class ConserveManaMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
ConserveManaMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "conserve mana") { }
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class SaveManaMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
SaveManaMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "save mana") { }
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class ConserveManaStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ConserveManaStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "conserve mana"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
23
src/strategy/generic/DeadStrategy.cpp
Normal file
23
src/strategy/generic/DeadStrategy.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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 "DeadStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DeadStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("auto release", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("auto release", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("dead", NextAction::array(0, new NextAction("find corpse", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("corpse near", NextAction::array(0, new NextAction("revive from corpse", relevance - 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("resurrect request", NextAction::array(0, new NextAction("accept resurrect", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("falling far", NextAction::array(0, new NextAction("repop", relevance + 1.f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("location stuck", NextAction::array(0, new NextAction("repop", relevance + 1), nullptr)));
|
||||
}
|
||||
|
||||
DeadStrategy::DeadStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
}
|
||||
21
src/strategy/generic/DeadStrategy.h
Normal file
21
src/strategy/generic/DeadStrategy.h
Normal 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_DEADSTRATEGY_H
|
||||
#define _PLAYERBOT_DEADSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DeadStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
DeadStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dead"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
6
src/strategy/generic/DebugStrategy.cpp
Normal file
6
src/strategy/generic/DebugStrategy.cpp
Normal file
@@ -0,0 +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.
|
||||
*/
|
||||
|
||||
#include "DebugStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
46
src/strategy/generic/DebugStrategy.h
Normal file
46
src/strategy/generic/DebugStrategy.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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_DEBUGSTRATEGY_H
|
||||
#define _PLAYERBOT_DEBUGSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class DebugStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug"; }
|
||||
};
|
||||
|
||||
class DebugMoveStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugMoveStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug move"; }
|
||||
};
|
||||
|
||||
class DebugRpgStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugRpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug rpg"; }
|
||||
};
|
||||
|
||||
class DebugSpellStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugSpellStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug spell"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
19
src/strategy/generic/DpsAssistStrategy.cpp
Normal file
19
src/strategy/generic/DpsAssistStrategy.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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 "DpsAssistStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DpsAssistStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("not dps target active", NextAction::array(0, new NextAction("dps assist", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
void DpsAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("not dps aoe target active", NextAction::array(0, new NextAction("dps aoe", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
32
src/strategy/generic/DpsAssistStrategy.h
Normal file
32
src/strategy/generic/DpsAssistStrategy.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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_DPSASSISTSTRATEGY_H
|
||||
#define _PLAYERBOT_DPSASSISTSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DpsAssistStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsAssistStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "dps assist"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class DpsAoeStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsAoeStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "dps aoe"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
26
src/strategy/generic/DuelStrategy.cpp
Normal file
26
src/strategy/generic/DuelStrategy.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 "DuelStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DuelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("duel requested", NextAction::array(0, new NextAction("accept duel", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("no attackers", NextAction::array(0, new NextAction("attack duel opponent", 70.0f), nullptr)));
|
||||
}
|
||||
|
||||
DuelStrategy::DuelStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
}
|
||||
|
||||
void StartDuelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
StartDuelStrategy::StartDuelStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
30
src/strategy/generic/DuelStrategy.h
Normal file
30
src/strategy/generic/DuelStrategy.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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_DUELSTRATEGY_H
|
||||
#define _PLAYERBOT_DUELSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DuelStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
DuelStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "duel"; }
|
||||
};
|
||||
|
||||
class StartDuelStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
StartDuelStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "start duel"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
22
src/strategy/generic/EmoteStrategy.cpp
Normal file
22
src/strategy/generic/EmoteStrategy.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 "EmoteStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void EmoteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("emote", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("suggest what to do", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("suggest trade", 1.0f), nullptr)));
|
||||
|
||||
if (sPlayerbotAIConfig->enableGreet)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("new player nearby", NextAction::array(0, new NextAction("greet", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("talk", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("receive text emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("receive emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/EmoteStrategy.h
Normal file
21
src/strategy/generic/EmoteStrategy.h
Normal 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_EMOTESTRATEGY_H
|
||||
#define _PLAYERBOT_EMOTESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class EmoteStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
EmoteStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "emote"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
18
src/strategy/generic/FleeStrategy.cpp
Normal file
18
src/strategy/generic/FleeStrategy.cpp
Normal 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.
|
||||
*/
|
||||
|
||||
#include "FleeStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void FleeStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("panic", NextAction::array(0, new NextAction("flee", ACTION_EMERGENCY + 9), nullptr)));
|
||||
triggers.push_back(new TriggerNode("outnumbered", NextAction::array(0, new NextAction("flee", ACTION_EMERGENCY + 9), nullptr)));
|
||||
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("flee", ACTION_MEDIUM_HEAL), nullptr)));
|
||||
}
|
||||
|
||||
void FleeFromAddsStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("has nearest adds", NextAction::array(0, new NextAction("runaway", 50.0f), nullptr)));
|
||||
}
|
||||
30
src/strategy/generic/FleeStrategy.h
Normal file
30
src/strategy/generic/FleeStrategy.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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_FLEESTRATEGY_H
|
||||
#define _PLAYERBOT_FLEESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class FleeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
FleeStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "flee"; };
|
||||
};
|
||||
|
||||
class FleeFromAddsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
FleeFromAddsStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "flee from adds"; };
|
||||
};
|
||||
|
||||
#endif
|
||||
16
src/strategy/generic/FollowMasterStrategy.cpp
Normal file
16
src/strategy/generic/FollowMasterStrategy.cpp
Normal 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 "FollowMasterStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** FollowMasterStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("follow", 1.0f), nullptr);
|
||||
}
|
||||
|
||||
void FollowMasterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master", ACTION_HIGH), nullptr)));
|
||||
}
|
||||
23
src/strategy/generic/FollowMasterStrategy.h
Normal file
23
src/strategy/generic/FollowMasterStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_FOLLOWMASTERSTRATEGY_H
|
||||
#define _PLAYERBOT_FOLLOWMASTERSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class FollowMasterStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
FollowMasterStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "follow"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
17
src/strategy/generic/GrindingStrategy.cpp
Normal file
17
src/strategy/generic/GrindingStrategy.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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 "GrindingStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** GrindingStrategy::getDefaultActions()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GrindingStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no target", NextAction::array(0, new NextAction("attack anything", 5.0f), nullptr)));
|
||||
}
|
||||
|
||||
23
src/strategy/generic/GrindingStrategy.h
Normal file
23
src/strategy/generic/GrindingStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_GRINDINGSTRATEGY_H
|
||||
#define _PLAYERBOT_GRINDINGSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GrindingStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GrindingStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "grind"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
NextAction** getDefaultActions();
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
15
src/strategy/generic/GroupStrategy.cpp
Normal file
15
src/strategy/generic/GroupStrategy.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* 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 "GroupStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void GroupStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("invite nearby", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("invite guild", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("leave far away", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("reset instances", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
22
src/strategy/generic/GroupStrategy.h
Normal file
22
src/strategy/generic/GroupStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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_GROUPSTRATEGY_H
|
||||
#define _PLAYERBOT_GROUPSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GroupStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GroupStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "group"; }
|
||||
uint32 GetType()const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*> &triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
16
src/strategy/generic/GuardStrategy.cpp
Normal file
16
src/strategy/generic/GuardStrategy.cpp
Normal 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 "GuardStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** GuardStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("guard", 4.0f), nullptr);
|
||||
}
|
||||
|
||||
void GuardStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
22
src/strategy/generic/GuardStrategy.h
Normal file
22
src/strategy/generic/GuardStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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_GUARDSTRATEGY_H
|
||||
#define _PLAYERBOT_GUARDSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GuardStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GuardStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "guard"; }
|
||||
NextAction** getDefaultActions();
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
16
src/strategy/generic/GuildStrategy.cpp
Normal file
16
src/strategy/generic/GuildStrategy.cpp
Normal 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 "GuildStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void GuildStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("offer petition nearby", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("guild manage nearby", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("petition signed", NextAction::array(0, new NextAction("turn in petition", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("buy tabard", NextAction::array(0, new NextAction("buy tabard", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("leave large guild", NextAction::array(0, new NextAction("guild leave", 4.0f), nullptr)));
|
||||
}
|
||||
|
||||
22
src/strategy/generic/GuildStrategy.h
Normal file
22
src/strategy/generic/GuildStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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_GUILDSTRATEGY_H
|
||||
#define _PLAYERBOT_GUILDSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GuildStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GuildStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "guild"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*> &triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
15
src/strategy/generic/KiteStrategy.cpp
Normal file
15
src/strategy/generic/KiteStrategy.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* 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 "KiteStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
KiteStrategy::KiteStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
|
||||
void KiteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("has aggro", NextAction::array(0, new NextAction("runaway", 51.0f), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/KiteStrategy.h
Normal file
21
src/strategy/generic/KiteStrategy.h
Normal 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_KITESTRATEGY_H
|
||||
#define _PLAYERBOT_KITESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class KiteStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
KiteStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "kite"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
17
src/strategy/generic/LfgStrategy.cpp
Normal file
17
src/strategy/generic/LfgStrategy.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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 "LfgStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void LfgStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("lfg join", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("lfg leave", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("unknown dungeon", NextAction::array(0, new NextAction("give leader in dungeon", relevance), nullptr)));
|
||||
}
|
||||
|
||||
LfgStrategy::LfgStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
}
|
||||
20
src/strategy/generic/LfgStrategy.h
Normal file
20
src/strategy/generic/LfgStrategy.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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_LFGSTRATEGY_H
|
||||
#define _PLAYERBOT_LFGSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class LfgStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
LfgStrategy(PlayerbotAI* botAI);
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*> &triggers) override;
|
||||
std::string const getName() override { return "lfg"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
26
src/strategy/generic/LootNonCombatStrategy.cpp
Normal file
26
src/strategy/generic/LootNonCombatStrategy.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 "LootNonCombatStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void LootNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("loot available", NextAction::array(0, new NextAction("loot", 6.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("far from loot target", NextAction::array(0, new NextAction("move to loot", 7.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("can loot", NextAction::array(0, new NextAction("open loot", 8.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("add all loot", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
void GatherStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("add gathering loot", 2.0f), nullptr)));
|
||||
}
|
||||
|
||||
void RevealStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("reveal gathering item", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
39
src/strategy/generic/LootNonCombatStrategy.h
Normal file
39
src/strategy/generic/LootNonCombatStrategy.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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_LOOTNONCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_LOOTNONCOMBATSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class LootNonCombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
LootNonCombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "loot"; }
|
||||
};
|
||||
|
||||
class GatherStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
GatherStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "gather"; }
|
||||
};
|
||||
|
||||
class RevealStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RevealStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "reveal"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
24
src/strategy/generic/MaintenanceStrategy.cpp
Normal file
24
src/strategy/generic/MaintenanceStrategy.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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 "MaintenanceStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** MaintenanceStrategy::getDefaultActions()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void MaintenanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("clean quest log", 6.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("use random recipe", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("use random quest item", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("disenchant random item", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("enchant random item", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("smart destroy item", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("move stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("move long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr)));
|
||||
}
|
||||
|
||||
23
src/strategy/generic/MaintenanceStrategy.h
Normal file
23
src/strategy/generic/MaintenanceStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_MAINTANCESTRATEGY_H
|
||||
#define _PLAYERBOT_MAINTANCESTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MaintenanceStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
MaintenanceStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "maintenance"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
12
src/strategy/generic/MarkRtiStrategy.cpp
Normal file
12
src/strategy/generic/MarkRtiStrategy.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* 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 "MarkRtiStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void MarkRtiStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no rti target", NextAction::array(0, new NextAction("mark rti", ACTION_NORMAL), nullptr)));
|
||||
}
|
||||
|
||||
21
src/strategy/generic/MarkRtiStrategy.h
Normal file
21
src/strategy/generic/MarkRtiStrategy.h
Normal 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_MARKRTISTRATEGY_H
|
||||
#define _PLAYERBOT_MARKRTISTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MarkRtiStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MarkRtiStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "mark rti"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
22
src/strategy/generic/MeleeCombatStrategy.cpp
Normal file
22
src/strategy/generic/MeleeCombatStrategy.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 "MeleeCombatStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void MeleeCombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_MOVE + 8), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy too close for melee", NextAction::array(0, new NextAction("move out of enemy contact", ACTION_NORMAL + 8), nullptr)));
|
||||
}
|
||||
|
||||
void SetBehindCombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("not behind target", NextAction::array(0, new NextAction("set behind", ACTION_NORMAL + 9), nullptr)));
|
||||
}
|
||||
31
src/strategy/generic/MeleeCombatStrategy.h
Normal file
31
src/strategy/generic/MeleeCombatStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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_MELEECOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_MELEECOMBATSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MeleeCombatStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
MeleeCombatStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_MELEE; }
|
||||
std::string const getName() override { return "close"; }
|
||||
};
|
||||
|
||||
class SetBehindCombatStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
SetBehindCombatStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "behind"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
29
src/strategy/generic/NonCombatStrategy.cpp
Normal file
29
src/strategy/generic/NonCombatStrategy.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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 "NonCombatStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void NonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("check mount state", 1.0f), new NextAction("check values", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("leader", 2.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("near dark portal", NextAction::array(0, new NextAction("move to dark portal", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("at dark portal azeroth", NextAction::array(0, new NextAction("use dark portal azeroth", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("at dark portal outland", NextAction::array(0, new NextAction("move from dark portal", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("need world buff", NextAction::array(0, new NextAction("world buff", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("vehicle near", NextAction::array(0, new NextAction("enter vehicle", 10.0f), nullptr)));
|
||||
}
|
||||
|
||||
void CollisionStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("collision", NextAction::array(0, new NextAction("move out of collision", 2.0f), nullptr)));
|
||||
}
|
||||
|
||||
void MountStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
/*triggers.push_back(new TriggerNode("no possible targets", NextAction::array(0, new NextAction("mount", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("no rpg target", NextAction::array(0, new NextAction("mount", 1.0f), nullptr)));*/
|
||||
/*triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("mount", 4.0f), nullptr)));*/
|
||||
}
|
||||
50
src/strategy/generic/NonCombatStrategy.h
Normal file
50
src/strategy/generic/NonCombatStrategy.h
Normal 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_NONCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_NONCOMBATSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class NonCombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
NonCombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class CollisionStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CollisionStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "collision"; }
|
||||
};
|
||||
|
||||
class MountStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MountStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "mount"; }
|
||||
};
|
||||
|
||||
class AttackTaggedStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
AttackTaggedStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "attack tagged"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
13
src/strategy/generic/PassTroughStrategy.cpp
Normal file
13
src/strategy/generic/PassTroughStrategy.cpp
Normal file
@@ -0,0 +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.
|
||||
*/
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void PassTroughStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
for (std::vector<std::string>::iterator i = supported.begin(); i != supported.end(); i++)
|
||||
triggers.push_back(new TriggerNode(i->c_str(), NextAction::array(0, new NextAction(i->c_str(), relevance), nullptr)));
|
||||
}
|
||||
|
||||
24
src/strategy/generic/PassTroughStrategy.h
Normal file
24
src/strategy/generic/PassTroughStrategy.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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_PASSTHROUGHSTRATEGY_H
|
||||
#define _PLAYERBOT_PASSTHROUGHSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class PassTroughStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
PassTroughStrategy(PlayerbotAI* botAI, float relevance = 100.0f) : Strategy(botAI), relevance(relevance) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
|
||||
protected:
|
||||
std::vector<std::string> supported;
|
||||
float relevance;
|
||||
};
|
||||
|
||||
#endif
|
||||
13
src/strategy/generic/PassiveStrategy.cpp
Normal file
13
src/strategy/generic/PassiveStrategy.cpp
Normal file
@@ -0,0 +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.
|
||||
*/
|
||||
|
||||
#include "PassiveStrategy.h"
|
||||
#include "PassiveMultiplier.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void PassiveStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new PassiveMultiplier(botAI));
|
||||
}
|
||||
|
||||
21
src/strategy/generic/PassiveStrategy.h
Normal file
21
src/strategy/generic/PassiveStrategy.h
Normal 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_PASSIVESTRATEGY_H
|
||||
#define _PLAYERBOT_PASSIVESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class PassiveStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
PassiveStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "passive"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
53
src/strategy/generic/PullStrategy.cpp
Normal file
53
src/strategy/generic/PullStrategy.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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 "PullStrategy.h"
|
||||
#include "PassiveMultiplier.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class MagePullMultiplier : public PassiveMultiplier
|
||||
{
|
||||
public:
|
||||
MagePullMultiplier(PlayerbotAI* botAI, std::string const action) : PassiveMultiplier(botAI), actionName(action) { }
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
|
||||
private:
|
||||
std::string const actionName;
|
||||
};
|
||||
|
||||
float MagePullMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (!action)
|
||||
return 1.0f;
|
||||
|
||||
std::string const name = action->getName();
|
||||
if (actionName == name || name == "reach spell" || name == "change strategy")
|
||||
return 1.0f;
|
||||
|
||||
return PassiveMultiplier::GetValue(action);
|
||||
}
|
||||
|
||||
NextAction** PullStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction(action, 105.0f), new NextAction("follow", 104.0f), new NextAction("end pull", 103.0f), nullptr);
|
||||
}
|
||||
|
||||
void PullStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
}
|
||||
|
||||
void PullStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new MagePullMultiplier(botAI, action));
|
||||
CombatStrategy::InitMultipliers(multipliers);
|
||||
}
|
||||
|
||||
void PossibleAddsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
Strategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("possible adds", NextAction::array(0, new NextAction("flee with pet", 60), nullptr)));
|
||||
}
|
||||
35
src/strategy/generic/PullStrategy.h
Normal file
35
src/strategy/generic/PullStrategy.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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_PULLSTRATEGY_H
|
||||
#define _PLAYERBOT_PULLSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class PullStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
PullStrategy(PlayerbotAI* botAI, std::string const action) : CombatStrategy(botAI), action(action) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "pull"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
|
||||
private:
|
||||
std::string const action;
|
||||
};
|
||||
|
||||
class PossibleAddsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
PossibleAddsStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "adds"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
44
src/strategy/generic/QuestStrategies.cpp
Normal file
44
src/strategy/generic/QuestStrategies.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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 "QuestStrategies.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
QuestStrategy::QuestStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
supported.push_back("accept quest");
|
||||
}
|
||||
|
||||
void QuestStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("quest share", NextAction::array(0, new NextAction("accept quest share", relevance), nullptr)));
|
||||
}
|
||||
|
||||
void DefaultQuestStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
QuestStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("use game object", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("gossip hello", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("complete quest", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
}
|
||||
|
||||
DefaultQuestStrategy::DefaultQuestStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI)
|
||||
{
|
||||
}
|
||||
|
||||
void AcceptAllQuestsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
QuestStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("use game object", NextAction::array(0, new NextAction("talk to quest giver", relevance), new NextAction("accept all quests", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("gossip hello", NextAction::array(0, new NextAction("talk to quest giver", relevance), new NextAction("accept all quests", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("complete quest", NextAction::array(0, new NextAction("talk to quest giver", relevance), new NextAction("accept all quests", relevance), nullptr)));
|
||||
}
|
||||
|
||||
AcceptAllQuestsStrategy::AcceptAllQuestsStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI)
|
||||
{
|
||||
}
|
||||
38
src/strategy/generic/QuestStrategies.h
Normal file
38
src/strategy/generic/QuestStrategies.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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_QUESTSTRATEGIES_H
|
||||
#define _PLAYERBOT_QUESTSTRATEGIES_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class QuestStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
QuestStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class DefaultQuestStrategy : public QuestStrategy
|
||||
{
|
||||
public:
|
||||
DefaultQuestStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "quest"; }
|
||||
};
|
||||
|
||||
class AcceptAllQuestsStrategy : public QuestStrategy
|
||||
{
|
||||
public:
|
||||
AcceptAllQuestsStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "accept all quests"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
14
src/strategy/generic/RTSCStrategy.cpp
Normal file
14
src/strategy/generic/RTSCStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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 "RTSCStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
RTSCStrategy::RTSCStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
|
||||
void RTSCStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
21
src/strategy/generic/RTSCStrategy.h
Normal file
21
src/strategy/generic/RTSCStrategy.h
Normal 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_RTSCSTRATEGY_H
|
||||
#define _PLAYERBOT_RTSCSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class RTSCStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RTSCStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "RTSC"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers);
|
||||
};
|
||||
|
||||
#endif
|
||||
38
src/strategy/generic/RacialsStrategy.cpp
Normal file
38
src/strategy/generic/RacialsStrategy.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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 "RacialsStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class RacialsStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
RacialsStrategyActionNodeFactory()
|
||||
{
|
||||
creators["lifeblood"] = &lifeblood;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* lifeblood(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("lifeblood",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("gift of the naaru"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
void RacialsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("lifeblood", 71.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("war stomp", 71.0f), nullptr)));
|
||||
/*triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("war stomp", 71.0f), nullptr)));*/
|
||||
/*triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("arcane torrent", ACTION_EMERGENCY + 6), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("mana tap", ACTION_EMERGENCY + 6), nullptr)));*/
|
||||
}
|
||||
|
||||
RacialsStrategy::RacialsStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new RacialsStrategyActionNodeFactory());
|
||||
}
|
||||
21
src/strategy/generic/RacialsStrategy.h
Normal file
21
src/strategy/generic/RacialsStrategy.h
Normal 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_RACIALSSTRATEGY_H
|
||||
#define _PLAYERBOT_RACIALSSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class RacialsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RacialsStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "racials"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
14
src/strategy/generic/RangedCombatStrategy.cpp
Normal file
14
src/strategy/generic/RangedCombatStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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 "RangedCombatStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void RangedCombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
//triggers.push_back(new TriggerNode("enemy too close for shoot", NextAction::array(0, new NextAction("flee", ACTION_HIGH), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", ACTION_HIGH), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/RangedCombatStrategy.h
Normal file
21
src/strategy/generic/RangedCombatStrategy.h
Normal 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_RANGEDCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_RANGEDCOMBATSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class RangedCombatStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
RangedCombatStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_RANGED; }
|
||||
std::string const getName() override { return "ranged"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
12
src/strategy/generic/ReturnStrategy.cpp
Normal file
12
src/strategy/generic/ReturnStrategy.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* 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 "ReturnStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void ReturnStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("return", NextAction::array(0, new NextAction("set return position", 1.5f), new NextAction("return", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
21
src/strategy/generic/ReturnStrategy.h
Normal file
21
src/strategy/generic/ReturnStrategy.h
Normal 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_RETURNSTRATEGY_H
|
||||
#define _PLAYERBOT_RETURNSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class ReturnStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
ReturnStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "return"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
64
src/strategy/generic/RpgStrategy.cpp
Normal file
64
src/strategy/generic/RpgStrategy.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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 "RpgStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
#include "RpgSubActions.h"
|
||||
|
||||
float RpgActionMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (action == nullptr)
|
||||
return 1.0f;
|
||||
|
||||
std::string const nextAction = AI_VALUE(std::string, "next rpg action");
|
||||
std::string const name = action->getName();
|
||||
|
||||
if (!nextAction.empty() && dynamic_cast<RpgEnabled*>(action) && name != nextAction)
|
||||
return 0.0f;
|
||||
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
RpgStrategy::RpgStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
|
||||
NextAction** RpgStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("rpg", 1.1f), nullptr);
|
||||
}
|
||||
|
||||
void RpgStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no rpg target", NextAction::array(0, new NextAction("choose rpg target", 5.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("far from rpg target", NextAction::array(0, new NextAction("move to rpg target", 5.0f), nullptr)));
|
||||
|
||||
//Sub actions
|
||||
triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg stay", 1.001f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg work", 1.001f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg emote", 1.001f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("has rpg target", NextAction::array(0, new NextAction("rpg cancel", 1.001f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg taxi", NextAction::array(0, new NextAction("rpg taxi", 1.005f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg discover", NextAction::array(0, new NextAction("rpg discover", 1.110f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg start quest", NextAction::array(0, new NextAction("rpg start quest", 1.080f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg end quest", NextAction::array(0, new NextAction("rpg end quest", 1.090f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg buy", NextAction::array(0, new NextAction("rpg buy", 1.030f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg sell", NextAction::array(0, new NextAction("rpg sell", 1.100f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg repair", NextAction::array(0, new NextAction("rpg repair", 1.095f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg train", NextAction::array(0, new NextAction("rpg train", 1.080f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg heal", NextAction::array(0, new NextAction("rpg heal", 1.025f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg home bind", NextAction::array(0, new NextAction("rpg home bind", 1.060f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg queue bg", NextAction::array(0, new NextAction("rpg queue bg", 1.085f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg buy petition", NextAction::array(0, new NextAction("rpg buy petition", 1.040f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg use", NextAction::array(0, new NextAction("rpg use", 1.002f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("rpg spell", NextAction::array(0, new NextAction("rpg spell", 1.001f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("rpg craft", NextAction::array(0, new NextAction("rpg craft", 1.001f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg trade useful", NextAction::array(0, new NextAction("rpg trade useful", 1.030f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg duel", NextAction::array(0, new NextAction("rpg duel", 1.010f), nullptr)));
|
||||
}
|
||||
|
||||
void RpgStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new RpgActionMultiplier(botAI));
|
||||
}
|
||||
31
src/strategy/generic/RpgStrategy.h
Normal file
31
src/strategy/generic/RpgStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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_RPGSTRATEGY_H
|
||||
#define _PLAYERBOT_RPGSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class RpgActionMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
RpgActionMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "rpg action") { }
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class RpgStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RpgStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "rpg"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
11
src/strategy/generic/RunawayStrategy.cpp
Normal file
11
src/strategy/generic/RunawayStrategy.cpp
Normal 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 "RunawayStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void RunawayStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("runaway", 50.0f), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/RunawayStrategy.h
Normal file
21
src/strategy/generic/RunawayStrategy.h
Normal 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_RUNAWAYSTRATEGY_H
|
||||
#define _PLAYERBOT_RUNAWAYSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class RunawayStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
RunawayStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "runaway"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
15
src/strategy/generic/SayStrategy.cpp
Normal file
15
src/strategy/generic/SayStrategy.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* 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 "SayStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void SayStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("say::critical health", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("say::low health", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("say::low mana", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("tank aoe", NextAction::array(0, new NextAction("say::taunt", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("say::aoe", 99.0f), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/SayStrategy.h
Normal file
21
src/strategy/generic/SayStrategy.h
Normal 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_SAYSTRATEGY_H
|
||||
#define _PLAYERBOT_SAYSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class SayStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
SayStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "say"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
16
src/strategy/generic/StayStrategy.cpp
Normal file
16
src/strategy/generic/StayStrategy.cpp
Normal 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 "StayStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** StayStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("stay", 1.0f), nullptr);
|
||||
}
|
||||
|
||||
void SitStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("sit", NextAction::array(0, new NextAction("sit", 1.5f), nullptr)));
|
||||
}
|
||||
30
src/strategy/generic/StayStrategy.h
Normal file
30
src/strategy/generic/StayStrategy.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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_STAYSTRATEGY_H
|
||||
#define _PLAYERBOT_STAYSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class StayStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
StayStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "stay"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
};
|
||||
|
||||
class SitStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
SitStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "sit"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
11
src/strategy/generic/TankAssistStrategy.cpp
Normal file
11
src/strategy/generic/TankAssistStrategy.cpp
Normal 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 "TankAssistStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void TankAssistStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("tank assist", NextAction::array(0, new NextAction("tank assist", 50.0f), nullptr)));
|
||||
}
|
||||
22
src/strategy/generic/TankAssistStrategy.h
Normal file
22
src/strategy/generic/TankAssistStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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_TANKASSISTSTRATEGY_H
|
||||
#define _PLAYERBOT_TANKASSISTSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class TankAssistStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
TankAssistStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "tank assist"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_TANK; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
11
src/strategy/generic/TellTargetStrategy.cpp
Normal file
11
src/strategy/generic/TellTargetStrategy.cpp
Normal 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 "TellTargetStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void TellTargetStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("target changed", NextAction::array(0, new NextAction("tell target", 51.0f), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/TellTargetStrategy.h
Normal file
21
src/strategy/generic/TellTargetStrategy.h
Normal 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_TELLTARGETSTRATEGY_H
|
||||
#define _PLAYERBOT_TELLTARGETSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class TellTargetStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
TellTargetStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "TellTarget"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
34
src/strategy/generic/ThreatStrategy.cpp
Normal file
34
src/strategy/generic/ThreatStrategy.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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 "ThreatStrategy.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
float ThreatMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (!action || action->getThreatType() == Action::ActionThreatType::None)
|
||||
return 1.0f;
|
||||
|
||||
if (!AI_VALUE(bool, "group"))
|
||||
return 1.0f;
|
||||
|
||||
if (action->getThreatType() == Action::ActionThreatType::Aoe)
|
||||
{
|
||||
uint8 threat = AI_VALUE2(uint8, "threat", "aoe");
|
||||
if (threat >= 50)
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
uint8 threat = AI_VALUE2(uint8, "threat", "current target");
|
||||
if (threat >= 80)
|
||||
return 0.0f;
|
||||
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void ThreatStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new ThreatMultiplier(botAI));
|
||||
}
|
||||
29
src/strategy/generic/ThreatStrategy.h
Normal file
29
src/strategy/generic/ThreatStrategy.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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_THREATSTRATEGY_H
|
||||
#define _PLAYERBOT_THREATSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class ThreatMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
ThreatMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "threat") { }
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class ThreatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ThreatStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "threat"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
21
src/strategy/generic/TravelStrategy.cpp
Normal file
21
src/strategy/generic/TravelStrategy.cpp
Normal 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.
|
||||
*/
|
||||
|
||||
#include "TravelStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
TravelStrategy::TravelStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
|
||||
NextAction** TravelStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("travel", 1.0f), nullptr);
|
||||
}
|
||||
|
||||
void TravelStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no travel target", NextAction::array(0, new NextAction("choose travel target", 6.f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("far from travel target", NextAction::array(0, new NextAction("move to travel target", 1), nullptr)));
|
||||
}
|
||||
47
src/strategy/generic/TravelStrategy.h
Normal file
47
src/strategy/generic/TravelStrategy.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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_TRAVELSTRATEGY_H
|
||||
#define _PLAYERBOT_TRAVELSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class TravelStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
TravelStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "travel"; }
|
||||
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*> &triggers) override;
|
||||
};
|
||||
|
||||
class ExploreStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ExploreStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
std::string const getName() override { return "explore"; }
|
||||
};
|
||||
|
||||
class MapStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MapStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
std::string const getName() override { return "map"; }
|
||||
};
|
||||
|
||||
class MapFullStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MapFullStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
std::string const getName() override { return "map full"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
14
src/strategy/generic/UseFoodStrategy.cpp
Normal file
14
src/strategy/generic/UseFoodStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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 "UseFoodStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void UseFoodStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
Strategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", 3.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("drink", 3.0f), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/UseFoodStrategy.h
Normal file
21
src/strategy/generic/UseFoodStrategy.h
Normal 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_USEFOODSTRATEGY_H
|
||||
#define _PLAYERBOT_USEFOODSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class UseFoodStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
UseFoodStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "food"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
36
src/strategy/generic/UsePotionsStrategy.cpp
Normal file
36
src/strategy/generic/UsePotionsStrategy.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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 "UsePotionsStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class UsePotionsStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
UsePotionsStrategyActionNodeFactory()
|
||||
{
|
||||
creators["healthstone"] = &healthstone;
|
||||
}
|
||||
private:
|
||||
static ActionNode* healthstone(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("healthstone",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("healing potion"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
UsePotionsStrategy::UsePotionsStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new UsePotionsStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void UsePotionsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
Strategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("healthstone", ACTION_MEDIUM_HEAL + 1), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("mana potion", ACTION_EMERGENCY), nullptr)));
|
||||
}
|
||||
21
src/strategy/generic/UsePotionsStrategy.h
Normal file
21
src/strategy/generic/UsePotionsStrategy.h
Normal 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_USEPOTIONSSTRATEGY_H
|
||||
#define _PLAYERBOT_USEPOTIONSSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class UsePotionsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
UsePotionsStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "potions"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
63
src/strategy/generic/WorldPacketHandlerStrategy.cpp
Normal file
63
src/strategy/generic/WorldPacketHandlerStrategy.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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 "WorldPacketHandlerStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void WorldPacketHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("group invite", NextAction::array(0, new NextAction("accept invitation", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("uninvite", NextAction::array(0, new NextAction("uninvite", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("uninvite guid", NextAction::array(0, new NextAction("uninvite", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("group set leader", NextAction::array(0, new NextAction("leader", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("not enough money", NextAction::array(0, new NextAction("tell not enough money", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("not enough reputation", NextAction::array(0, new NextAction("tell not enough reputation", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("cannot equip", NextAction::array(0, new NextAction("tell cannot equip", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("use game object", NextAction::array(0, new NextAction("add loot", relevance), new NextAction("use meeting stone", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("gossip hello", NextAction::array(0, new NextAction("trainer", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("activate taxi", NextAction::array(0, new NextAction("remember taxi", relevance), new NextAction("taxi", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("taxi done", NextAction::array(0, new NextAction("taxi", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("trade status", NextAction::array(0, new NextAction("accept trade", relevance), new NextAction("equip upgrades", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("area trigger", NextAction::array(0, new NextAction("reach area trigger", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("within area trigger", NextAction::array(0, new NextAction("area trigger", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("loot response", NextAction::array(0, new NextAction("store loot", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("item push result", NextAction::array(0, new NextAction("query item usage", relevance), new NextAction("equip upgrades", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("ready check finished", NextAction::array(0, new NextAction("finish ready check", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("security check", relevance), new NextAction("check mail", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("guild invite", NextAction::array(0, new NextAction("guild accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("petition offer", NextAction::array(0, new NextAction("petition sign", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("lfg proposal", NextAction::array(0, new NextAction("lfg accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("lfg proposal active", NextAction::array(0, new NextAction("lfg accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("arena team invite", NextAction::array(0, new NextAction("arena team accept", relevance), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("no non bot players around", NextAction::array(0, new NextAction("delay", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg status", NextAction::array(0, new NextAction("bg status", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("xpgain", NextAction::array(0, new NextAction("xp gain", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("levelup", NextAction::array(0, new NextAction("auto talents", relevance), new NextAction("auto learn spell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("see spell", NextAction::array(0, new NextAction("see spell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("release spirit", NextAction::array(0, new NextAction("release", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("revive from corpse", NextAction::array(0, new NextAction("revive from corpse", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("master loot roll", NextAction::array(0, new NextAction("master loot roll", relevance), nullptr)));
|
||||
}
|
||||
|
||||
WorldPacketHandlerStrategy::WorldPacketHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
supported.push_back("loot roll");
|
||||
supported.push_back("check mount state");
|
||||
supported.push_back("quest objective completed");
|
||||
supported.push_back("party command");
|
||||
supported.push_back("ready check");
|
||||
supported.push_back("uninvite");
|
||||
supported.push_back("lfg role check");
|
||||
supported.push_back("lfg teleport");
|
||||
supported.push_back("random bot update");
|
||||
supported.push_back("inventory change failure");
|
||||
supported.push_back("bg status");
|
||||
}
|
||||
|
||||
void ReadyCheckStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("ready check", relevance), nullptr)));
|
||||
}
|
||||
30
src/strategy/generic/WorldPacketHandlerStrategy.h
Normal file
30
src/strategy/generic/WorldPacketHandlerStrategy.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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_WORLDPACKETHANDLERSTRATEGY_H
|
||||
#define _PLAYERBOT_WORLDPACKETHANDLERSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class WorldPacketHandlerStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
WorldPacketHandlerStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "default"; }
|
||||
};
|
||||
|
||||
class ReadyCheckStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
ReadyCheckStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "ready check"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user