mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-25 06:26:24 +00:00
[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)
This commit is contained in:
14
src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.cpp
Normal file
14
src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("attack enemy player", 55.0f) }));
|
||||
}
|
||||
20
src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.h
Normal file
20
src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
87
src/Ai/Base/Strategy/BattlegroundStrategy.cpp
Normal file
87
src/Ai/Base/Strategy/BattlegroundStrategy.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("often", { NextAction("bg join", relevance)}));
|
||||
triggers.push_back(new TriggerNode("bg invite active", { NextAction("bg status check", relevance)}));
|
||||
triggers.push_back(new TriggerNode("timer", { NextAction("bg strategy check", relevance)}));
|
||||
}
|
||||
|
||||
BGStrategy::BGStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
void BattlegroundStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg waiting", { NextAction("bg move to start", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg move to objective", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg check objective", ACTION_BG + 1)}));
|
||||
triggers.push_back(new TriggerNode("dead", { NextAction("bg reset objective force", ACTION_EMERGENCY)}));
|
||||
}
|
||||
|
||||
void WarsongStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY )}));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near", { NextAction("attack enemy flag carrier", ACTION_RAID + 1.0f)}));
|
||||
triggers.push_back(new TriggerNode("team flagcarrier near", { NextAction("bg protect fc", ACTION_RAID)}));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("player has flag", { NextAction("bg move to objective", ACTION_EMERGENCY)}));
|
||||
triggers.push_back(new TriggerNode("timer bg", { NextAction("bg reset objective force", ACTION_EMERGENCY)}));
|
||||
}
|
||||
|
||||
void AlteracStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("alliance no snowfall gy", { NextAction("bg move to objective", ACTION_EMERGENCY)}));
|
||||
triggers.push_back(new TriggerNode("timer bg", { NextAction("bg reset objective force", ACTION_EMERGENCY)}));
|
||||
}
|
||||
|
||||
void ArathiStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY)}));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
}
|
||||
|
||||
void EyeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY)}));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near", { NextAction("attack enemy flag carrier", ACTION_RAID)}));
|
||||
triggers.push_back(new TriggerNode("player has flag",{ NextAction("bg move to objective", ACTION_EMERGENCY)}));
|
||||
}
|
||||
|
||||
//TODO: Do Priorities
|
||||
void IsleStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("timer", { NextAction("enter vehicle", ACTION_MOVE + 8.0f)}));
|
||||
triggers.push_back(new TriggerNode("random", { NextAction("leave vehicle", ACTION_MOVE + 7.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("hurl boulder", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("fire cannon", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("napalm", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("enemy is close", { NextAction("steam blast", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("ram", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("enemy is close", { NextAction("ram", ACTION_MOVE + 9.1f)}));
|
||||
triggers.push_back(new TriggerNode("enemy out of melee", { NextAction("steam rush", ACTION_MOVE + 9.2f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("incendiary rocket", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("rocket blast", ACTION_MOVE + 9.0f)}));
|
||||
// this is bugged: it doesn't work, and stops glaive throw working (which is needed to take down gate)
|
||||
// triggers.push_back(new TriggerNode("in vehicle", { NextAction("blade salvo", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("glaive throw", ACTION_MOVE + 9.0f)}));
|
||||
}
|
||||
|
||||
void ArenaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("no possible targets", { NextAction("arena tactics", ACTION_BG)}));
|
||||
}
|
||||
91
src/Ai/Base/Strategy/BattlegroundStrategy.h
Normal file
91
src/Ai/Base/Strategy/BattlegroundStrategy.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
69
src/Ai/Base/Strategy/CastTimeStrategy.cpp
Normal file
69
src/Ai/Base/Strategy/CastTimeStrategy.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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;
|
||||
|
||||
if (!action->GetTarget() || action->GetTarget() != AI_VALUE(Unit*, "current target"))
|
||||
return 1.0f;
|
||||
|
||||
if (/*targetHealth < sPlayerbotAIConfig->criticalHealth && */ dynamic_cast<CastSpellAction*>(action))
|
||||
{
|
||||
CastSpellAction* spellAction = dynamic_cast<CastSpellAction*>(action);
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", spellAction->getSpell());
|
||||
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(bot);
|
||||
|
||||
if (spellInfo->IsChanneled())
|
||||
{
|
||||
int32 duration = spellInfo->GetDuration();
|
||||
// bot->ApplySpellMod(spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||
duration = std::min(duration, 3000);
|
||||
if (duration > 0)
|
||||
castTime += duration;
|
||||
}
|
||||
|
||||
Unit* target = action->GetTarget();
|
||||
if (!target || !target->IsAlive() || !target->IsInWorld())
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
if (castTime > (1000 * target->GetHealth() / AI_VALUE(float, "estimated group dps")))
|
||||
{
|
||||
return 0.1f;
|
||||
}
|
||||
}
|
||||
// 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));
|
||||
}
|
||||
30
src/Ai/Base/Strategy/CastTimeStrategy.h
Normal file
30
src/Ai/Base/Strategy/CastTimeStrategy.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
193
src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp
Normal file
193
src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ { NextAction("attack my target", 100.0f) });
|
||||
}
|
||||
};
|
||||
|
||||
void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("rep", { NextAction("reputation", relevance) }));
|
||||
triggers.push_back(new TriggerNode("q", { NextAction("query quest", relevance),
|
||||
NextAction("query item usage", relevance) }));
|
||||
triggers.push_back(new TriggerNode("add all loot", { NextAction("add all loot", relevance),
|
||||
NextAction("loot", relevance) }));
|
||||
triggers.push_back(new TriggerNode("u", { NextAction("use", relevance) }));
|
||||
triggers.push_back(new TriggerNode("c", { NextAction("item count", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("items", { NextAction("item count", relevance) }));
|
||||
triggers.push_back(new TriggerNode("inv", { NextAction("item count", relevance) }));
|
||||
triggers.push_back(new TriggerNode("e", { NextAction("equip", relevance) }));
|
||||
triggers.push_back(new TriggerNode("ue", { NextAction("unequip", relevance) }));
|
||||
triggers.push_back(new TriggerNode("t", { NextAction("trade", relevance) }));
|
||||
triggers.push_back(new TriggerNode("nt", { NextAction("trade", relevance) }));
|
||||
triggers.push_back(new TriggerNode("s", { NextAction("sell", relevance) }));
|
||||
triggers.push_back(new TriggerNode("b", { NextAction("buy", relevance) }));
|
||||
triggers.push_back(new TriggerNode("r", { NextAction("reward", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("attack", { NextAction("attack my target", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("accept", { NextAction("accept quest", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("follow", { NextAction("follow chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("stay", { NextAction("stay chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("move from group", { NextAction("move from group chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("flee", { NextAction("flee chat shortcut", relevance) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"tank attack", { NextAction("tank attack chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("grind", { NextAction("grind chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("talk", { NextAction("gossip hello", relevance),
|
||||
NextAction("talk to quest giver", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("enter vehicle", { NextAction("enter vehicle", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("leave vehicle", { NextAction("leave vehicle", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("cast", { NextAction("cast custom spell", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("castnc", { NextAction("cast custom nc spell", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("revive", { NextAction("spirit healer", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("runaway", { NextAction("runaway chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("warning", { NextAction("runaway chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("max dps", { NextAction("max dps chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("attackers", { NextAction("tell attackers", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("target", { NextAction("tell target", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("ready", { NextAction("ready check", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bwl", { NextAction("bwl chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("dps", { NextAction("tell estimated dps", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("disperse", { NextAction("disperse set", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("open items", { NextAction("open items", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("qi", { NextAction("query item usage", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("unlock items", { NextAction("unlock items", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("unlock traded item", { NextAction("unlock traded item", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("wipe", { NextAction("wipe", relevance) }));
|
||||
triggers.push_back(new TriggerNode("tame", { NextAction("tame", relevance) }));
|
||||
triggers.push_back(new TriggerNode("glyphs", { NextAction("glyphs", relevance) })); // Added for custom Glyphs
|
||||
triggers.push_back(new TriggerNode("glyph equip", { NextAction("glyph equip", relevance) })); // Added for custom Glyphs
|
||||
triggers.push_back(new TriggerNode("pet", { NextAction("pet", relevance) }));
|
||||
triggers.push_back(new TriggerNode("pet attack", { NextAction("pet attack", relevance) }));
|
||||
triggers.push_back(new TriggerNode("roll", { NextAction("roll", relevance) }));
|
||||
}
|
||||
|
||||
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("rpg status");
|
||||
supported.push_back("rpg do quest");
|
||||
supported.push_back("aura");
|
||||
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("maintenance");
|
||||
supported.push_back("remove glyph");
|
||||
supported.push_back("autogear");
|
||||
supported.push_back("equip upgrade");
|
||||
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("lfg");
|
||||
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");
|
||||
supported.push_back("drink");
|
||||
supported.push_back("calc");
|
||||
supported.push_back("open items");
|
||||
supported.push_back("qi");
|
||||
supported.push_back("unlock items");
|
||||
supported.push_back("unlock traded item");
|
||||
supported.push_back("tame");
|
||||
supported.push_back("glyphs"); // Added for custom Glyphs
|
||||
supported.push_back("glyph equip"); // Added for custom Glyphs
|
||||
supported.push_back("pet");
|
||||
supported.push_back("pet attack");
|
||||
}
|
||||
22
src/Ai/Base/Strategy/ChatCommandHandlerStrategy.h
Normal file
22
src/Ai/Base/Strategy/ChatCommandHandlerStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
94
src/Ai/Base/Strategy/CombatStrategy.cpp
Normal file
94
src/Ai/Base/Strategy/CombatStrategy.cpp
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "Strategy.h"
|
||||
|
||||
void CombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of spell",
|
||||
{
|
||||
NextAction("reach spell", ACTION_HIGH)
|
||||
}
|
||||
)
|
||||
);
|
||||
// drop target relevance 99 (lower than Worldpacket triggers)
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"invalid target",
|
||||
{
|
||||
NextAction("drop target", 99)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"mounted",
|
||||
{
|
||||
NextAction("check mount state", 54)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"combat stuck",
|
||||
{
|
||||
NextAction("reset", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"not facing target",
|
||||
{
|
||||
NextAction("set facing", ACTION_MOVE + 7)
|
||||
}
|
||||
)
|
||||
);
|
||||
// The pet-attack trigger is commented out because it was forcing the bot's pet to attack, overriding stay and follow commands.
|
||||
// Pets will automatically attack the bot's enemy if they are in "defensive" or "aggressive"
|
||||
// stance, or if the master issues an attack command.
|
||||
}
|
||||
|
||||
AvoidAoeStrategy::AvoidAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::vector<NextAction> AvoidAoeStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("avoid aoe", ACTION_EMERGENCY)
|
||||
};
|
||||
}
|
||||
|
||||
void AvoidAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
void AvoidAoeStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
}
|
||||
|
||||
TankFaceStrategy::TankFaceStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::vector<NextAction> TankFaceStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("tank face", ACTION_MOVE)
|
||||
};
|
||||
}
|
||||
|
||||
void TankFaceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<NextAction> CombatFormationStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("combat formation move", ACTION_NORMAL)
|
||||
};
|
||||
}
|
||||
49
src/Ai/Base/Strategy/CombatStrategy.h
Normal file
49
src/Ai/Base/Strategy/CombatStrategy.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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; }
|
||||
};
|
||||
|
||||
class AvoidAoeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
explicit AvoidAoeStrategy(PlayerbotAI* ai);
|
||||
const std::string getName() override { return "avoid aoe"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class TankFaceStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
explicit TankFaceStrategy(PlayerbotAI* ai);
|
||||
const std::string getName() override { return "tank face"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class CombatFormationStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CombatFormationStrategy(PlayerbotAI* ai) : Strategy(ai) {}
|
||||
const std::string getName() override { return "formation"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
134
src/Ai/Base/Strategy/ConserveManaStrategy.cpp
Normal file
134
src/Ai/Base/Strategy/ConserveManaStrategy.cpp
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ConserveManaStrategy.h"
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "LastSpellCastValue.h"
|
||||
#include "PlayerbotAIConfig.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));
|
||||
// }
|
||||
|
||||
float HealerAutoSaveManaMultiplier::GetValue(Action* action)
|
||||
{
|
||||
uint8 mana = bot->GetPowerPct(Powers::POWER_MANA);
|
||||
if (mana > sPlayerbotAIConfig->saveManaThreshold)
|
||||
return 1.0f;
|
||||
CastHealingSpellAction* healingAction = dynamic_cast<CastHealingSpellAction*>(action);
|
||||
|
||||
if (!healingAction)
|
||||
return 1.0f;
|
||||
|
||||
Unit* target = healingAction->GetTarget();
|
||||
if (!target)
|
||||
return 1.0f;
|
||||
bool isTank = target->ToPlayer() ? botAI->IsTank(target->ToPlayer()) : false;
|
||||
uint8 health = target->GetHealthPct();
|
||||
HealingManaEfficiency manaEfficiency = healingAction->manaEfficiency;
|
||||
uint8 estAmount = healingAction->estAmount;
|
||||
uint8 lossAmount = 100 - health;
|
||||
if (isTank)
|
||||
{
|
||||
estAmount /= 1.5; // tanks have more health
|
||||
if (health >= sPlayerbotAIConfig->mediumHealth &&
|
||||
(lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::MEDIUM))
|
||||
return 0.0f;
|
||||
if (health >= sPlayerbotAIConfig->lowHealth &&
|
||||
(lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::LOW))
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (health >= sPlayerbotAIConfig->mediumHealth &&
|
||||
(lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::MEDIUM))
|
||||
return 0.0f;
|
||||
if (lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::LOW)
|
||||
return 0.0f;
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void HealerAutoSaveManaStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new HealerAutoSaveManaMultiplier(botAI));
|
||||
}
|
||||
30
src/Ai/Base/Strategy/ConserveManaStrategy.h
Normal file
30
src/Ai/Base/Strategy/ConserveManaStrategy.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_CONSERVEMANASTRATEGY_H
|
||||
#define _PLAYERBOT_CONSERVEMANASTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class HealerAutoSaveManaMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
HealerAutoSaveManaMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "save mana") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class HealerAutoSaveManaStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
HealerAutoSaveManaStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "save mana"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
32
src/Ai/Base/Strategy/DeadStrategy.cpp
Normal file
32
src/Ai/Base/Strategy/DeadStrategy.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("auto release", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg active", { NextAction("auto release", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("dead", { NextAction("find corpse", relevance) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"corpse near", { NextAction("revive from corpse", relevance - 1.0f) }));
|
||||
triggers.push_back(new TriggerNode("resurrect request",
|
||||
{ NextAction("accept resurrect", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("falling far", { NextAction("repop", relevance + 1.f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("location stuck", { NextAction("repop", relevance + 1) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"can self resurrect", { NextAction("self resurrect", relevance + 2.0f) }));
|
||||
}
|
||||
|
||||
DeadStrategy::DeadStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
22
src/Ai/Base/Strategy/DeadStrategy.h
Normal file
22
src/Ai/Base/Strategy/DeadStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
8
src/Ai/Base/Strategy/DebugStrategy.cpp
Normal file
8
src/Ai/Base/Strategy/DebugStrategy.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "DebugStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
56
src/Ai/Base/Strategy/DebugStrategy.h
Normal file
56
src/Ai/Base/Strategy/DebugStrategy.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
};
|
||||
|
||||
class DebugQuestStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugQuestStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT | STRATEGY_TYPE_COMBAT; }
|
||||
std::string const getName() override { return "debug quest"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
20
src/Ai/Base/Strategy/DpsAssistStrategy.cpp
Normal file
20
src/Ai/Base/Strategy/DpsAssistStrategy.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("dps assist", 50.0f) }));
|
||||
}
|
||||
|
||||
void DpsAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("not dps aoe target active", { NextAction("dps aoe", 50.0f) }));
|
||||
}
|
||||
32
src/Ai/Base/Strategy/DpsAssistStrategy.h
Normal file
32
src/Ai/Base/Strategy/DpsAssistStrategy.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
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
|
||||
24
src/Ai/Base/Strategy/DuelStrategy.cpp
Normal file
24
src/Ai/Base/Strategy/DuelStrategy.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("accept duel", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("no attackers", { NextAction("attack duel opponent", 70.0f) }));
|
||||
}
|
||||
|
||||
DuelStrategy::DuelStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
void StartDuelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||
|
||||
StartDuelStrategy::StartDuelStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
31
src/Ai/Base/Strategy/DuelStrategy.h
Normal file
31
src/Ai/Base/Strategy/DuelStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
35
src/Ai/Base/Strategy/EmoteStrategy.cpp
Normal file
35
src/Ai/Base/Strategy/EmoteStrategy.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "EmoteStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void EmoteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
if (sPlayerbotAIConfig->randomBotEmote)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("talk", 1.0f) }));
|
||||
triggers.push_back(new TriggerNode("seldom", { NextAction("emote", 1.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("receive text emote", { NextAction("emote", 10.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("receive emote", { NextAction("emote", 10.0f) }));
|
||||
}
|
||||
|
||||
if (sPlayerbotAIConfig->randomBotTalk)
|
||||
{
|
||||
triggers.push_back(new TriggerNode(
|
||||
"often",
|
||||
{ NextAction("suggest what to do", 10.0f), NextAction("suggest dungeon", 3.0f),
|
||||
NextAction("suggest trade", 3.0f) }));
|
||||
}
|
||||
|
||||
if (sPlayerbotAIConfig->enableGreet)
|
||||
triggers.push_back(
|
||||
new TriggerNode("new player nearby", { NextAction("greet", 1.0f) }));
|
||||
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("rpg mount anim", 1.0f) }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/EmoteStrategy.h
Normal file
22
src/Ai/Base/Strategy/EmoteStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
24
src/Ai/Base/Strategy/FleeStrategy.cpp
Normal file
24
src/Ai/Base/Strategy/FleeStrategy.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("flee", ACTION_EMERGENCY + 9) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("outnumbered", { NextAction("flee", ACTION_EMERGENCY + 9) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("critical health", { NextAction("flee", ACTION_MEDIUM_HEAL) }));
|
||||
}
|
||||
|
||||
void FleeFromAddsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("has nearest adds", { NextAction("runaway", 50.0f) }));
|
||||
}
|
||||
31
src/Ai/Base/Strategy/FleeStrategy.h
Normal file
31
src/Ai/Base/Strategy/FleeStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
19
src/Ai/Base/Strategy/FollowMasterStrategy.cpp
Normal file
19
src/Ai/Base/Strategy/FollowMasterStrategy.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "FollowMasterStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> FollowMasterStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("follow", 1.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void FollowMasterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
23
src/Ai/Base/Strategy/FollowMasterStrategy.h
Normal file
23
src/Ai/Base/Strategy/FollowMasterStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
41
src/Ai/Base/Strategy/GrindingStrategy.cpp
Normal file
41
src/Ai/Base/Strategy/GrindingStrategy.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GrindingStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> GrindingStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("drink", 4.2f),
|
||||
NextAction("food", 4.1f),
|
||||
};
|
||||
}
|
||||
|
||||
void GrindingStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
// reduce lower than loot
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"no target",
|
||||
{
|
||||
NextAction("attack anything", 4.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void MoveRandomStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"often",
|
||||
{
|
||||
NextAction("move random", 1.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
31
src/Ai/Base/Strategy/GrindingStrategy.h
Normal file
31
src/Ai/Base/Strategy/GrindingStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class MoveRandomStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
MoveRandomStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
std::string const getName() override { return "move random"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
#endif
|
||||
16
src/Ai/Base/Strategy/GroupStrategy.cpp
Normal file
16
src/Ai/Base/Strategy/GroupStrategy.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("invite nearby", 4.0f) }));
|
||||
triggers.push_back(new TriggerNode("random", { NextAction("invite guild", 4.0f) }));
|
||||
triggers.push_back(new TriggerNode("random", { NextAction("leave far away", 4.0f) }));
|
||||
triggers.push_back(new TriggerNode("seldom", { NextAction("reset instances", 1.0f) }));
|
||||
}
|
||||
23
src/Ai/Base/Strategy/GroupStrategy.h
Normal file
23
src/Ai/Base/Strategy/GroupStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
17
src/Ai/Base/Strategy/GuardStrategy.cpp
Normal file
17
src/Ai/Base/Strategy/GuardStrategy.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GuardStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> GuardStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("guard", 4.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void GuardStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||
23
src/Ai/Base/Strategy/GuardStrategy.h
Normal file
23
src/Ai/Base/Strategy/GuardStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
22
src/Ai/Base/Strategy/GuildStrategy.cpp
Normal file
22
src/Ai/Base/Strategy/GuildStrategy.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("offer petition nearby", 4.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", { NextAction("guild manage nearby", 4.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("petition signed", { NextAction("turn in petition", 10.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("buy tabard", { NextAction("buy tabard", 10.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("leave large guild", { NextAction("guild leave", 4.0f) }));
|
||||
}
|
||||
23
src/Ai/Base/Strategy/GuildStrategy.h
Normal file
23
src/Ai/Base/Strategy/GuildStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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/Ai/Base/Strategy/KiteStrategy.cpp
Normal file
15
src/Ai/Base/Strategy/KiteStrategy.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("runaway", 51.0f) }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/KiteStrategy.h
Normal file
22
src/Ai/Base/Strategy/KiteStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
19
src/Ai/Base/Strategy/LfgStrategy.cpp
Normal file
19
src/Ai/Base/Strategy/LfgStrategy.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("lfg join", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("seldom", { NextAction("lfg leave", relevance) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"unknown dungeon", { NextAction("give leader in dungeon", relevance) }));
|
||||
}
|
||||
|
||||
LfgStrategy::LfgStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
21
src/Ai/Base/Strategy/LfgStrategy.h
Normal file
21
src/Ai/Base/Strategy/LfgStrategy.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
37
src/Ai/Base/Strategy/LootNonCombatStrategy.cpp
Normal file
37
src/Ai/Base/Strategy/LootNonCombatStrategy.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("loot", 6.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("far from loot target", { NextAction("move to loot", 7.0f) }));
|
||||
triggers.push_back(new TriggerNode("can loot", { NextAction("open loot", 8.0f) }));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("add all loot", 5.0f) }));
|
||||
}
|
||||
|
||||
void GatherStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("timer", { NextAction("add gathering loot", 5.0f) }));
|
||||
}
|
||||
|
||||
void RevealStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", { NextAction("reveal gathering item", 50.0f) }));
|
||||
}
|
||||
|
||||
void UseBobberStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("can use fishing bobber", { NextAction("use fishing bobber", 20.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("random", { NextAction("remove bobber strategy", 20.0f) }));
|
||||
}
|
||||
49
src/Ai/Base/Strategy/LootNonCombatStrategy.h
Normal file
49
src/Ai/Base/Strategy/LootNonCombatStrategy.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
};
|
||||
|
||||
class UseBobberStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
UseBobberStrategy(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 "use bobber";}
|
||||
};
|
||||
|
||||
#endif
|
||||
78
src/Ai/Base/Strategy/MaintenanceStrategy.cpp
Normal file
78
src/Ai/Base/Strategy/MaintenanceStrategy.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "MaintenanceStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> MaintenanceStrategy::getDefaultActions() { return {}; }
|
||||
|
||||
void MaintenanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("clean quest log", 6.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("use random recipe", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("disenchant random item", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("enchant random item", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("smart destroy item", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"move stuck",
|
||||
{
|
||||
NextAction("reset", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("use random quest item", 0.9f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("auto share quest", 0.9f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
24
src/Ai/Base/Strategy/MaintenanceStrategy.h
Normal file
24
src/Ai/Base/Strategy/MaintenanceStrategy.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
14
src/Ai/Base/Strategy/MarkRtiStrategy.cpp
Normal file
14
src/Ai/Base/Strategy/MarkRtiStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("mark rti", ACTION_NORMAL) }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/MarkRtiStrategy.h
Normal file
22
src/Ai/Base/Strategy/MarkRtiStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
24
src/Ai/Base/Strategy/MeleeCombatStrategy.cpp
Normal file
24
src/Ai/Base/Strategy/MeleeCombatStrategy.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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(
|
||||
"enemy out of melee", { NextAction("reach melee", ACTION_HIGH + 1) }));
|
||||
}
|
||||
|
||||
void SetBehindCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("not behind target",
|
||||
{ NextAction("set behind", ACTION_MOVE + 7) }));
|
||||
}
|
||||
32
src/Ai/Base/Strategy/MeleeCombatStrategy.h
Normal file
32
src/Ai/Base/Strategy/MeleeCombatStrategy.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
20
src/Ai/Base/Strategy/MoveFromGroupStrategy.cpp
Normal file
20
src/Ai/Base/Strategy/MoveFromGroupStrategy.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "MoveFromGroupStrategy.h"
|
||||
#include "PassiveMultiplier.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> MoveFromGroupStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("move from group", 1.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void MoveFromGroupStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new PassiveMultiplier(botAI));
|
||||
}
|
||||
23
src/Ai/Base/Strategy/MoveFromGroupStrategy.h
Normal file
23
src/Ai/Base/Strategy/MoveFromGroupStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_MOVEFROMGROUPSTRATEGY_H
|
||||
#define _PLAYERBOT_MOVEFROMGROUPSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MoveFromGroupStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MoveFromGroupStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "move from group"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
65
src/Ai/Base/Strategy/NonCombatStrategy.cpp
Normal file
65
src/Ai/Base/Strategy/NonCombatStrategy.cpp
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("random", { NextAction("clean quest log", 1.0f) }));
|
||||
triggers.push_back(new TriggerNode("timer", { NextAction("check mount state", 1.0f) }));
|
||||
}
|
||||
|
||||
void CollisionStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("collision", { NextAction("move out of collision", 2.0f) }));
|
||||
}
|
||||
|
||||
void MountStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
void WorldBuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"need world buff",
|
||||
{
|
||||
NextAction("world buff", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void MasterFishingStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"very often",
|
||||
{
|
||||
NextAction("move near water" , 10.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"very often",
|
||||
{
|
||||
NextAction("go fishing" , 10.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("end master fishing", 12.0f),
|
||||
NextAction("equip upgrades", 6.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
69
src/Ai/Base/Strategy/NonCombatStrategy.h
Normal file
69
src/Ai/Base/Strategy/NonCombatStrategy.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
};
|
||||
|
||||
class WorldBuffStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
WorldBuffStrategy(PlayerbotAI* ai) : Strategy(ai) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "worldbuff"; }
|
||||
};
|
||||
|
||||
class MasterFishingStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MasterFishingStrategy(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 "master fishing";}
|
||||
};
|
||||
#endif
|
||||
15
src/Ai/Base/Strategy/PassTroughStrategy.cpp
Normal file
15
src/Ai/Base/Strategy/PassTroughStrategy.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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(i->c_str(), relevance) }));
|
||||
}
|
||||
25
src/Ai/Base/Strategy/PassTroughStrategy.h
Normal file
25
src/Ai/Base/Strategy/PassTroughStrategy.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
14
src/Ai/Base/Strategy/PassiveStrategy.cpp
Normal file
14
src/Ai/Base/Strategy/PassiveStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/PassiveStrategy.h
Normal file
22
src/Ai/Base/Strategy/PassiveStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
63
src/Ai/Base/Strategy/PullStrategy.cpp
Normal file
63
src/Ai/Base/Strategy/PullStrategy.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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);
|
||||
}
|
||||
|
||||
std::vector<NextAction> PullStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction(action, 105.0f),
|
||||
NextAction("follow", 104.0f),
|
||||
NextAction("end pull", 103.0f),
|
||||
};
|
||||
}
|
||||
|
||||
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("flee with pet", 60)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
36
src/Ai/Base/Strategy/PullStrategy.h
Normal file
36
src/Ai/Base/Strategy/PullStrategy.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
std::vector<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
|
||||
49
src/Ai/Base/Strategy/QuestStrategies.cpp
Normal file
49
src/Ai/Base/Strategy/QuestStrategies.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("accept quest share", relevance) }));
|
||||
}
|
||||
|
||||
void DefaultQuestStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
QuestStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"use game object", { NextAction("talk to quest giver", relevance) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"gossip hello", { NextAction("talk to quest giver", relevance) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"complete quest", { NextAction("talk to quest giver", relevance) }));
|
||||
}
|
||||
|
||||
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("talk to quest giver", relevance),
|
||||
NextAction("accept all quests", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("gossip hello", { NextAction("talk to quest giver", relevance),
|
||||
NextAction("accept all quests", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("complete quest", { NextAction("talk to quest giver", relevance),
|
||||
NextAction("accept all quests", relevance) }));
|
||||
}
|
||||
|
||||
AcceptAllQuestsStrategy::AcceptAllQuestsStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI) {}
|
||||
39
src/Ai/Base/Strategy/QuestStrategies.h
Normal file
39
src/Ai/Base/Strategy/QuestStrategies.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
12
src/Ai/Base/Strategy/RTSCStrategy.cpp
Normal file
12
src/Ai/Base/Strategy/RTSCStrategy.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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) {}
|
||||
22
src/Ai/Base/Strategy/RTSCStrategy.h
Normal file
22
src/Ai/Base/Strategy/RTSCStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
44
src/Ai/Base/Strategy/RacialsStrategy.cpp
Normal file
44
src/Ai/Base/Strategy/RacialsStrategy.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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*/ {},
|
||||
/*A*/ { NextAction("gift of the naaru") },
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
void RacialsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", { NextAction("lifeblood", ACTION_NORMAL + 5) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("medium aoe", { NextAction("war stomp", ACTION_NORMAL + 5) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"low mana", { NextAction("arcane torrent", ACTION_NORMAL + 5) }));
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"generic boost", { NextAction("blood fury", ACTION_NORMAL + 5),
|
||||
NextAction("berserking", ACTION_NORMAL + 5),
|
||||
NextAction("use trinket", ACTION_NORMAL + 4) }));
|
||||
|
||||
}
|
||||
|
||||
RacialsStrategy::RacialsStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new RacialsStrategyActionNodeFactory());
|
||||
}
|
||||
22
src/Ai/Base/Strategy/RacialsStrategy.h
Normal file
22
src/Ai/Base/Strategy/RacialsStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
16
src/Ai/Base/Strategy/RangedCombatStrategy.cpp
Normal file
16
src/Ai/Base/Strategy/RangedCombatStrategy.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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 spell",
|
||||
{ NextAction("flee", ACTION_MOVE + 4) }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/RangedCombatStrategy.h
Normal file
22
src/Ai/Base/Strategy/RangedCombatStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
14
src/Ai/Base/Strategy/ReturnStrategy.cpp
Normal file
14
src/Ai/Base/Strategy/ReturnStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("set return position", 1.5f),
|
||||
NextAction("return", 1.0f), }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/ReturnStrategy.h
Normal file
22
src/Ai/Base/Strategy/ReturnStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
171
src/Ai/Base/Strategy/RpgStrategy.cpp
Normal file
171
src/Ai/Base/Strategy/RpgStrategy.cpp
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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) {}
|
||||
|
||||
std::vector<NextAction> RpgStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("rpg", 1.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void RpgStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"no rpg target",
|
||||
{
|
||||
NextAction("choose rpg target", 5.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"often",
|
||||
{
|
||||
NextAction("move random", 1.10f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"far from rpg target",
|
||||
{
|
||||
NextAction("move to rpg target", 5.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
// Sub actions
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg",
|
||||
{
|
||||
NextAction("rpg stay", 1.101f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg",
|
||||
{
|
||||
NextAction("rpg work", 1.101f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg",
|
||||
{
|
||||
NextAction("rpg emote", 1.101f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"has rpg target",
|
||||
{
|
||||
NextAction("rpg cancel", 1.101f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg discover",
|
||||
{
|
||||
NextAction("rpg discover", 1.210f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg start quest",
|
||||
{
|
||||
NextAction("rpg start quest", 1.180f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg end quest",
|
||||
{
|
||||
NextAction("rpg end quest", 1.190f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg buy",
|
||||
{
|
||||
NextAction("rpg buy", 1.130f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg repair",
|
||||
{
|
||||
NextAction("rpg repair", 1.195f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg heal",
|
||||
{
|
||||
NextAction("rpg heal", 1.125f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg home bind",
|
||||
{
|
||||
NextAction("rpg home bind", 1.160f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg buy petition",
|
||||
{
|
||||
NextAction("rpg buy petition", 1.140f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rpg use",
|
||||
{
|
||||
NextAction("rpg use", 1.102f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void RpgStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new RpgActionMultiplier(botAI));
|
||||
}
|
||||
32
src/Ai/Base/Strategy/RpgStrategy.h
Normal file
32
src/Ai/Base/Strategy/RpgStrategy.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
14
src/Ai/Base/Strategy/RunawayStrategy.cpp
Normal file
14
src/Ai/Base/Strategy/RunawayStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("runaway", 50.0f) }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/RunawayStrategy.h
Normal file
22
src/Ai/Base/Strategy/RunawayStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
20
src/Ai/Base/Strategy/SayStrategy.cpp
Normal file
20
src/Ai/Base/Strategy/SayStrategy.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("say::critical health", 99.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", { NextAction("say::low health", 99.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low mana", { NextAction("say::low mana", 99.0f) }));
|
||||
triggers.push_back(new TriggerNode("tank aoe", { NextAction("say::taunt", 99.0f) }));
|
||||
triggers.push_back(new TriggerNode("medium aoe", { NextAction("say::aoe", 99.0f) }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/SayStrategy.h
Normal file
22
src/Ai/Base/Strategy/SayStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
39
src/Ai/Base/Strategy/StayStrategy.cpp
Normal file
39
src/Ai/Base/Strategy/StayStrategy.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "StayStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void StayStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"return to stay position",
|
||||
{
|
||||
NextAction("return to stay position", ACTION_MOVE)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
std::vector<NextAction> StayStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("stay", 1.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void SitStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"sit",
|
||||
{
|
||||
NextAction("sit", 1.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
32
src/Ai/Base/Strategy/StayStrategy.h
Normal file
32
src/Ai/Base/Strategy/StayStrategy.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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 Strategy
|
||||
{
|
||||
public:
|
||||
StayStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "stay"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::vector<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
|
||||
14
src/Ai/Base/Strategy/TankAssistStrategy.cpp
Normal file
14
src/Ai/Base/Strategy/TankAssistStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("tank assist", 50.0f) }));
|
||||
}
|
||||
23
src/Ai/Base/Strategy/TankAssistStrategy.h
Normal file
23
src/Ai/Base/Strategy/TankAssistStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
14
src/Ai/Base/Strategy/TellTargetStrategy.cpp
Normal file
14
src/Ai/Base/Strategy/TellTargetStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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("tell target", 51.0f) }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/TellTargetStrategy.h
Normal file
22
src/Ai/Base/Strategy/TellTargetStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
64
src/Ai/Base/Strategy/ThreatStrategy.cpp
Normal file
64
src/Ai/Base/Strategy/ThreatStrategy.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ThreatStrategy.h"
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "Map.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
float ThreatMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (AI_VALUE(bool, "neglect threat"))
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
float FocusMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (!action)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
if (action->getThreatType() == Action::ActionThreatType::Aoe && !dynamic_cast<CastHealingSpellAction*>(action))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
if (dynamic_cast<CastDebuffSpellOnAttackerAction*>(action))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void FocusStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new FocusMultiplier(botAI));
|
||||
}
|
||||
47
src/Ai/Base/Strategy/ThreatStrategy.h
Normal file
47
src/Ai/Base/Strategy/ThreatStrategy.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
};
|
||||
|
||||
class FocusMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
FocusMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "focus") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class FocusStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
FocusStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "focus"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
37
src/Ai/Base/Strategy/TravelStrategy.cpp
Normal file
37
src/Ai/Base/Strategy/TravelStrategy.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "TravelStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
TravelStrategy::TravelStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::vector<NextAction> TravelStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("travel", 1.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void TravelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"no travel target",
|
||||
{
|
||||
NextAction("choose travel target", 6.f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"far from travel target",
|
||||
{
|
||||
NextAction("move to travel target", 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
48
src/Ai/Base/Strategy/TravelStrategy.h
Normal file
48
src/Ai/Base/Strategy/TravelStrategy.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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"; }
|
||||
|
||||
std::vector<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
|
||||
24
src/Ai/Base/Strategy/UseFoodStrategy.cpp
Normal file
24
src/Ai/Base/Strategy/UseFoodStrategy.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "UseFoodStrategy.h"
|
||||
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void UseFoodStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
Strategy::InitTriggers(triggers);
|
||||
if (botAI->HasCheat(BotCheatMask::food))
|
||||
{
|
||||
triggers.push_back(new TriggerNode("medium health", { NextAction("food", 3.0f) }));
|
||||
triggers.push_back(new TriggerNode("high mana", { NextAction("drink", 3.0f) }));
|
||||
}
|
||||
else
|
||||
{
|
||||
triggers.push_back(new TriggerNode("low health", { NextAction("food", 3.0f) }));
|
||||
triggers.push_back(new TriggerNode("low mana", { NextAction("drink", 3.0f) }));
|
||||
}
|
||||
}
|
||||
22
src/Ai/Base/Strategy/UseFoodStrategy.h
Normal file
22
src/Ai/Base/Strategy/UseFoodStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
38
src/Ai/Base/Strategy/UsePotionsStrategy.cpp
Normal file
38
src/Ai/Base/Strategy/UsePotionsStrategy.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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*/ {},
|
||||
/*A*/ { NextAction("healing potion") },
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
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("healthstone", ACTION_MEDIUM_HEAL + 1) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low mana", { NextAction("mana potion", ACTION_EMERGENCY) }));
|
||||
}
|
||||
22
src/Ai/Base/Strategy/UsePotionsStrategy.h
Normal file
22
src/Ai/Base/Strategy/UsePotionsStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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
|
||||
99
src/Ai/Base/Strategy/WorldPacketHandlerStrategy.cpp
Normal file
99
src/Ai/Base/Strategy/WorldPacketHandlerStrategy.cpp
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "WorldPacketHandlerStrategy.h"
|
||||
|
||||
void WorldPacketHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("group invite", { NextAction("accept invitation", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("uninvite", { NextAction("uninvite", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("uninvite guid", { NextAction("uninvite", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("group set leader", { /*NextAction("leader", relevance),*/ }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"not enough money", { NextAction("tell not enough money", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("not enough reputation",
|
||||
{ NextAction("tell not enough reputation", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("cannot equip", { NextAction("tell cannot equip", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("use game object", { NextAction("add loot", relevance),
|
||||
NextAction("use meeting stone", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("gossip hello", { NextAction("trainer", relevance) }));
|
||||
triggers.push_back(new TriggerNode("activate taxi", { NextAction("remember taxi", relevance),
|
||||
NextAction("taxi", relevance) }));
|
||||
triggers.push_back(new TriggerNode("taxi done", { NextAction("taxi", relevance) }));
|
||||
triggers.push_back(new TriggerNode("trade status", { NextAction("accept trade", relevance), NextAction("equip upgrades", relevance) }));
|
||||
triggers.push_back(new TriggerNode("trade status extended", { NextAction("trade status extended", relevance) }));
|
||||
triggers.push_back(new TriggerNode("area trigger", { NextAction("reach area trigger", relevance) }));
|
||||
triggers.push_back(new TriggerNode("within area trigger", { NextAction("area trigger", relevance) }));
|
||||
triggers.push_back(new TriggerNode("loot response", { NextAction("store loot", relevance) }));
|
||||
triggers.push_back(new TriggerNode("item push result", { NextAction("unlock items", relevance),
|
||||
NextAction("open items", relevance),
|
||||
NextAction("query item usage", relevance),
|
||||
NextAction("equip upgrades", relevance) }));
|
||||
triggers.push_back(new TriggerNode("item push result", { NextAction("quest item push result", relevance) }));
|
||||
triggers.push_back(new TriggerNode("ready check finished", { NextAction("finish ready check", relevance) }));
|
||||
// triggers.push_back(new TriggerNode("often", { NextAction("security check", relevance), NextAction("check mail", relevance) }));
|
||||
triggers.push_back(new TriggerNode("guild invite", { NextAction("guild accept", relevance) }));
|
||||
triggers.push_back(new TriggerNode("petition offer", { NextAction("petition sign", relevance) }));
|
||||
triggers.push_back(new TriggerNode("lfg proposal", { NextAction("lfg accept", relevance) }));
|
||||
triggers.push_back(new TriggerNode("lfg proposal active", { NextAction("lfg accept", relevance) }));
|
||||
triggers.push_back(new TriggerNode("arena team invite", { NextAction("arena team accept", relevance) }));
|
||||
//triggers.push_back(new TriggerNode("no non bot players around", { NextAction("delay", relevance) }));
|
||||
triggers.push_back(new TriggerNode("bg status", { NextAction("bg status", relevance) }));
|
||||
triggers.push_back(new TriggerNode("xpgain", { NextAction("xp gain", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("levelup", { NextAction("auto maintenance on levelup", relevance + 3) }));
|
||||
// triggers.push_back(new TriggerNode("group destroyed", { NextAction("reset botAI",
|
||||
// relevance) }));
|
||||
triggers.push_back(new TriggerNode("group list", { NextAction("reset botAI", relevance) }));
|
||||
triggers.push_back(new TriggerNode("see spell", { NextAction("see spell", relevance) }));
|
||||
triggers.push_back(new TriggerNode("release spirit", { NextAction("release", relevance) }));
|
||||
triggers.push_back(new TriggerNode("revive from corpse", { NextAction("revive from corpse", relevance) }));
|
||||
triggers.push_back(new TriggerNode("master loot roll", { NextAction("master loot roll", relevance) }));
|
||||
|
||||
// quest ?
|
||||
//triggers.push_back(new TriggerNode("quest confirm", { NextAction("quest confirm", relevance) }));
|
||||
triggers.push_back(new TriggerNode("questgiver quest details", { NextAction("turn in query quest", relevance) }));
|
||||
|
||||
// loot roll
|
||||
triggers.push_back(new TriggerNode("very often", { NextAction("loot roll", relevance) }));
|
||||
}
|
||||
|
||||
WorldPacketHandlerStrategy::WorldPacketHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
supported.push_back("loot roll");
|
||||
supported.push_back("check mount state");
|
||||
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");
|
||||
|
||||
// quests
|
||||
supported.push_back("quest update add kill");
|
||||
// supported.push_back("quest update add item");
|
||||
supported.push_back("quest update failed");
|
||||
supported.push_back("quest update failed timer");
|
||||
supported.push_back("quest update complete");
|
||||
supported.push_back("confirm quest");
|
||||
}
|
||||
|
||||
void ReadyCheckStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("timer", { NextAction("ready check", relevance) }));
|
||||
}
|
||||
31
src/Ai/Base/Strategy/WorldPacketHandlerStrategy.h
Normal file
31
src/Ai/Base/Strategy/WorldPacketHandlerStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 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