mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-18 19:25:44 +00:00
Run clang-format
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "AttackEnemyPlayersStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void AttackEnemyPlayersStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("enemy player near", NextAction::array(0, new NextAction("attack enemy player", 55.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy player near",
|
||||
NextAction::array(0, new NextAction("attack enemy player", 55.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_ATTACKENEMYPAYERSSTRATEGYACTION_H
|
||||
@@ -9,11 +10,11 @@
|
||||
|
||||
class AttackEnemyPlayersStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
AttackEnemyPlayersStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
AttackEnemyPlayersStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "pvp"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "pvp"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,83 +1,112 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "BattlegroundStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void BGStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void BGStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg join", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg invite active", NextAction::array(0, new NextAction("bg status check", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("bg strategy check", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg invite active",
|
||||
NextAction::array(0, new NextAction("bg status check", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("timer", NextAction::array(0, new NextAction("bg strategy check", relevance), nullptr)));
|
||||
}
|
||||
|
||||
BGStrategy::BGStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
}
|
||||
BGStrategy::BGStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
void WarsongStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void WarsongStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("player has flag",
|
||||
NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
}
|
||||
|
||||
void AlteracStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
/* placeholder */
|
||||
void AlteracStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{ /* placeholder */
|
||||
}
|
||||
|
||||
void ArathiStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void ArathiStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
}
|
||||
|
||||
void BattlegroundStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void BattlegroundStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg waiting", NextAction::array(0, new NextAction("bg move to start", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg move to objective", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg check objective", 10.0f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", 80.0f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("team flagcarrier near", NextAction::array(0, new NextAction("bg protect fc", 40.0f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg waiting", NextAction::array(0, new NextAction("bg move to start", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg active", NextAction::array(0, new NextAction("bg move to objective", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", NextAction::array(0, new NextAction("bg check objective", 10.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy
|
||||
// flag carrier", 80.0f), nullptr))); triggers.push_back(new TriggerNode("team flagcarrier near",
|
||||
// NextAction::array(0, new NextAction("bg protect fc", 40.0f), nullptr))); triggers.push_back(new
|
||||
// TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
}
|
||||
|
||||
void EyeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("player has flag",
|
||||
NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr)));
|
||||
}
|
||||
|
||||
void IsleStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("enter vehicle", 85.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("leave vehicle", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("hurl boulder", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("fire cannon", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("random", NextAction::array(0, new NextAction("leave vehicle", 80.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("in vehicle", NextAction::array(0, new NextAction("hurl boulder", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("in vehicle", NextAction::array(0, new NextAction("fire cannon", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("napalm", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("steam blast", 80.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("enemy is close", NextAction::array(0, new NextAction("steam blast", 80.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("ram", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("ram", 79.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("steam rush", 81.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("incendiary rocket", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("rocket blast", 70.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("blade salvo", 71.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("glaive throw", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("steam rush", 81.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("in vehicle", NextAction::array(0, new NextAction("incendiary rocket", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("in vehicle", NextAction::array(0, new NextAction("rocket blast", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("in vehicle", NextAction::array(0, new NextAction("blade salvo", 71.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("in vehicle", NextAction::array(0, new NextAction("glaive throw", 70.0f), nullptr)));
|
||||
}
|
||||
|
||||
void ArenaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no possible targets", NextAction::array(0, new NextAction("arena tactics", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("no possible targets", NextAction::array(0, new NextAction("arena tactics", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_BATTLEGROUNDSTRATEGY_H
|
||||
@@ -9,82 +10,82 @@
|
||||
|
||||
class BGStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
BGStrategy(PlayerbotAI* botAI);
|
||||
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"; }
|
||||
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) { };
|
||||
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"; }
|
||||
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) { };
|
||||
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"; }
|
||||
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) { };
|
||||
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"; }
|
||||
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) { };
|
||||
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"; }
|
||||
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) { };
|
||||
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"; }
|
||||
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) { };
|
||||
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"; }
|
||||
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) { };
|
||||
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"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "arena"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "CastTimeStrategy.h"
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
@@ -17,16 +19,17 @@ float CastTimeMultiplier::GetValue(Action* action)
|
||||
if (!action->GetTarget() || action->GetTarget() != AI_VALUE(Unit*, "current target"))
|
||||
return 1.0f;
|
||||
|
||||
if (/*targetHealth < sPlayerbotAIConfig->criticalHealth && */dynamic_cast<CastSpellAction*>(action))
|
||||
if (/*targetHealth < sPlayerbotAIConfig->criticalHealth && */ dynamic_cast<CastSpellAction*>(action))
|
||||
{
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", name);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
return 1.0f;
|
||||
|
||||
if ((spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) != 0 || (spellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) != 0)
|
||||
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())
|
||||
@@ -39,11 +42,13 @@ float CastTimeMultiplier::GetValue(Action* action)
|
||||
}
|
||||
|
||||
Unit* target = action->GetTarget();
|
||||
if (!target || !target->IsAlive() || !target->IsInWorld()) {
|
||||
if (!target || !target->IsAlive() || !target->IsInWorld())
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
if (castTime > (1000 * target->GetHealth() / AI_VALUE(float, "expected group dps"))) {
|
||||
if (castTime > (1000 * target->GetHealth() / AI_VALUE(float, "expected group dps")))
|
||||
{
|
||||
return 0.1f;
|
||||
}
|
||||
}
|
||||
@@ -60,7 +65,7 @@ float CastTimeMultiplier::GetValue(Action* action)
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void CastTimeStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers)
|
||||
void CastTimeStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new CastTimeMultiplier(botAI));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_CASTTIMESTRATEGY_H
|
||||
@@ -11,19 +12,19 @@ class PlayerbotAI;
|
||||
|
||||
class CastTimeMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
CastTimeMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "cast time") { }
|
||||
public:
|
||||
CastTimeMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "cast time") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class CastTimeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CastTimeStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
CastTimeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "cast time"; }
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "cast time"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ChatCommandHandlerStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
ChatCommandActionNodeFactoryInternal()
|
||||
{
|
||||
creators["tank attack chat shortcut"] = &tank_attack_chat_shortcut;
|
||||
}
|
||||
public:
|
||||
ChatCommandActionNodeFactoryInternal() { creators["tank attack chat shortcut"] = &tank_attack_chat_shortcut; }
|
||||
|
||||
private:
|
||||
static ActionNode* tank_attack_chat_shortcut(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("tank attack chat shortcut",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ nullptr,
|
||||
/*C*/ NextAction::array(0, new NextAction("attack my target", 100.0f), nullptr));
|
||||
}
|
||||
private:
|
||||
static ActionNode* tank_attack_chat_shortcut(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("tank attack chat shortcut",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ nullptr,
|
||||
/*C*/ NextAction::array(0, new NextAction("attack my target", 100.0f), nullptr));
|
||||
}
|
||||
};
|
||||
|
||||
void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
@@ -28,11 +27,14 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("rep", NextAction::array(0, new NextAction("reputation", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("q", NextAction::array(0, new NextAction("query quest", relevance), new NextAction("query item usage", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("add all loot", NextAction::array(0, new NextAction("add all loot", relevance), new NextAction("loot", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("q", NextAction::array(0, new NextAction("query quest", relevance),
|
||||
new NextAction("query item usage", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("add all loot", NextAction::array(0, new NextAction("add all loot", relevance),
|
||||
new NextAction("loot", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("u", NextAction::array(0, new NextAction("use", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("c", NextAction::array(0, new NextAction("item count", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("items", NextAction::array(0, new NextAction("item count", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("items", NextAction::array(0, new NextAction("item count", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("inv", NextAction::array(0, new NextAction("item count", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("e", NextAction::array(0, new NextAction("equip", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("ue", NextAction::array(0, new NextAction("unequip", relevance), nullptr)));
|
||||
@@ -41,27 +43,49 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
|
||||
triggers.push_back(new TriggerNode("s", NextAction::array(0, new NextAction("sell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("b", NextAction::array(0, new NextAction("buy", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("r", NextAction::array(0, new NextAction("reward", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("attack", NextAction::array(0, new NextAction("attack my target", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("accept", NextAction::array(0, new NextAction("accept quest", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("follow", NextAction::array(0, new NextAction("follow chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("stay", NextAction::array(0, new NextAction("stay chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("flee", NextAction::array(0, new NextAction("flee chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("tank attack", NextAction::array(0, new NextAction("tank attack chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("grind", NextAction::array(0, new NextAction("grind chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("talk", NextAction::array(0, new NextAction("gossip hello", relevance), new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("cast", NextAction::array(0, new NextAction("cast custom spell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("castnc", NextAction::array(0, new NextAction("cast custom nc spell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("revive", NextAction::array(0, new NextAction("spirit healer", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("runaway", NextAction::array(0, new NextAction("runaway chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("warning", NextAction::array(0, new NextAction("runaway chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("max dps", NextAction::array(0, new NextAction("max dps chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("attackers", NextAction::array(0, new NextAction("tell attackers", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("target", NextAction::array(0, new NextAction("tell target", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("ready", NextAction::array(0, new NextAction("ready check", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("naxx", NextAction::array(0, new NextAction("naxx chat shortcut", relevance), NULL)));
|
||||
triggers.push_back(new TriggerNode("bwl", NextAction::array(0, new NextAction("bwl chat shortcut", relevance), NULL)));
|
||||
triggers.push_back(new TriggerNode("dps", NextAction::array(0, new NextAction("tell expected dps", relevance), NULL)));
|
||||
triggers.push_back(new TriggerNode("disperse", NextAction::array(0, new NextAction("disperse set", relevance), NULL)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("attack", NextAction::array(0, new NextAction("attack my target", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("accept", NextAction::array(0, new NextAction("accept quest", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("follow", NextAction::array(0, new NextAction("follow chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("stay", NextAction::array(0, new NextAction("stay chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("flee", NextAction::array(0, new NextAction("flee chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"tank attack", NextAction::array(0, new NextAction("tank attack chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("grind", NextAction::array(0, new NextAction("grind chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("talk", NextAction::array(0, new NextAction("gossip hello", relevance),
|
||||
new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("cast", NextAction::array(0, new NextAction("cast custom spell", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("castnc", NextAction::array(0, new NextAction("cast custom nc spell", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("revive", NextAction::array(0, new NextAction("spirit healer", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("runaway", NextAction::array(0, new NextAction("runaway chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("warning", NextAction::array(0, new NextAction("runaway chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("max dps", NextAction::array(0, new NextAction("max dps chat shortcut", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("attackers", NextAction::array(0, new NextAction("tell attackers", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("target", NextAction::array(0, new NextAction("tell target", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("ready", NextAction::array(0, new NextAction("ready check", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("naxx", NextAction::array(0, new NextAction("naxx chat shortcut", relevance), NULL)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bwl", NextAction::array(0, new NextAction("bwl chat shortcut", relevance), NULL)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("dps", NextAction::array(0, new NextAction("tell expected dps", relevance), NULL)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("disperse", NextAction::array(0, new NextAction("disperse set", relevance), NULL)));
|
||||
}
|
||||
|
||||
ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_CHATCOMMANDHANDLERSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class ChatCommandHandlerStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
ChatCommandHandlerStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
ChatCommandHandlerStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "chat"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "chat"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,28 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "Strategy.h"
|
||||
|
||||
void CombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void CombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_HIGH), nullptr)));
|
||||
triggers.push_back(new TriggerNode("invalid target", NextAction::array(0, new NextAction("drop target", 100), nullptr)));
|
||||
triggers.push_back(new TriggerNode("mounted", NextAction::array(0, new NextAction("check mount state", 54), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master", 55), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy out of spell",
|
||||
NextAction::array(0, new NextAction("reach spell", ACTION_HIGH), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("invalid target", NextAction::array(0, new NextAction("drop target", 100), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("mounted", NextAction::array(0, new NextAction("check mount state", 54), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master",
|
||||
// 55), nullptr)));
|
||||
triggers.push_back(new TriggerNode("combat stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr)));
|
||||
triggers.push_back(new TriggerNode("pet attack", NextAction::array(0, new NextAction("pet attack", ACTION_NORMAL), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("combat long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
AvoidAoeStrategy::AvoidAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("not facing target",
|
||||
NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("pet attack", NextAction::array(0, new NextAction("pet attack", ACTION_NORMAL), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("combat long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f),
|
||||
// new NextAction("repop", 0.8f), nullptr)));
|
||||
}
|
||||
|
||||
AvoidAoeStrategy::AvoidAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
// class AvoidAoeStrategyMultiplier : public Multiplier
|
||||
// {
|
||||
@@ -65,12 +70,9 @@ AvoidAoeStrategy::AvoidAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
|
||||
NextAction** AvoidAoeStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0,
|
||||
new NextAction("avoid aoe", ACTION_EMERGENCY),
|
||||
nullptr);
|
||||
return NextAction::array(0, new NextAction("avoid aoe", ACTION_EMERGENCY), nullptr);
|
||||
}
|
||||
|
||||
|
||||
void AvoidAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
// triggers.push_back(new TriggerNode(
|
||||
@@ -85,7 +87,5 @@ void AvoidAoeStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
|
||||
NextAction** CombatFormationStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0,
|
||||
new NextAction("combat formation move", ACTION_NORMAL),
|
||||
nullptr);
|
||||
return NextAction::array(0, new NextAction("combat formation move", ACTION_NORMAL), nullptr);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_COMBATSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class CombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
CombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT; }
|
||||
};
|
||||
|
||||
class AvoidAoeStrategy : public Strategy
|
||||
@@ -31,7 +32,7 @@ public:
|
||||
class CombatFormationStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CombatFormationStrategy(PlayerbotAI* ai): Strategy(ai) {}
|
||||
CombatFormationStrategy(PlayerbotAI* ai) : Strategy(ai) {}
|
||||
const std::string getName() override { return "combat formation"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
};
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ConserveManaStrategy.h"
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "LastSpellCastValue.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
@@ -96,7 +98,7 @@ float HealerAutoSaveManaMultiplier::GetValue(Action* action)
|
||||
|
||||
if (!healingAction)
|
||||
return 1.0f;
|
||||
|
||||
|
||||
Unit* target = healingAction->GetTarget();
|
||||
if (!target)
|
||||
return 1.0f;
|
||||
@@ -105,14 +107,20 @@ float HealerAutoSaveManaMultiplier::GetValue(Action* action)
|
||||
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))
|
||||
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))
|
||||
if (health >= sPlayerbotAIConfig->lowHealth &&
|
||||
(lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::LOW))
|
||||
return 0.0f;
|
||||
} else {
|
||||
if (health >= sPlayerbotAIConfig->mediumHealth && (lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::MEDIUM))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (health >= sPlayerbotAIConfig->mediumHealth &&
|
||||
(lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::MEDIUM))
|
||||
return 0.0f;
|
||||
if (lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::LOW)
|
||||
return 0.0f;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_CONSERVEMANASTRATEGY_H
|
||||
@@ -47,19 +48,19 @@ class PlayerbotAI;
|
||||
|
||||
class HealerAutoSaveManaMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
HealerAutoSaveManaMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "auto save mana") { }
|
||||
public:
|
||||
HealerAutoSaveManaMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "auto save mana") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class HealerAutoSaveManaStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
HealerAutoSaveManaStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
HealerAutoSaveManaStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "auto save mana"; }
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "auto save mana"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,23 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "DeadStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DeadStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("auto release", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("auto release", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("dead", NextAction::array(0, new NextAction("find corpse", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("corpse near", NextAction::array(0, new NextAction("revive from corpse", relevance - 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("resurrect request", NextAction::array(0, new NextAction("accept resurrect", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("falling far", NextAction::array(0, new NextAction("repop", relevance + 1.f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("location stuck", NextAction::array(0, new NextAction("repop", relevance + 1), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", NextAction::array(0, new NextAction("auto release", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg active", NextAction::array(0, new NextAction("auto release", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("dead", NextAction::array(0, new NextAction("find corpse", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"corpse near", NextAction::array(0, new NextAction("revive from corpse", relevance - 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("resurrect request",
|
||||
NextAction::array(0, new NextAction("accept resurrect", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("falling far", NextAction::array(0, new NextAction("repop", relevance + 1.f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("location stuck", NextAction::array(0, new NextAction("repop", relevance + 1), nullptr)));
|
||||
}
|
||||
|
||||
DeadStrategy::DeadStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
}
|
||||
DeadStrategy::DeadStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_DEADSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class DeadStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
DeadStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
DeadStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dead"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dead"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "DebugStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_DEBUGSTRATEGY_H
|
||||
@@ -9,38 +10,38 @@
|
||||
|
||||
class DebugStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
DebugStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug"; }
|
||||
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) { }
|
||||
public:
|
||||
DebugMoveStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug move"; }
|
||||
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) { }
|
||||
public:
|
||||
DebugRpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug rpg"; }
|
||||
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) { }
|
||||
public:
|
||||
DebugSpellStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug spell"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug spell"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "DpsAssistStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DpsAssistStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("not dps target active", NextAction::array(0, new NextAction("dps assist", 50.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("not dps target active", NextAction::array(0, new NextAction("dps assist", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
void DpsAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("not dps aoe target active", NextAction::array(0, new NextAction("dps aoe", 50.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("not dps aoe target active", NextAction::array(0, new NextAction("dps aoe", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_DPSASSISTSTRATEGY_H
|
||||
@@ -11,22 +12,22 @@ class PlayerbotAI;
|
||||
|
||||
class DpsAssistStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsAssistStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
DpsAssistStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "dps assist"; }
|
||||
// uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dps assist"; }
|
||||
// uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class DpsAoeStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsAoeStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
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;
|
||||
std::string const getName() override { return "dps aoe"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "DuelStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DuelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("duel requested", NextAction::array(0, new NextAction("accept duel", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("no attackers", NextAction::array(0, new NextAction("attack duel opponent", 70.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("duel requested", NextAction::array(0, new NextAction("accept duel", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("no attackers", NextAction::array(0, new NextAction("attack duel opponent", 70.0f), nullptr)));
|
||||
}
|
||||
|
||||
DuelStrategy::DuelStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
}
|
||||
DuelStrategy::DuelStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
void StartDuelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
void StartDuelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||
|
||||
StartDuelStrategy::StartDuelStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
StartDuelStrategy::StartDuelStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_DUELSTRATEGY_H
|
||||
@@ -11,20 +12,20 @@ class PlayerbotAI;
|
||||
|
||||
class DuelStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
DuelStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
DuelStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "duel"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "duel"; }
|
||||
};
|
||||
|
||||
class StartDuelStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
StartDuelStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
StartDuelStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "start duel"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "start duel"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "EmoteStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void EmoteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
@@ -10,21 +12,23 @@ void EmoteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
if (sPlayerbotAIConfig->randomBotEmote)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("emote", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("receive text emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("receive emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("receive text emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("receive emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr)));
|
||||
}
|
||||
|
||||
if (sPlayerbotAIConfig->randomBotTalk)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("suggest what to do", 10.0f),
|
||||
new NextAction("suggest dungeon", 3.0f),
|
||||
new NextAction("suggest trade", 3.0f),
|
||||
new NextAction("talk", 1.0f),
|
||||
nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"often",
|
||||
NextAction::array(0, new NextAction("suggest what to do", 10.0f), new NextAction("suggest dungeon", 3.0f),
|
||||
new NextAction("suggest trade", 3.0f), new NextAction("talk", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
if (sPlayerbotAIConfig->enableGreet)
|
||||
triggers.push_back(new TriggerNode("new player nearby", NextAction::array(0, new NextAction("greet", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("new player nearby", NextAction::array(0, new NextAction("greet", 1.0f), nullptr)));
|
||||
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("rpg mount anim", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_EMOTESTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class EmoteStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
EmoteStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
EmoteStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "emote"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "emote"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "FleeStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void FleeStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void FleeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("panic", NextAction::array(0, new NextAction("flee", ACTION_EMERGENCY + 9), nullptr)));
|
||||
triggers.push_back(new TriggerNode("outnumbered", NextAction::array(0, new NextAction("flee", ACTION_EMERGENCY + 9), nullptr)));
|
||||
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("flee", ACTION_MEDIUM_HEAL), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("panic", NextAction::array(0, new NextAction("flee", ACTION_EMERGENCY + 9), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("outnumbered", NextAction::array(0, new NextAction("flee", ACTION_EMERGENCY + 9), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("critical health", NextAction::array(0, new NextAction("flee", ACTION_MEDIUM_HEAL), nullptr)));
|
||||
}
|
||||
|
||||
void FleeFromAddsStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void FleeFromAddsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("has nearest adds", NextAction::array(0, new NextAction("runaway", 50.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("has nearest adds", NextAction::array(0, new NextAction("runaway", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_FLEESTRATEGY_H
|
||||
@@ -11,20 +12,20 @@ class PlayerbotAI;
|
||||
|
||||
class FleeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
FleeStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
FleeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "flee"; };
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "flee"; };
|
||||
};
|
||||
|
||||
class FleeFromAddsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
FleeFromAddsStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
FleeFromAddsStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "flee from adds"; };
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "flee from adds"; };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "FollowMasterStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** FollowMasterStrategy::getDefaultActions()
|
||||
@@ -12,5 +14,6 @@ NextAction** FollowMasterStrategy::getDefaultActions()
|
||||
|
||||
void FollowMasterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
// triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master", ACTION_HIGH), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master",
|
||||
// ACTION_HIGH), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_FOLLOWMASTERSTRATEGY_H
|
||||
@@ -11,13 +12,12 @@ class PlayerbotAI;
|
||||
|
||||
class FollowMasterStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
FollowMasterStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "follow"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
public:
|
||||
FollowMasterStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "follow"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GrindingStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** GrindingStrategy::getDefaultActions()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
NextAction** GrindingStrategy::getDefaultActions() { return nullptr; }
|
||||
|
||||
void GrindingStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("drink", 4.2f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("food", 4.1f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("no target", NextAction::array(0, new NextAction("attack anything", 4.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("no target", NextAction::array(0, new NextAction("attack anything", 4.0f), nullptr)));
|
||||
}
|
||||
|
||||
void MoveRandomStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode(
|
||||
"often",
|
||||
NextAction::array(0, new NextAction("move random", 1.5f), NULL)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("move random", 1.5f), NULL)));
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GRINDINGSTRATEGY_H
|
||||
@@ -11,13 +12,13 @@ class PlayerbotAI;
|
||||
|
||||
class GrindingStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GrindingStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
GrindingStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "grind"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "grind"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class MoveRandomStrategy : public NonCombatStrategy
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GroupStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void GroupStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
@@ -10,6 +12,6 @@ void GroupStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("invite nearby", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("invite guild", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("leave far away", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("reset instances", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("seldom", NextAction::array(0, new NextAction("reset instances", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GROUPSTRATEGY_H
|
||||
@@ -11,12 +12,12 @@ class PlayerbotAI;
|
||||
|
||||
class GroupStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GroupStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
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;
|
||||
std::string const getName() override { return "group"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GuardStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** GuardStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("guard", 4.0f), nullptr);
|
||||
}
|
||||
|
||||
void GuardStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
NextAction** GuardStrategy::getDefaultActions() { return NextAction::array(0, new NextAction("guard", 4.0f), nullptr); }
|
||||
|
||||
void GuardStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GUARDSTRATEGY_H
|
||||
@@ -11,12 +12,12 @@ class PlayerbotAI;
|
||||
|
||||
class GuardStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GuardStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
GuardStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "guard"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "guard"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GuildStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void GuildStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void GuildStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("offer petition nearby", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("guild manage nearby", 4.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("petition signed", NextAction::array(0, new NextAction("turn in petition", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("buy tabard", NextAction::array(0, new NextAction("buy tabard", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("leave large guild", NextAction::array(0, new NextAction("guild leave", 4.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", NextAction::array(0, new NextAction("offer petition nearby", 4.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", NextAction::array(0, new NextAction("guild manage nearby", 4.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("petition signed", NextAction::array(0, new NextAction("turn in petition", 10.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("buy tabard", NextAction::array(0, new NextAction("buy tabard", 10.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("leave large guild", NextAction::array(0, new NextAction("guild leave", 4.0f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GUILDSTRATEGY_H
|
||||
@@ -11,12 +12,12 @@ class PlayerbotAI;
|
||||
|
||||
class GuildStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GuildStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
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;
|
||||
std::string const getName() override { return "guild"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "KiteStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
KiteStrategy::KiteStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
KiteStrategy::KiteStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void KiteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_KITESTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class KiteStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
KiteStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
KiteStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "kite"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "kite"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "LfgStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void LfgStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void LfgStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("lfg join", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("lfg leave", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("unknown dungeon", NextAction::array(0, new NextAction("give leader in dungeon", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("seldom", NextAction::array(0, new NextAction("lfg leave", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"unknown dungeon", NextAction::array(0, new NextAction("give leader in dungeon", relevance), nullptr)));
|
||||
}
|
||||
|
||||
LfgStrategy::LfgStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
}
|
||||
LfgStrategy::LfgStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_LFGSTRATEGY_H
|
||||
@@ -9,12 +10,12 @@
|
||||
|
||||
class LfgStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
LfgStrategy(PlayerbotAI* botAI);
|
||||
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"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "lfg"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "LootNonCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void LootNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("loot available", NextAction::array(0, new NextAction("loot", 6.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("far from loot target", NextAction::array(0, new NextAction("move to loot", 7.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("far from loot target", NextAction::array(0, new NextAction("move to loot", 7.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("can loot", NextAction::array(0, new NextAction("open loot", 8.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("add all loot", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
void GatherStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("add gathering loot", 2.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("timer", NextAction::array(0, new NextAction("add gathering loot", 2.0f), nullptr)));
|
||||
}
|
||||
|
||||
void RevealStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("reveal gathering item", 50.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", NextAction::array(0, new NextAction("reveal gathering item", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_LOOTNONCOMBATSTRATEGY_H
|
||||
@@ -11,29 +12,29 @@ class PlayerbotAI;
|
||||
|
||||
class LootNonCombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
LootNonCombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
LootNonCombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "loot"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "loot"; }
|
||||
};
|
||||
|
||||
class GatherStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
GatherStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
GatherStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "gather"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "gather"; }
|
||||
};
|
||||
|
||||
class RevealStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RevealStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
RevealStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "reveal"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "reveal"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,24 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "MaintenanceStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** MaintenanceStrategy::getDefaultActions()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
NextAction** MaintenanceStrategy::getDefaultActions() { return nullptr; }
|
||||
|
||||
void MaintenanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("clean quest log", 6.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("use random recipe", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("use random quest item", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("disenchant random item", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("enchant random item", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("smart destroy item", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("random", NextAction::array(0, new NextAction("clean quest log", 6.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("random", NextAction::array(0, new NextAction("use random recipe", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", NextAction::array(0, new NextAction("use random quest item", 10.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("random", NextAction::array(0, new NextAction("disenchant random item", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("random", NextAction::array(0, new NextAction("enchant random item", 1.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("random", NextAction::array(0, new NextAction("smart destroy item", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("move stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("move long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("move long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f),
|
||||
// new NextAction("repop", 0.8f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_MAINTANCESTRATEGY_H
|
||||
@@ -11,13 +12,13 @@ class PlayerbotAI;
|
||||
|
||||
class MaintenanceStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
MaintenanceStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
MaintenanceStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "maintenance"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "maintenance"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "MarkRtiStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void MarkRtiStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no rti target", NextAction::array(0, new NextAction("mark rti", ACTION_NORMAL), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("no rti target", NextAction::array(0, new NextAction("mark rti", ACTION_NORMAL), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_MARKRTISTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class MarkRtiStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MarkRtiStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
MarkRtiStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "mark rti"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "mark rti"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "MeleeCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void MeleeCombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void MeleeCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
// triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_NORMAL + 8), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("enemy too close for melee", NextAction::array(0, new NextAction("move out of enemy contact", ACTION_NORMAL + 8), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing",
|
||||
// ACTION_MOVE + 7), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_NORMAL + 8), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("enemy too close for melee", NextAction::array(0, new NextAction("move out of
|
||||
// enemy contact", ACTION_NORMAL + 8), nullptr)));
|
||||
}
|
||||
|
||||
void SetBehindCombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void SetBehindCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("not behind target", NextAction::array(0, new NextAction("set behind", ACTION_MOVE + 7), nullptr)));
|
||||
triggers.push_back(new TriggerNode("not behind target",
|
||||
NextAction::array(0, new NextAction("set behind", ACTION_MOVE + 7), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_MELEECOMBATSTRATEGY_H
|
||||
@@ -11,21 +12,21 @@ class PlayerbotAI;
|
||||
|
||||
class MeleeCombatStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
MeleeCombatStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { }
|
||||
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"; }
|
||||
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) { }
|
||||
public:
|
||||
SetBehindCombatStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "behind"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "behind"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,30 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void NonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("check mount state", 1.0f),
|
||||
// new NextAction("check values", 1.0f),
|
||||
nullptr)));
|
||||
// triggers.push_back(new TriggerNode("near dark portal", NextAction::array(0, new NextAction("move to dark portal", 1.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("at dark portal azeroth", NextAction::array(0, new NextAction("use dark portal azeroth", 1.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("at dark portal outland", NextAction::array(0, new NextAction("move from dark portal", 1.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("need world buff", NextAction::array(0, new NextAction("world buff", 1.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("vehicle near", NextAction::array(0, new NextAction("enter vehicle", 10.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("check mount state", 1.0f),
|
||||
// new NextAction("check values", 1.0f),
|
||||
nullptr)));
|
||||
// triggers.push_back(new TriggerNode("near dark portal", NextAction::array(0, new NextAction("move to dark
|
||||
// portal", 1.0f), nullptr))); triggers.push_back(new TriggerNode("at dark portal azeroth", NextAction::array(0, new
|
||||
// NextAction("use dark portal azeroth", 1.0f), nullptr))); triggers.push_back(new TriggerNode("at dark portal
|
||||
// outland", NextAction::array(0, new NextAction("move from dark portal", 1.0f), nullptr))); triggers.push_back(new
|
||||
// TriggerNode("need world buff", NextAction::array(0, new NextAction("world buff", 1.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("vehicle near", NextAction::array(0, new NextAction("enter vehicle", 10.0f),
|
||||
// nullptr)));
|
||||
}
|
||||
|
||||
void CollisionStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("collision", NextAction::array(0, new NextAction("move out of collision", 2.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("collision", NextAction::array(0, new NextAction("move out of collision", 2.0f), nullptr)));
|
||||
}
|
||||
|
||||
void MountStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
/*triggers.push_back(new TriggerNode("no possible targets", NextAction::array(0, new NextAction("mount", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("no rpg target", NextAction::array(0, new NextAction("mount", 1.0f), nullptr)));*/
|
||||
/*triggers.push_back(new TriggerNode("no possible targets", NextAction::array(0, new NextAction("mount", 1.0f),
|
||||
nullptr))); triggers.push_back(new TriggerNode("no rpg target", NextAction::array(0, new NextAction("mount", 1.0f),
|
||||
nullptr)));*/
|
||||
/*triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("mount", 4.0f), nullptr)));*/
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_NONCOMBATSTRATEGY_H
|
||||
@@ -11,40 +12,40 @@ class PlayerbotAI;
|
||||
|
||||
class NonCombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
NonCombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
NonCombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
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) { }
|
||||
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"; }
|
||||
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) { };
|
||||
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"; }
|
||||
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) { }
|
||||
public:
|
||||
AttackTaggedStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "attack tagged"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "attack tagged"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void PassTroughStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
for (std::vector<std::string>::iterator i = supported.begin(); i != supported.end(); i++)
|
||||
triggers.push_back(new TriggerNode(i->c_str(), NextAction::array(0, new NextAction(i->c_str(), relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode(i->c_str(), NextAction::array(0, new NextAction(i->c_str(), relevance), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_PASSTHROUGHSTRATEGY_H
|
||||
@@ -11,14 +12,14 @@ class PlayerbotAI;
|
||||
|
||||
class PassTroughStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
PassTroughStrategy(PlayerbotAI* botAI, float relevance = 100.0f) : Strategy(botAI), relevance(relevance) { }
|
||||
public:
|
||||
PassTroughStrategy(PlayerbotAI* botAI, float relevance = 100.0f) : Strategy(botAI), relevance(relevance) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
|
||||
protected:
|
||||
std::vector<std::string> supported;
|
||||
float relevance;
|
||||
protected:
|
||||
std::vector<std::string> supported;
|
||||
float relevance;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "PassiveStrategy.h"
|
||||
|
||||
#include "PassiveMultiplier.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
@@ -10,4 +12,3 @@ void PassiveStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new PassiveMultiplier(botAI));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_PASSIVESTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class PassiveStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
PassiveStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
PassiveStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "passive"; }
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "passive"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "PullStrategy.h"
|
||||
|
||||
#include "PassiveMultiplier.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class MagePullMultiplier : public PassiveMultiplier
|
||||
{
|
||||
public:
|
||||
MagePullMultiplier(PlayerbotAI* botAI, std::string const action) : PassiveMultiplier(botAI), actionName(action) { }
|
||||
public:
|
||||
MagePullMultiplier(PlayerbotAI* botAI, std::string const action) : PassiveMultiplier(botAI), actionName(action) {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
float GetValue(Action* action) override;
|
||||
|
||||
private:
|
||||
std::string const actionName;
|
||||
private:
|
||||
std::string const actionName;
|
||||
};
|
||||
|
||||
float MagePullMultiplier::GetValue(Action* action)
|
||||
@@ -31,13 +33,11 @@ float MagePullMultiplier::GetValue(Action* action)
|
||||
|
||||
NextAction** PullStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction(action, 105.0f), new NextAction("follow", 104.0f), new NextAction("end pull", 103.0f), nullptr);
|
||||
return NextAction::array(0, new NextAction(action, 105.0f), new NextAction("follow", 104.0f),
|
||||
new NextAction("end pull", 103.0f), nullptr);
|
||||
}
|
||||
|
||||
void PullStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
}
|
||||
void PullStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) { CombatStrategy::InitTriggers(triggers); }
|
||||
|
||||
void PullStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
@@ -49,5 +49,6 @@ void PossibleAddsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
Strategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("possible adds", NextAction::array(0, new NextAction("flee with pet", 60), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("possible adds", NextAction::array(0, new NextAction("flee with pet", 60), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_PULLSTRATEGY_H
|
||||
@@ -11,25 +12,25 @@ class PlayerbotAI;
|
||||
|
||||
class PullStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
PullStrategy(PlayerbotAI* botAI, std::string const action) : CombatStrategy(botAI), action(action) { }
|
||||
public:
|
||||
PullStrategy(PlayerbotAI* botAI, std::string const action) : CombatStrategy(botAI), action(action) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "pull"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "pull"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
|
||||
private:
|
||||
std::string const action;
|
||||
private:
|
||||
std::string const action;
|
||||
};
|
||||
|
||||
class PossibleAddsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
PossibleAddsStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
PossibleAddsStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "adds"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "adds"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,44 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "QuestStrategies.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
QuestStrategy::QuestStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
supported.push_back("accept quest");
|
||||
}
|
||||
QuestStrategy::QuestStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) { supported.push_back("accept quest"); }
|
||||
|
||||
void QuestStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("quest share", NextAction::array(0, new NextAction("accept quest share", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("quest share", NextAction::array(0, new NextAction("accept quest share", relevance), nullptr)));
|
||||
}
|
||||
|
||||
void DefaultQuestStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
QuestStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("use game object", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("gossip hello", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("complete quest", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"use game object", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"gossip hello", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"complete quest", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr)));
|
||||
}
|
||||
|
||||
DefaultQuestStrategy::DefaultQuestStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI)
|
||||
{
|
||||
}
|
||||
DefaultQuestStrategy::DefaultQuestStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI) {}
|
||||
|
||||
void AcceptAllQuestsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
QuestStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("use game object", NextAction::array(0, new NextAction("talk to quest giver", relevance), new NextAction("accept all quests", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("gossip hello", NextAction::array(0, new NextAction("talk to quest giver", relevance), new NextAction("accept all quests", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("complete quest", NextAction::array(0, new NextAction("talk to quest giver", relevance), new NextAction("accept all quests", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("use game object", NextAction::array(0, new NextAction("talk to quest giver", relevance),
|
||||
new NextAction("accept all quests", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("gossip hello", NextAction::array(0, new NextAction("talk to quest giver", relevance),
|
||||
new NextAction("accept all quests", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("complete quest", NextAction::array(0, new NextAction("talk to quest giver", relevance),
|
||||
new NextAction("accept all quests", relevance), nullptr)));
|
||||
}
|
||||
|
||||
AcceptAllQuestsStrategy::AcceptAllQuestsStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI)
|
||||
{
|
||||
}
|
||||
AcceptAllQuestsStrategy::AcceptAllQuestsStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI) {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_QUESTSTRATEGIES_H
|
||||
@@ -11,28 +12,28 @@ class PlayerbotAI;
|
||||
|
||||
class QuestStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
QuestStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
QuestStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class DefaultQuestStrategy : public QuestStrategy
|
||||
{
|
||||
public:
|
||||
DefaultQuestStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
DefaultQuestStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "quest"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "quest"; }
|
||||
};
|
||||
|
||||
class AcceptAllQuestsStrategy : public QuestStrategy
|
||||
{
|
||||
public:
|
||||
AcceptAllQuestsStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
AcceptAllQuestsStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "accept all quests"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "accept all quests"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "RTSCStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
RTSCStrategy::RTSCStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
RTSCStrategy::RTSCStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void RTSCStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
void RTSCStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_RTSCSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class RTSCStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RTSCStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
RTSCStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "RTSC"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "RTSC"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,35 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "RacialsStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class RacialsStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
RacialsStrategyActionNodeFactory()
|
||||
{
|
||||
creators["lifeblood"] = &lifeblood;
|
||||
}
|
||||
public:
|
||||
RacialsStrategyActionNodeFactory() { creators["lifeblood"] = &lifeblood; }
|
||||
|
||||
private:
|
||||
static ActionNode* lifeblood(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("lifeblood",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("gift of the naaru"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
private:
|
||||
static ActionNode* lifeblood(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("lifeblood",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("gift of the naaru"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
void RacialsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("lifeblood", 71.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("war stomp", 71.0f), nullptr)));
|
||||
/*triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("war stomp", 71.0f), nullptr)));*/
|
||||
/*triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("arcane torrent", ACTION_EMERGENCY + 6), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("mana tap", ACTION_EMERGENCY + 6), nullptr)));*/
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", NextAction::array(0, new NextAction("lifeblood", 71.0f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("war stomp", 71.0f),
|
||||
// nullptr)));
|
||||
/*triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("war stomp", 71.0f),
|
||||
* nullptr)));*/
|
||||
/*triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("arcane torrent",
|
||||
ACTION_EMERGENCY + 6), nullptr))); triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new
|
||||
NextAction("mana tap", ACTION_EMERGENCY + 6), nullptr)));*/
|
||||
}
|
||||
|
||||
RacialsStrategy::RacialsStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_RACIALSSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class RacialsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RacialsStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
RacialsStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "racials"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "racials"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "RangedCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void RangedCombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void RangedCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", ACTION_MOVE + 9), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr)));
|
||||
triggers.push_back(new TriggerNode("enemy too close for spell",
|
||||
NextAction::array(0, new NextAction("flee", ACTION_MOVE + 9), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing",
|
||||
// ACTION_MOVE + 7), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_RANGEDCOMBATSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ 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"; }
|
||||
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
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ReturnStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void ReturnStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("return", NextAction::array(0, new NextAction("set return position", 1.5f), new NextAction("return", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("return", NextAction::array(0, new NextAction("set return position", 1.5f),
|
||||
new NextAction("return", 1.0f), nullptr)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_RETURNSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class ReturnStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
ReturnStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
ReturnStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "return"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "return"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "RpgStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "RpgSubActions.h"
|
||||
|
||||
@@ -20,43 +22,53 @@ float RpgActionMultiplier::GetValue(Action* action)
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
RpgStrategy::RpgStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
RpgStrategy::RpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
NextAction** RpgStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("rpg", 1.0f), nullptr);
|
||||
}
|
||||
NextAction** RpgStrategy::getDefaultActions() { return NextAction::array(0, new NextAction("rpg", 1.0f), nullptr); }
|
||||
|
||||
void RpgStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no rpg target", NextAction::array(0, new NextAction("choose rpg target", 5.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("no rpg target", NextAction::array(0, new NextAction("choose rpg target", 5.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("move random", 1.10f), NULL)));
|
||||
triggers.push_back(new TriggerNode("far from rpg target", NextAction::array(0, new NextAction("move to rpg target", 5.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("far from rpg target",
|
||||
NextAction::array(0, new NextAction("move to rpg target", 5.0f), nullptr)));
|
||||
|
||||
//Sub actions
|
||||
// Sub actions
|
||||
triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg stay", 1.101f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg work", 1.101f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg emote", 1.101f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("has rpg target", NextAction::array(0, new NextAction("rpg cancel", 1.101f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg taxi", NextAction::array(0, new NextAction("rpg taxi", 1.005f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg discover", NextAction::array(0, new NextAction("rpg discover", 1.210f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg start quest", NextAction::array(0, new NextAction("rpg start quest", 1.180f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg end quest", NextAction::array(0, new NextAction("rpg end quest", 1.190f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("has rpg target", NextAction::array(0, new NextAction("rpg cancel", 1.101f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg taxi", NextAction::array(0, new NextAction("rpg taxi", 1.005f),
|
||||
// nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("rpg discover", NextAction::array(0, new NextAction("rpg discover", 1.210f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("rpg start quest", NextAction::array(0, new NextAction("rpg start quest", 1.180f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("rpg end quest", NextAction::array(0, new NextAction("rpg end quest", 1.190f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg buy", NextAction::array(0, new NextAction("rpg buy", 1.130f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg sell", NextAction::array(0, new NextAction("rpg sell", 1.100f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg repair", NextAction::array(0, new NextAction("rpg repair", 1.195f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg train", NextAction::array(0, new NextAction("rpg train", 1.080f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg sell", NextAction::array(0, new NextAction("rpg sell", 1.100f),
|
||||
// nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("rpg repair", NextAction::array(0, new NextAction("rpg repair", 1.195f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg train", NextAction::array(0, new NextAction("rpg train", 1.080f),
|
||||
// nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg heal", NextAction::array(0, new NextAction("rpg heal", 1.125f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg home bind", NextAction::array(0, new NextAction("rpg home bind", 1.160f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg queue bg", NextAction::array(0, new NextAction("rpg queue bg", 1.085f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg buy petition", NextAction::array(0, new NextAction("rpg buy petition", 1.140f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("rpg home bind", NextAction::array(0, new NextAction("rpg home bind", 1.160f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg queue bg", NextAction::array(0, new NextAction("rpg queue bg", 1.085f),
|
||||
// nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("rpg buy petition", NextAction::array(0, new NextAction("rpg buy petition", 1.140f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("rpg use", NextAction::array(0, new NextAction("rpg use", 1.102f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("rpg spell", NextAction::array(0, new NextAction("rpg spell", 1.001f), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("rpg craft", NextAction::array(0, new NextAction("rpg craft", 1.001f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg trade useful", NextAction::array(0, new NextAction("rpg trade useful", 1.030f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg duel", NextAction::array(0, new NextAction("rpg duel", 1.010f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg spell", NextAction::array(0, new NextAction("rpg spell", 1.001f),
|
||||
// nullptr))); triggers.push_back(new TriggerNode("rpg craft", NextAction::array(0, new NextAction("rpg
|
||||
// craft", 1.001f), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("rpg trade useful", NextAction::array(0, new NextAction("rpg trade
|
||||
// useful", 1.030f), nullptr))); triggers.push_back(new TriggerNode("rpg duel", NextAction::array(0, new
|
||||
// NextAction("rpg duel", 1.010f), nullptr)));
|
||||
}
|
||||
|
||||
void RpgStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_RPGSTRATEGY_H
|
||||
@@ -11,21 +12,21 @@ class PlayerbotAI;
|
||||
|
||||
class RpgActionMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
RpgActionMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "rpg action") { }
|
||||
public:
|
||||
RpgActionMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "rpg action") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class RpgStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RpgStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
RpgStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "rpg"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "rpg"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "RunawayStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void RunawayStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("runaway", 50.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("runaway", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_RUNAWAYSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class RunawayStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
RunawayStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
RunawayStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "runaway"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "runaway"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "SayStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void SayStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("say::critical health", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("say::low health", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("say::low mana", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("critical health",
|
||||
NextAction::array(0, new NextAction("say::critical health", 99.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", NextAction::array(0, new NextAction("say::low health", 99.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low mana", NextAction::array(0, new NextAction("say::low mana", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("tank aoe", NextAction::array(0, new NextAction("say::taunt", 99.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("say::aoe", 99.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_SAYSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class SayStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
SayStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
SayStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "say"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "say"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "StayStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
NextAction** StayStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("stay", 1.0f), nullptr);
|
||||
}
|
||||
NextAction** StayStrategy::getDefaultActions() { return NextAction::array(0, new NextAction("stay", 1.0f), nullptr); }
|
||||
|
||||
void SitStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_STAYSTRATEGY_H
|
||||
@@ -11,20 +12,20 @@ class PlayerbotAI;
|
||||
|
||||
class StayStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
StayStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
StayStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "stay"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
std::string const getName() override { return "stay"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
};
|
||||
|
||||
class SitStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
SitStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
public:
|
||||
SitStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "sit"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "sit"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "TankAssistStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void TankAssistStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("tank assist", NextAction::array(0, new NextAction("tank assist", 50.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("tank assist", NextAction::array(0, new NextAction("tank assist", 50.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_TANKASSISTSTRATEGY_H
|
||||
@@ -11,12 +12,12 @@ class PlayerbotAI;
|
||||
|
||||
class TankAssistStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
TankAssistStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
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;
|
||||
std::string const getName() override { return "tank assist"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_TANK; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "TellTargetStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void TellTargetStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("target changed", NextAction::array(0, new NextAction("tell target", 51.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("target changed", NextAction::array(0, new NextAction("tell target", 51.0f), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_TELLTARGETSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class TellTargetStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
TellTargetStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
TellTargetStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "TellTarget"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "TellTarget"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ThreatStrategy.h"
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "Map.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
float ThreatMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (AI_VALUE(bool, "neglect threat")) {
|
||||
if (AI_VALUE(bool, "neglect threat"))
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
|
||||
if (!action || action->getThreatType() == Action::ActionThreatType::None)
|
||||
return 1.0f;
|
||||
|
||||
@@ -40,13 +43,16 @@ void ThreatStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
|
||||
float FocusMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (!action) {
|
||||
if (!action)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
if (action->getThreatType() == Action::ActionThreatType::Aoe && !dynamic_cast<CastHealingSpellAction*>(action)) {
|
||||
if (action->getThreatType() == Action::ActionThreatType::Aoe && !dynamic_cast<CastHealingSpellAction*>(action))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
if (dynamic_cast<CastDebuffSpellOnAttackerAction*>(action)) {
|
||||
if (dynamic_cast<CastDebuffSpellOnAttackerAction*>(action))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
return 1.0f;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_THREATSTRATEGY_H
|
||||
@@ -11,36 +12,36 @@ class PlayerbotAI;
|
||||
|
||||
class ThreatMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
ThreatMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "threat") { }
|
||||
public:
|
||||
ThreatMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "threat") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class ThreatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ThreatStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
ThreatStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "threat"; }
|
||||
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") { }
|
||||
public:
|
||||
FocusMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "focus") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class FocusStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
FocusStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
FocusStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "focus"; }
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "focus"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "TravelStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
TravelStrategy::TravelStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
{
|
||||
}
|
||||
TravelStrategy::TravelStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
NextAction** TravelStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("travel", 1.0f), nullptr);
|
||||
}
|
||||
|
||||
void TravelStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
void TravelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no travel target", NextAction::array(0, new NextAction("choose travel target", 6.f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("far from travel target", NextAction::array(0, new NextAction("move to travel target", 1), nullptr)));
|
||||
triggers.push_back(new TriggerNode("no travel target",
|
||||
NextAction::array(0, new NextAction("choose travel target", 6.f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("far from travel target",
|
||||
NextAction::array(0, new NextAction("move to travel target", 1), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_TRAVELSTRATEGY_H
|
||||
@@ -11,37 +12,37 @@ class PlayerbotAI;
|
||||
|
||||
class TravelStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
TravelStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
TravelStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "travel"; }
|
||||
std::string const getName() override { return "travel"; }
|
||||
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*> &triggers) override;
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class ExploreStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ExploreStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
public:
|
||||
ExploreStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
std::string const getName() override { return "explore"; }
|
||||
std::string const getName() override { return "explore"; }
|
||||
};
|
||||
|
||||
class MapStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MapStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
public:
|
||||
MapStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
std::string const getName() override { return "map"; }
|
||||
std::string const getName() override { return "map"; }
|
||||
};
|
||||
|
||||
class MapFullStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MapFullStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
public:
|
||||
MapFullStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
std::string const getName() override { return "map full"; }
|
||||
std::string const getName() override { return "map full"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "UseFoodStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void UseFoodStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_USEFOODSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class UseFoodStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
UseFoodStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
public:
|
||||
UseFoodStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "food"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "food"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "UsePotionsStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class UsePotionsStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
UsePotionsStrategyActionNodeFactory()
|
||||
{
|
||||
creators["healthstone"] = &healthstone;
|
||||
}
|
||||
private:
|
||||
static ActionNode* healthstone(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("healthstone",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("healing potion"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
public:
|
||||
UsePotionsStrategyActionNodeFactory() { creators["healthstone"] = &healthstone; }
|
||||
|
||||
private:
|
||||
static ActionNode* healthstone(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("healthstone",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("healing potion"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
UsePotionsStrategy::UsePotionsStrategy(PlayerbotAI* botAI) : Strategy(botAI)
|
||||
@@ -31,6 +31,8 @@ void UsePotionsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
Strategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("healthstone", ACTION_MEDIUM_HEAL + 1), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("mana potion", ACTION_EMERGENCY), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"critical health", NextAction::array(0, new NextAction("healthstone", ACTION_MEDIUM_HEAL + 1), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("low mana", NextAction::array(0, new NextAction("mana potion", ACTION_EMERGENCY), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_USEPOTIONSSTRATEGY_H
|
||||
@@ -11,11 +12,11 @@ class PlayerbotAI;
|
||||
|
||||
class UsePotionsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
UsePotionsStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
UsePotionsStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "potions"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "potions"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,55 +1,92 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "WorldPacketHandlerStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void WorldPacketHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("group invite", NextAction::array(0, new NextAction("accept invitation", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("uninvite", NextAction::array(0, new NextAction("uninvite", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("uninvite guid", NextAction::array(0, new NextAction("uninvite", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("group set leader", NextAction::array(0, /*new NextAction("leader", relevance),*/ nullptr)));
|
||||
triggers.push_back(new TriggerNode("not enough money", NextAction::array(0, new NextAction("tell not enough money", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("not enough reputation", NextAction::array(0, new NextAction("tell not enough reputation", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("cannot equip", NextAction::array(0, new NextAction("tell cannot equip", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("use game object", NextAction::array(0, new NextAction("add loot", relevance), new NextAction("use meeting stone", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("gossip hello", NextAction::array(0, new NextAction("trainer", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("activate taxi", NextAction::array(0, new NextAction("remember taxi", relevance), new NextAction("taxi", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("group invite", NextAction::array(0, new NextAction("accept invitation", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("uninvite", NextAction::array(0, new NextAction("uninvite", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("uninvite guid", NextAction::array(0, new NextAction("uninvite", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("group set leader", NextAction::array(0, /*new NextAction("leader", relevance),*/ nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"not enough money", NextAction::array(0, new NextAction("tell not enough money", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("not enough reputation",
|
||||
NextAction::array(0, new NextAction("tell not enough reputation", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("cannot equip", NextAction::array(0, new NextAction("tell cannot equip", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("use game object", NextAction::array(0, new NextAction("add loot", relevance),
|
||||
new NextAction("use meeting stone", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("gossip hello", NextAction::array(0, new NextAction("trainer", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("activate taxi", NextAction::array(0, new NextAction("remember taxi", relevance),
|
||||
new NextAction("taxi", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("taxi done", NextAction::array(0, new NextAction("taxi", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("trade status", NextAction::array(0, new NextAction("accept trade", relevance), new NextAction("equip upgrades", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("area trigger", NextAction::array(0, new NextAction("reach area trigger", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("within area trigger", NextAction::array(0, new NextAction("area trigger", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("loot response", NextAction::array(0, new NextAction("store loot", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("item push result", NextAction::array(0, new NextAction("query item usage", relevance), new NextAction("equip upgrades", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("ready check finished", NextAction::array(0, new NextAction("finish ready check", relevance), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("security check", relevance), new NextAction("check mail", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("guild invite", NextAction::array(0, new NextAction("guild accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("petition offer", NextAction::array(0, new NextAction("petition sign", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("lfg proposal", NextAction::array(0, new NextAction("lfg accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("lfg proposal active", NextAction::array(0, new NextAction("lfg accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("arena team invite", NextAction::array(0, new NextAction("arena team accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("quest confirm accept", NextAction::array(0, new NextAction("quest confirm accept", relevance), nullptr)));
|
||||
//triggers.push_back(new TriggerNode("no non bot players around", NextAction::array(0, new NextAction("delay", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("bg status", NextAction::array(0, new NextAction("bg status", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("trade status", NextAction::array(0, new NextAction("accept trade", relevance),
|
||||
new NextAction("equip upgrades", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("area trigger",
|
||||
NextAction::array(0, new NextAction("reach area trigger", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("within area trigger",
|
||||
NextAction::array(0, new NextAction("area trigger", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("loot response", NextAction::array(0, new NextAction("store loot", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("item push result", NextAction::array(0, new NextAction("query item usage", relevance),
|
||||
new NextAction("equip upgrades", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("ready check finished",
|
||||
NextAction::array(0, new NextAction("finish ready check", relevance), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("security check", relevance), new
|
||||
// NextAction("check mail", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("guild invite", NextAction::array(0, new NextAction("guild accept", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("petition offer", NextAction::array(0, new NextAction("petition sign", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("lfg proposal", NextAction::array(0, new NextAction("lfg accept", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("lfg proposal active", NextAction::array(0, new NextAction("lfg accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("arena team invite",
|
||||
NextAction::array(0, new NextAction("arena team accept", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"quest confirm accept", NextAction::array(0, new NextAction("quest confirm accept", relevance), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("no non bot players around", NextAction::array(0, new NextAction("delay",
|
||||
// relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg status", NextAction::array(0, new NextAction("bg status", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("xpgain", NextAction::array(0, new NextAction("xp gain", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("levelup", NextAction::array(0,
|
||||
new NextAction("auto teleport for level", relevance + 3),
|
||||
new NextAction("auto talents", relevance + 2),
|
||||
new NextAction("auto learn spell", relevance + 1),
|
||||
new NextAction("auto upgrade equip", relevance),
|
||||
nullptr)));
|
||||
// triggers.push_back(new TriggerNode("group destroyed", NextAction::array(0, new NextAction("reset botAI", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("questgiver quest details", NextAction::array(0, new NextAction("turn in query quest", relevance), nullptr)));
|
||||
|
||||
triggers.push_back(new TriggerNode("group list", NextAction::array(0, new NextAction("reset botAI", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("see spell", NextAction::array(0, new NextAction("see spell", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("release spirit", NextAction::array(0, new NextAction("release", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("revive from corpse", NextAction::array(0, new NextAction("revive from corpse", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("master loot roll", NextAction::array(0, new NextAction("master loot roll", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("levelup", NextAction::array(0, new NextAction("auto teleport for level", relevance + 3),
|
||||
new NextAction("auto talents", relevance + 2),
|
||||
new NextAction("auto learn spell", relevance + 1),
|
||||
new NextAction("auto upgrade equip", relevance), nullptr)));
|
||||
// triggers.push_back(new TriggerNode("group destroyed", NextAction::array(0, new NextAction("reset botAI",
|
||||
// relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"questgiver quest details", NextAction::array(0, new NextAction("turn in query quest", relevance), nullptr)));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("group list", NextAction::array(0, new NextAction("reset botAI", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("see spell", NextAction::array(0, new NextAction("see spell", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("release spirit", NextAction::array(0, new NextAction("release", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("revive from corpse",
|
||||
NextAction::array(0, new NextAction("revive from corpse", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("master loot roll",
|
||||
NextAction::array(0, new NextAction("master loot roll", relevance), nullptr)));
|
||||
}
|
||||
|
||||
WorldPacketHandlerStrategy::WorldPacketHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
@@ -69,5 +106,6 @@ WorldPacketHandlerStrategy::WorldPacketHandlerStrategy(PlayerbotAI* botAI) : Pas
|
||||
|
||||
void ReadyCheckStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("ready check", relevance), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("timer", NextAction::array(0, new NextAction("ready check", relevance), nullptr)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_WORLDPACKETHANDLERSTRATEGY_H
|
||||
@@ -11,20 +12,20 @@ class PlayerbotAI;
|
||||
|
||||
class WorldPacketHandlerStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
WorldPacketHandlerStrategy(PlayerbotAI* botAI);
|
||||
public:
|
||||
WorldPacketHandlerStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "default"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "default"; }
|
||||
};
|
||||
|
||||
class ReadyCheckStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
ReadyCheckStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) { }
|
||||
public:
|
||||
ReadyCheckStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "ready check"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "ready check"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user