mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-17 09:04:36 +00:00
[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)
This commit is contained in:
294
src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp
Normal file
294
src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp
Normal file
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ArmsWarriorStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class ArmsWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
ArmsWarriorStrategyActionNodeFactory()
|
||||
{
|
||||
creators["charge"] = &charge;
|
||||
creators["death wish"] = &death_wish;
|
||||
creators["piercing howl"] = &piercing_howl;
|
||||
creators["mocking blow"] = &mocking_blow;
|
||||
creators["heroic strike"] = &heroic_strike;
|
||||
creators["enraged regeneration"] = &enraged_regeneration;
|
||||
creators["retaliation"] = &retaliation;
|
||||
creators["shattering throw"] = &shattering_throw;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* charge(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"charge",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("reach melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* death_wish(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"death wish",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("bloodrage") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* piercing_howl(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"piercing howl",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("mocking blow") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* mocking_blow(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"mocking blow",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("hamstring") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* heroic_strike(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"heroic strike",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* enraged_regeneration(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"enraged regeneration",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* retaliation(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"retaliation",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* shattering_throw(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"shattering throw",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
ArmsWarriorStrategy::ArmsWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new ArmsWarriorStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> ArmsWarriorStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("bladestorm", ACTION_DEFAULT + 0.2f),
|
||||
NextAction("mortal strike", ACTION_DEFAULT + 0.1f),
|
||||
NextAction("melee", ACTION_DEFAULT)
|
||||
};
|
||||
}
|
||||
void ArmsWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericWarriorStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of melee",
|
||||
{
|
||||
NextAction("charge", ACTION_MOVE + 10)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"battle stance",
|
||||
{
|
||||
NextAction("battle stance", ACTION_HIGH + 10)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"battle shout",
|
||||
{
|
||||
NextAction("battle shout", ACTION_HIGH + 9)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rend",
|
||||
{
|
||||
NextAction("rend", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rend on attacker",
|
||||
{
|
||||
NextAction("rend on attacker", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"mortal strike",
|
||||
{
|
||||
NextAction("mortal strike", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"target critical health",
|
||||
{
|
||||
NextAction("execute", ACTION_HIGH + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"sudden death",
|
||||
{
|
||||
NextAction("execute", ACTION_HIGH + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"hamstring",
|
||||
{
|
||||
NextAction("piercing howl", ACTION_HIGH)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"overpower",
|
||||
{
|
||||
NextAction("overpower", ACTION_HIGH + 4)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"taste for blood",
|
||||
{
|
||||
NextAction("overpower", ACTION_HIGH + 4)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"victory rush",
|
||||
{
|
||||
NextAction("victory rush", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"high rage available",
|
||||
{
|
||||
NextAction("heroic strike", ACTION_HIGH),
|
||||
NextAction("slam", ACTION_HIGH + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"bloodrage",
|
||||
{
|
||||
NextAction("bloodrage", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"death wish",
|
||||
{
|
||||
NextAction("death wish", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"critical health",
|
||||
{
|
||||
NextAction("intimidating shout", ACTION_EMERGENCY)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium health",
|
||||
{
|
||||
NextAction("enraged regeneration", ACTION_EMERGENCY)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"almost full health",
|
||||
{
|
||||
NextAction("retaliation", ACTION_EMERGENCY + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"shattering throw trigger",
|
||||
{
|
||||
NextAction("shattering throw", ACTION_INTERRUPT + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
25
src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.h
Normal file
25
src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_ARMSWARRIORSTRATEGY_H
|
||||
#define _PLAYERBOT_ARMSWARRIORSTRATEGY_H
|
||||
|
||||
#include "GenericWarriorStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class ArmsWarriorStrategy : public GenericWarriorStrategy
|
||||
{
|
||||
public:
|
||||
ArmsWarriorStrategy(PlayerbotAI* botAI);
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "arms"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
#endif
|
||||
206
src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp
Normal file
206
src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp
Normal file
@@ -0,0 +1,206 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "FuryWarriorStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class FuryWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
FuryWarriorStrategyActionNodeFactory()
|
||||
{
|
||||
creators["charge"] = &charge;
|
||||
creators["intercept"] = &intercept;
|
||||
creators["piercing howl"] = &piercing_howl;
|
||||
creators["pummel"] = &pummel;
|
||||
creators["enraged regeneration"] = &enraged_regeneration;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* charge(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"charge",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("intercept" )},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* intercept(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"intercept",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("reach melee" )},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* piercing_howl(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"piercing howl",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("hamstring" )},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* pummel(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"pummel",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("intercept" )},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* enraged_regeneration(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"enraged regeneration",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
FuryWarriorStrategy::FuryWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new FuryWarriorStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> FuryWarriorStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("bloodthirst", ACTION_DEFAULT + 0.5f),
|
||||
NextAction("whirlwind", ACTION_DEFAULT + 0.4f),
|
||||
NextAction("sunder armor", ACTION_DEFAULT + 0.3f),
|
||||
NextAction("execute", ACTION_DEFAULT + 0.2f),
|
||||
NextAction("melee", ACTION_DEFAULT)
|
||||
};
|
||||
}
|
||||
|
||||
void FuryWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericWarriorStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of melee",
|
||||
{
|
||||
NextAction("charge", ACTION_MOVE + 9)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"berserker stance", {
|
||||
NextAction("berserker stance", ACTION_HIGH + 9)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"battle shout",
|
||||
{
|
||||
NextAction("battle shout", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"pummel on enemy healer",
|
||||
{
|
||||
NextAction("pummel on enemy healer", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"pummel",
|
||||
{
|
||||
NextAction("pummel", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"victory rush",
|
||||
{
|
||||
NextAction("victory rush", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"bloodthirst",
|
||||
{
|
||||
NextAction("bloodthirst", ACTION_HIGH + 7)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"whirlwind",
|
||||
{
|
||||
NextAction("whirlwind", ACTION_HIGH + 6)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"instant slam",
|
||||
{
|
||||
NextAction("slam", ACTION_HIGH + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"bloodrage",
|
||||
{
|
||||
NextAction("bloodrage", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium rage available",
|
||||
{
|
||||
NextAction("heroic strike", ACTION_DEFAULT + 0.1f)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"death wish",
|
||||
{
|
||||
NextAction("death wish", ACTION_HIGH)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"recklessness",
|
||||
{
|
||||
NextAction("recklessness", ACTION_HIGH)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"critical health",
|
||||
{
|
||||
NextAction("enraged regeneration", ACTION_EMERGENCY)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
24
src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.h
Normal file
24
src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_FURYWARRIORSTRATEGY_H
|
||||
#define _PLAYERBOT_FURYWARRIORSTRATEGY_H
|
||||
|
||||
#include "GenericWarriorStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class FuryWarriorStrategy : public GenericWarriorStrategy
|
||||
{
|
||||
public:
|
||||
FuryWarriorStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "fury"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GenericWarriorNonCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void GenericWarriorNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
NonCombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("apply stone", 1.0f) }));
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GENERICWARRIORNONCOBATSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICWARRIORNONCOBATSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericWarriorNonCombatStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericWarriorNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "nc"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
52
src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.cpp
Normal file
52
src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GenericWarriorStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
GenericWarriorStrategy::GenericWarriorStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GenericWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
triggers.push_back(new TriggerNode(
|
||||
"enemy out of melee", { NextAction("reach melee", ACTION_HIGH + 1) }));
|
||||
}
|
||||
|
||||
class WarrirorAoeStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
WarrirorAoeStrategyActionNodeFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
WarrirorAoeStrategy::WarrirorAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new WarrirorAoeStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void WarrirorAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode(
|
||||
"light aoe", { NextAction("sweeping strikes", ACTION_HIGH + 7),
|
||||
NextAction("bladestorm", ACTION_HIGH + 6),
|
||||
NextAction("thunder clap", ACTION_HIGH + 5),
|
||||
NextAction("shockwave", ACTION_HIGH + 4),
|
||||
NextAction("demoralizing shout without life time check", ACTION_HIGH + 1),
|
||||
NextAction("cleave", ACTION_HIGH) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("shockwave on snare target",
|
||||
{ NextAction("shockwave on snare target", ACTION_HIGH + 5) }));
|
||||
|
||||
}
|
||||
236
src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.h
Normal file
236
src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.h
Normal file
@@ -0,0 +1,236 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GENERICWARRIORSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICWARRIORSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
// Stance requirements
|
||||
class WarriorStanceRequirementActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
WarriorStanceRequirementActionNodeFactory()
|
||||
{
|
||||
// battle only
|
||||
creators["charge"] = &charge;
|
||||
creators["mocking blow"] = &mocking_blow;
|
||||
creators["overpower"] = &overpower;
|
||||
creators["retaliation"] = &retaliation;
|
||||
creators["shattering throw"] = &shattering_throw;
|
||||
|
||||
// temp
|
||||
creators["mortal strike"] = &mortal_strike;
|
||||
|
||||
// berserker only
|
||||
creators["berserker rage"] = &berserker_rage;
|
||||
creators["recklessness"] = &recklessness;
|
||||
creators["whirlwind"] = &whirlwind;
|
||||
creators["pummel"] = &pummel;
|
||||
creators["intercept"] = &intercept;
|
||||
|
||||
// defensive only
|
||||
creators["taunt"] = &taunt;
|
||||
creators["revenge"] = &revenge;
|
||||
creators["shield block"] = &shield_block;
|
||||
creators["disarm"] = &disarm;
|
||||
creators["shield wall"] = &shield_wall;
|
||||
creators["intervene"] = &intervene;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
static ActionNode* charge([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"charge",
|
||||
/*P*/ { NextAction("battle stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* mocking_blow([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"mocking blow",
|
||||
/*P*/ { NextAction("battle stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* overpower([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"overpower",
|
||||
/*P*/ { NextAction("battle stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* berserker_rage([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"berserker rage",
|
||||
/*P*/ { NextAction("berserker stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* recklessness([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"recklessness",
|
||||
/*P*/ { NextAction("berserker stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* whirlwind([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"whirlwind",
|
||||
/*P*/ { NextAction("berserker stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* pummel([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"pummel",
|
||||
/*P*/ { NextAction("berserker stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* intercept([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"intercept",
|
||||
/*P*/ { NextAction("berserker stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* taunt([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"taunt",
|
||||
/*P*/ { NextAction("defensive stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* revenge([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"revenge",
|
||||
/*P*/ { NextAction("defensive stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* shield_block([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"shield block",
|
||||
/*P*/ { NextAction("defensive stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* disarm([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"disarm",
|
||||
/*P*/ { NextAction("defensive stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* shield_wall([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"shield wall",
|
||||
/*P*/ { NextAction("defensive stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* intervene([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"intervene",
|
||||
/*P*/ { NextAction("defensive stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* mortal_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"mortal strike",
|
||||
/*P*/ { NextAction("battle stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* retaliation([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"retaliation",
|
||||
/*P*/ { NextAction("battle stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* shattering_throw([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"shattering throw",
|
||||
/*P*/ { NextAction("battle stance") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
class GenericWarriorStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericWarriorStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "warrior"; }
|
||||
};
|
||||
|
||||
class WarrirorAoeStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
WarrirorAoeStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "aoe"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
369
src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp
Normal file
369
src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp
Normal file
@@ -0,0 +1,369 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "TankWarriorStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class TankWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
TankWarriorStrategyActionNodeFactory()
|
||||
{
|
||||
creators["charge"] = &charge;
|
||||
creators["sunder armor"] = &sunder_armor;
|
||||
creators["commanding shout"] = &commanding_shout;
|
||||
creators["devastate"] = &devastate;
|
||||
creators["last stand"] = &last_stand;
|
||||
creators["heroic throw on snare target"] = &heroic_throw_on_snare_target;
|
||||
creators["heroic throw taunt"] = &heroic_throw_taunt;
|
||||
creators["taunt"] = &taunt;
|
||||
creators["taunt spell"] = &taunt;
|
||||
creators["vigilance"] = &vigilance;
|
||||
creators["enraged regeneration"] = &enraged_regeneration;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* heroic_throw_taunt(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"heroic throw",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("shield slam") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* heroic_throw_on_snare_target(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"heroic throw on snare target",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("taunt on snare target") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* last_stand(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"last stand",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("intimidating shout") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* devastate(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"devastate",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("sunder armor") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* commanding_shout(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"commanding shout",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("battle shout") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* sunder_armor(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"sunder armor",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* charge(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"charge",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("reach melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* taunt(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"taunt",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("heroic throw taunt") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* vigilance(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"vigilance",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* enraged_regeneration(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"enraged regeneration",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
TankWarriorStrategy::TankWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new TankWarriorStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> TankWarriorStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("devastate", ACTION_DEFAULT + 0.3f),
|
||||
NextAction("revenge", ACTION_DEFAULT + 0.2f),
|
||||
NextAction("demoralizing shout", ACTION_DEFAULT + 0.1f),
|
||||
NextAction("melee", ACTION_DEFAULT)
|
||||
};
|
||||
}
|
||||
|
||||
void TankWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericWarriorStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"vigilance",
|
||||
{
|
||||
NextAction("vigilance", ACTION_HIGH + 7)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of melee",
|
||||
{
|
||||
NextAction("heroic throw", ACTION_MOVE + 11),
|
||||
NextAction("charge", ACTION_MOVE + 10)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"thunder clap and rage",
|
||||
{
|
||||
NextAction("thunder clap", ACTION_MOVE + 11)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"defensive stance",
|
||||
{
|
||||
NextAction("defensive stance", ACTION_HIGH + 9)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"commanding shout",
|
||||
{
|
||||
NextAction("commanding shout", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"bloodrage",
|
||||
{
|
||||
NextAction("bloodrage", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"sunder armor",
|
||||
{
|
||||
NextAction("devastate", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium rage available",
|
||||
{
|
||||
NextAction("shield slam", ACTION_HIGH + 2),
|
||||
NextAction("devastate", ACTION_HIGH + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"shield block",
|
||||
{
|
||||
NextAction("shield block", ACTION_INTERRUPT + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"revenge",
|
||||
{
|
||||
NextAction("revenge", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"disarm",
|
||||
{
|
||||
NextAction("disarm", ACTION_HIGH + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"lose aggro",
|
||||
{
|
||||
NextAction("taunt", ACTION_INTERRUPT + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"taunt on snare target",
|
||||
{
|
||||
NextAction("heroic throw on snare target", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"low health",
|
||||
{
|
||||
NextAction("shield wall", ACTION_MEDIUM_HEAL)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"critical health",
|
||||
{
|
||||
NextAction("last stand", ACTION_EMERGENCY + 3),
|
||||
NextAction("enraged regeneration", ACTION_EMERGENCY + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"high aoe",
|
||||
{
|
||||
NextAction("challenging shout", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"concussion blow",
|
||||
{
|
||||
NextAction("concussion blow", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"shield bash",
|
||||
{
|
||||
NextAction("shield bash", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"shield bash on enemy healer",
|
||||
{
|
||||
NextAction("shield bash on enemy healer", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"spell reflection",
|
||||
{
|
||||
NextAction("spell reflection", ACTION_INTERRUPT + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"victory rush",
|
||||
{
|
||||
NextAction("victory rush", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"sword and board",
|
||||
{
|
||||
NextAction("shield slam", ACTION_INTERRUPT)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rend",
|
||||
{
|
||||
NextAction("rend", ACTION_NORMAL + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rend on attacker",
|
||||
{
|
||||
NextAction("rend on attacker", ACTION_NORMAL + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"protect party member",
|
||||
{
|
||||
NextAction("intervene", ACTION_EMERGENCY)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"high rage available",
|
||||
{
|
||||
NextAction("heroic strike", ACTION_HIGH)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium rage available",
|
||||
{
|
||||
NextAction("thunder clap", ACTION_HIGH + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
25
src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.h
Normal file
25
src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_TANKWARRIORSTRATEGY_H
|
||||
#define _PLAYERBOT_TANKWARRIORSTRATEGY_H
|
||||
|
||||
#include "GenericWarriorStrategy.h"
|
||||
#include "WarriorTriggers.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class TankWarriorStrategy : public GenericWarriorStrategy
|
||||
{
|
||||
public:
|
||||
TankWarriorStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "tank"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_TANK | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user