mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-21 20:46:22 +00:00
Big update.
This commit is contained in:
93
src/strategy/hunter/DpsHunterStrategy.cpp
Normal file
93
src/strategy/hunter/DpsHunterStrategy.cpp
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU 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 "DpsHunterStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class DpsHunterStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
DpsHunterStrategyActionNodeFactory()
|
||||
{
|
||||
creators["aimed shot"] = &aimed_shot;
|
||||
creators["chimera shot"] = &chimera_shot;
|
||||
creators["explosive shot"] = &explosive_shot;
|
||||
creators["concussive shot"] = &concussive_shot;
|
||||
creators["viper sting"] = &viper_sting;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* viper_sting(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("viper sting",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("mana potion", 10.0f), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* aimed_shot(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("aimed shot",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("chimera shot", 10.0f), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* chimera_shot(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("chimera shot",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("arcane shot", 10.0f), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* explosive_shot(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("explosive shot",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("aimed shot"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* concussive_shot(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("concussive shot",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
DpsHunterStrategy::DpsHunterStrategy(PlayerbotAI* botAI) : GenericHunterStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new DpsHunterStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
NextAction** DpsHunterStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("explosive shot", 11.0f), new NextAction("auto shot", 10.0f), new NextAction("auto attack", 9.0f), nullptr);
|
||||
}
|
||||
|
||||
void DpsHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericHunterStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("black arrow", NextAction::array(0, new NextAction("black arrow", 15.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("viper sting", 23), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunter's mark", NextAction::array(0, new NextAction("hunter's mark", 19.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("concussive shot on snare target", NextAction::array(0, new NextAction("concussive shot", 20.0f), nullptr)));
|
||||
/*triggers.push_back(new TriggerNode("has aggro", NextAction::array(0, new NextAction("concussive shot", 20.0f), nullptr)));*/
|
||||
}
|
||||
|
||||
void DpsAoeHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 20.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 20.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 17.0f), nullptr)));
|
||||
}
|
||||
|
||||
void DpsHunterDebuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 18.0f), nullptr)));
|
||||
}
|
||||
40
src/strategy/hunter/DpsHunterStrategy.h
Normal file
40
src/strategy/hunter/DpsHunterStrategy.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_DPSHUNTERSTRATEGY_H
|
||||
#define _PLAYERBOT_DPSHUNTERSTRATEGY_H
|
||||
|
||||
#include "GenericHunterStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DpsHunterStrategy : public GenericHunterStrategy
|
||||
{
|
||||
public:
|
||||
DpsHunterStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dps"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
};
|
||||
|
||||
class DpsAoeHunterStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsAoeHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "aoe"; }
|
||||
};
|
||||
|
||||
class DpsHunterDebuffStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsHunterDebuffStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dps debuff"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
58
src/strategy/hunter/GenericHunterNonCombatStrategy.cpp
Normal file
58
src/strategy/hunter/GenericHunterNonCombatStrategy.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU 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 "GenericHunterNonCombatStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericHunterNonCombatStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericHunterNonCombatStrategyActionNodeFactory()
|
||||
{
|
||||
creators["rapid fire"] = &rapid_fire;
|
||||
creators["boost"] = &rapid_fire;
|
||||
creators["aspect of the pack"] = &aspect_of_the_pack;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* rapid_fire(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("rapid fire",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("readiness"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* aspect_of_the_pack(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("aspect of the pack",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("aspect of the cheetah"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
GenericHunterNonCombatStrategy::GenericHunterNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericHunterNonCombatStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericHunterNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
NonCombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("trueshot aura", NextAction::array(0, new NextAction("trueshot aura", 2.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low ammo", NextAction::array(0, new NextAction("say::low ammo", ACTION_NORMAL), nullptr)));
|
||||
triggers.push_back(new TriggerNode("no ammo", NextAction::array(0, new NextAction("switch to melee", ACTION_NORMAL + 1), new NextAction("say::no ammo", ACTION_NORMAL), nullptr)));
|
||||
triggers.push_back(new TriggerNode("has ammo", NextAction::array(0, new NextAction("switch to ranged", ACTION_NORMAL), nullptr)));
|
||||
}
|
||||
|
||||
void HunterPetStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("call pet", 60.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("pet not happy", NextAction::array(0, new NextAction("feed pet", 60.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunters pet low health", NextAction::array(0, new NextAction("mend pet", 60.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunters pet dead", NextAction::array(0, new NextAction("revive pet", 60.0f), nullptr)));
|
||||
}
|
||||
30
src/strategy/hunter/GenericHunterNonCombatStrategy.h
Normal file
30
src/strategy/hunter/GenericHunterNonCombatStrategy.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GENERICHUNTERNONCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICHUNTERNONCOMBATSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericHunterNonCombatStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericHunterNonCombatStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "nc"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class HunterPetStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
HunterPetStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "pet"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
94
src/strategy/hunter/GenericHunterStrategy.cpp
Normal file
94
src/strategy/hunter/GenericHunterStrategy.cpp
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GenericHunterStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericHunterStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericHunterStrategyActionNodeFactory()
|
||||
{
|
||||
creators["rapid fire"] = &rapid_fire;
|
||||
creators["boost"] = &rapid_fire;
|
||||
creators["aspect of the pack"] = &aspect_of_the_pack;
|
||||
creators["feign death"] = &feign_death;
|
||||
creators["wing clip"] = &wing_clip;
|
||||
creators["raptor strike"] = &raptor_strike;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* rapid_fire(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("rapid fire",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("readiness"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* aspect_of_the_pack(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("aspect of the pack",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("aspect of the cheetah"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* feign_death(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("feign death",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* wing_clip(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("wing clip",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("raptor strike"), nullptr),
|
||||
/*C*/ NextAction::array(0, new NextAction("flee"), nullptr));
|
||||
}
|
||||
|
||||
static ActionNode* raptor_strike(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("raptor strike",
|
||||
/*P*/ NextAction::array(0, new NextAction("melee"), nullptr),
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
GenericHunterStrategy::GenericHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericHunterStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("wing clip", ACTION_HIGH), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("feign death", 35.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("hunters pet low health", NextAction::array(0, new NextAction("mend pet", ACTION_HIGH + 2), nullptr)));
|
||||
triggers.push_back(new TriggerNode("switch to melee", NextAction::array(0, new NextAction("switch to melee", ACTION_HIGH + 1), nullptr)));
|
||||
triggers.push_back(new TriggerNode("switch to ranged", NextAction::array(0, new NextAction("switch to ranged", ACTION_HIGH), nullptr)));
|
||||
triggers.push_back(new TriggerNode("no ammo", NextAction::array(0, new NextAction("switch to melee", ACTION_HIGH + 1), new NextAction("say::no ammo", ACTION_HIGH), nullptr)));
|
||||
}
|
||||
|
||||
NextAction** HunterBoostStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("bestial wrath", 15.0f), nullptr);
|
||||
}
|
||||
|
||||
void HunterBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("rapid fire", NextAction::array(0, new NextAction("rapid fire", 16.0f), nullptr)));
|
||||
}
|
||||
|
||||
void HunterCcStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("scare beast", NextAction::array(0, new NextAction("scare beast on cc", ACTION_HIGH + 3), nullptr)));
|
||||
triggers.push_back(new TriggerNode("freezing trap", NextAction::array(0, new NextAction("freezing trap on cc", ACTION_HIGH + 3), nullptr)));
|
||||
}
|
||||
40
src/strategy/hunter/GenericHunterStrategy.h
Normal file
40
src/strategy/hunter/GenericHunterStrategy.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GENERICHUNTERSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICHUNTERSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericHunterStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericHunterStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "hunter"; }
|
||||
};
|
||||
|
||||
class HunterBoostStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
HunterBoostStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "boost"; }
|
||||
NextAction** getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class HunterCcStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
HunterCcStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "cc"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
69
src/strategy/hunter/HunterActions.cpp
Normal file
69
src/strategy/hunter/HunterActions.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "HunterActions.h"
|
||||
#include "Event.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool CastSerpentStingAction::isUseful()
|
||||
{
|
||||
return AI_VALUE2(uint8, "health", "current target") > 50;
|
||||
}
|
||||
|
||||
bool CastViperStingAction::isUseful()
|
||||
{
|
||||
return AI_VALUE2(uint8, "mana", "self target") < 50 && AI_VALUE2(uint8, "mana", "current target") >= 30;
|
||||
}
|
||||
|
||||
bool CastAspectOfTheCheetahAction::isUseful()
|
||||
{
|
||||
return !botAI->HasAnyAuraOf(GetTarget(), "aspect of the cheetah", "aspect of the pack", nullptr);
|
||||
}
|
||||
|
||||
Value<Unit*>* CastFreezingTrap::GetTargetValue()
|
||||
{
|
||||
return context->GetValue<Unit*>("cc target", "freezing trap");
|
||||
}
|
||||
|
||||
bool FeedPetAction::Execute(Event event)
|
||||
{
|
||||
if (Pet* pet = bot->GetPet())
|
||||
if (pet->getPetType() == HUNTER_PET && pet->GetHappinessState() != HAPPY)
|
||||
pet->SetPower(POWER_HAPPINESS, HAPPINESS_LEVEL_SIZE * 2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CastAutoShotAction::isUseful()
|
||||
{
|
||||
if (botAI->IsInVehicle() && !botAI->IsInVehicle(false, false, true))
|
||||
return false;
|
||||
|
||||
return botAI->HasStrategy("ranged", BOT_STATE_COMBAT) && AI_VALUE(uint32, "active spell") != AI_VALUE2(uint32, "spell id", getName());
|
||||
}
|
||||
|
||||
Value<Unit*>* CastScareBeastCcAction::GetTargetValue()
|
||||
{
|
||||
return context->GetValue<Unit*>("cc target", "scare beast");
|
||||
}
|
||||
|
||||
bool CastScareBeastCcAction::Execute(Event event)
|
||||
{
|
||||
return botAI->CastSpell("scare beast", GetTarget());
|
||||
}
|
||||
|
||||
bool CastWingClipAction::isUseful()
|
||||
{
|
||||
return CastMeleeSpellAction::isUseful() && !botAI->HasAura(spell, GetTarget());
|
||||
}
|
||||
|
||||
NextAction** CastWingClipAction::getPrerequisites()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool CastRaptorStrikeAction::isUseful()
|
||||
{
|
||||
return CastMeleeSpellAction::isUseful() && botAI->HasStrategy("close", BOT_STATE_COMBAT);
|
||||
}
|
||||
207
src/strategy/hunter/HunterActions.h
Normal file
207
src/strategy/hunter/HunterActions.h
Normal file
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU 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_HUNTERACTIONS_H
|
||||
#define _PLAYERBOT_HUNTERACTIONS_H
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
class Unit;
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastHuntersMarkAction, "hunter's mark")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
class CastAutoShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastAutoShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "auto shot") { }
|
||||
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastArcaneShotAction, "arcane shot")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastExplosiveShotAction, "explosive shot")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastAimedShotAction, "aimed shot")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastChimeraShotAction, "chimera shot")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
class CastConcussiveShotAction : public CastSnareSpellAction
|
||||
{
|
||||
public:
|
||||
CastConcussiveShotAction(PlayerbotAI* botAI) : CastSnareSpellAction(botAI, "concussive shot") { }
|
||||
};
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastDistractingShotAction, "distracting shot")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastMultiShotAction, "multi-shot")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastVolleyAction, "volley")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastSerpentStingAction, "serpent sting")
|
||||
bool isUseful() override;
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastWyvernStingAction, "wyvern sting")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastViperStingAction, "viper sting")
|
||||
bool isUseful() override;
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastScorpidStingAction, "scorpid sting")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
class CastAspectOfTheHawkAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAspectOfTheHawkAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the hawk") { }
|
||||
};
|
||||
|
||||
class CastAspectOfTheWildAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAspectOfTheWildAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the wild") { }
|
||||
};
|
||||
|
||||
class CastAspectOfTheCheetahAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAspectOfTheCheetahAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the cheetah") { }
|
||||
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastAspectOfThePackAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAspectOfThePackAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the pack") { }
|
||||
};
|
||||
|
||||
class CastAspectOfTheViperAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAspectOfTheViperAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the viper") { }
|
||||
};
|
||||
|
||||
class CastCallPetAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCallPetAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "call pet") { }
|
||||
};
|
||||
|
||||
class CastMendPetAction : public CastAuraSpellAction
|
||||
{
|
||||
public:
|
||||
CastMendPetAction(PlayerbotAI* botAI) : CastAuraSpellAction(botAI, "mend pet") { }
|
||||
|
||||
std::string const GetTargetName() override { return "pet target"; }
|
||||
};
|
||||
|
||||
class CastRevivePetAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastRevivePetAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "revive pet") { }
|
||||
};
|
||||
|
||||
class CastTrueshotAuraAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastTrueshotAuraAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "trueshot aura") { }
|
||||
};
|
||||
|
||||
class CastFeignDeathAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFeignDeathAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "feign death") { }
|
||||
};
|
||||
|
||||
class CastRapidFireAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastRapidFireAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "rapid fire") { }
|
||||
};
|
||||
|
||||
class CastReadinessAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastReadinessAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "readiness") { }
|
||||
};
|
||||
|
||||
class CastBlackArrow : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBlackArrow(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "black arrow") { }
|
||||
};
|
||||
|
||||
class CastFreezingTrap : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFreezingTrap(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "freezing trap") { }
|
||||
|
||||
Value<Unit*>* GetTargetValue() override;
|
||||
};
|
||||
|
||||
class CastWingClipAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastWingClipAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "wing clip") { }
|
||||
|
||||
bool isUseful() override;
|
||||
NextAction** getPrerequisites() override;
|
||||
};
|
||||
|
||||
class CastRaptorStrikeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastRaptorStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "raptor strike") { }
|
||||
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastSerpentStingOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastSerpentStingOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnAttackerAction(botAI, "serpent sting") { }
|
||||
};
|
||||
|
||||
class FeedPetAction : public Action
|
||||
{
|
||||
public:
|
||||
FeedPetAction(PlayerbotAI* botAI) : Action(botAI, "feed pet") { }
|
||||
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class CastBestialWrathAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBestialWrathAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "bestial wrath") { }
|
||||
};
|
||||
|
||||
class CastScareBeastAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastScareBeastAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "scare beast") { }
|
||||
};
|
||||
|
||||
class CastScareBeastCcAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastScareBeastCcAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "scare beast on cc") { }
|
||||
|
||||
Value<Unit*>* GetTargetValue() override;
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
196
src/strategy/hunter/HunterAiObjectContext.cpp
Normal file
196
src/strategy/hunter/HunterAiObjectContext.cpp
Normal file
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU 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 "HunterAiObjectContext.h"
|
||||
#include "DpsHunterStrategy.h"
|
||||
#include "HunterActions.h"
|
||||
#include "HunterBuffStrategies.h"
|
||||
#include "HunterTriggers.h"
|
||||
#include "GenericHunterNonCombatStrategy.h"
|
||||
#include "NamedObjectContext.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class HunterStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
HunterStrategyFactoryInternal()
|
||||
{
|
||||
creators["dps"] = &HunterStrategyFactoryInternal::dps;
|
||||
creators["nc"] = &HunterStrategyFactoryInternal::nc;
|
||||
creators["aoe"] = &HunterStrategyFactoryInternal::aoe;
|
||||
creators["dps debuff"] = &HunterStrategyFactoryInternal::dps_debuff;
|
||||
creators["boost"] = &HunterStrategyFactoryInternal::boost;
|
||||
creators["pet"] = &HunterStrategyFactoryInternal::pet;
|
||||
creators["cc"] = &HunterStrategyFactoryInternal::cc;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* aoe(PlayerbotAI* botAI) { return new DpsAoeHunterStrategy(botAI); }
|
||||
static Strategy* dps(PlayerbotAI* botAI) { return new DpsHunterStrategy(botAI); }
|
||||
static Strategy* nc(PlayerbotAI* botAI) { return new GenericHunterNonCombatStrategy(botAI); }
|
||||
static Strategy* dps_debuff(PlayerbotAI* botAI) { return new DpsHunterDebuffStrategy(botAI); }
|
||||
static Strategy* boost(PlayerbotAI* botAI) { return new HunterBoostStrategy(botAI); }
|
||||
static Strategy* pet(PlayerbotAI* botAI) { return new HunterPetStrategy(botAI); }
|
||||
static Strategy* cc(PlayerbotAI* botAI) { return new HunterCcStrategy(botAI); }
|
||||
};
|
||||
|
||||
class HunterBuffStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
HunterBuffStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
|
||||
{
|
||||
creators["bspeed"] = &HunterBuffStrategyFactoryInternal::bspeed;
|
||||
creators["bdps"] = &HunterBuffStrategyFactoryInternal::bdps;
|
||||
creators["bmana"] = &HunterBuffStrategyFactoryInternal::bmana;
|
||||
creators["rnature"] = &HunterBuffStrategyFactoryInternal::rnature;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* bspeed(PlayerbotAI* botAI) { return new HunterBuffSpeedStrategy(botAI); }
|
||||
static Strategy* bdps(PlayerbotAI* botAI) { return new HunterBuffDpsStrategy(botAI); }
|
||||
static Strategy* bmana(PlayerbotAI* botAI) { return new HunterBuffManaStrategy(botAI); }
|
||||
static Strategy* rnature(PlayerbotAI* botAI) { return new HunterNatureResistanceStrategy(botAI); }
|
||||
};
|
||||
|
||||
class HunterTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
{
|
||||
public:
|
||||
HunterTriggerFactoryInternal()
|
||||
{
|
||||
creators["aspect of the viper"] = &HunterTriggerFactoryInternal::aspect_of_the_viper;
|
||||
creators["black arrow"] = &HunterTriggerFactoryInternal::black_arrow;
|
||||
creators["no stings"] = &HunterTriggerFactoryInternal::NoStings;
|
||||
creators["hunters pet dead"] = &HunterTriggerFactoryInternal::hunters_pet_dead;
|
||||
creators["hunters pet low health"] = &HunterTriggerFactoryInternal::hunters_pet_low_health;
|
||||
creators["hunter's mark"] = &HunterTriggerFactoryInternal::hunters_mark;
|
||||
creators["freezing trap"] = &HunterTriggerFactoryInternal::freezing_trap;
|
||||
creators["aspect of the pack"] = &HunterTriggerFactoryInternal::aspect_of_the_pack;
|
||||
creators["rapid fire"] = &HunterTriggerFactoryInternal::rapid_fire;
|
||||
creators["aspect of the hawk"] = &HunterTriggerFactoryInternal::aspect_of_the_hawk;
|
||||
creators["aspect of the wild"] = &HunterTriggerFactoryInternal::aspect_of_the_wild;
|
||||
creators["aspect of the viper"] = &HunterTriggerFactoryInternal::aspect_of_the_viper;
|
||||
creators["trueshot aura"] = &HunterTriggerFactoryInternal::trueshot_aura;
|
||||
creators["serpent sting on attacker"] = &HunterTriggerFactoryInternal::serpent_sting_on_attacker;
|
||||
creators["pet not happy"] = &HunterTriggerFactoryInternal::pet_not_happy;
|
||||
creators["concussive shot on snare target"] = &HunterTriggerFactoryInternal::concussive_shot_on_snare_target;
|
||||
creators["scare beast"] = &HunterTriggerFactoryInternal::scare_beast;
|
||||
creators["low ammo"] = &HunterTriggerFactoryInternal::low_ammo;
|
||||
creators["no ammo"] = &HunterTriggerFactoryInternal::no_ammo;
|
||||
creators["has ammo"] = &HunterTriggerFactoryInternal::has_ammo;
|
||||
creators["switch to melee"] = &HunterTriggerFactoryInternal::switch_to_melee;
|
||||
creators["switch to ranged"] = &HunterTriggerFactoryInternal::switch_to_ranged;
|
||||
}
|
||||
|
||||
private:
|
||||
static Trigger* scare_beast(PlayerbotAI* botAI) { return new ScareBeastTrigger(botAI); }
|
||||
static Trigger* concussive_shot_on_snare_target(PlayerbotAI* botAI) { return new ConsussiveShotSnareTrigger(botAI); }
|
||||
static Trigger* pet_not_happy(PlayerbotAI* botAI) { return new HunterPetNotHappy(botAI); }
|
||||
static Trigger* serpent_sting_on_attacker(PlayerbotAI* botAI) { return new SerpentStingOnAttackerTrigger(botAI); }
|
||||
static Trigger* trueshot_aura(PlayerbotAI* botAI) { return new TrueshotAuraTrigger(botAI); }
|
||||
static Trigger* aspect_of_the_viper(PlayerbotAI* botAI) { return new HunterAspectOfTheViperTrigger(botAI); }
|
||||
static Trigger* black_arrow(PlayerbotAI* botAI) { return new BlackArrowTrigger(botAI); }
|
||||
static Trigger* NoStings(PlayerbotAI* botAI) { return new HunterNoStingsActiveTrigger(botAI); }
|
||||
static Trigger* hunters_pet_dead(PlayerbotAI* botAI) { return new HuntersPetDeadTrigger(botAI); }
|
||||
static Trigger* hunters_pet_low_health(PlayerbotAI* botAI) { return new HuntersPetLowHealthTrigger(botAI); }
|
||||
static Trigger* hunters_mark(PlayerbotAI* botAI) { return new HuntersMarkTrigger(botAI); }
|
||||
static Trigger* freezing_trap(PlayerbotAI* botAI) { return new FreezingTrapTrigger(botAI); }
|
||||
static Trigger* aspect_of_the_pack(PlayerbotAI* botAI) { return new HunterAspectOfThePackTrigger(botAI); }
|
||||
static Trigger* rapid_fire(PlayerbotAI* botAI) { return new RapidFireTrigger(botAI); }
|
||||
static Trigger* aspect_of_the_hawk(PlayerbotAI* botAI) { return new HunterAspectOfTheHawkTrigger(botAI); }
|
||||
static Trigger* aspect_of_the_wild(PlayerbotAI* botAI) { return new HunterAspectOfTheWildTrigger(botAI); }
|
||||
static Trigger* low_ammo(PlayerbotAI* botAI) { return new HunterLowAmmoTrigger(botAI); }
|
||||
static Trigger* no_ammo(PlayerbotAI* botAI) { return new HunterNoAmmoTrigger(botAI); }
|
||||
static Trigger* has_ammo(PlayerbotAI* botAI) { return new HunterHasAmmoTrigger(botAI); }
|
||||
static Trigger* switch_to_melee(PlayerbotAI* botAI) { return new SwitchToMeleeTrigger(botAI); }
|
||||
static Trigger* switch_to_ranged(PlayerbotAI* botAI) { return new SwitchToRangedTrigger(botAI); }
|
||||
};
|
||||
|
||||
class HunterAiObjectContextInternal : public NamedObjectContext<Action>
|
||||
{
|
||||
public:
|
||||
HunterAiObjectContextInternal()
|
||||
{
|
||||
creators["auto shot"] = &HunterAiObjectContextInternal::auto_shot;
|
||||
creators["aimed shot"] = &HunterAiObjectContextInternal::aimed_shot;
|
||||
creators["chimera shot"] = &HunterAiObjectContextInternal::chimera_shot;
|
||||
creators["explosive shot"] = &HunterAiObjectContextInternal::explosive_shot;
|
||||
creators["arcane shot"] = &HunterAiObjectContextInternal::arcane_shot;
|
||||
creators["concussive shot"] = &HunterAiObjectContextInternal::concussive_shot;
|
||||
creators["distracting shot"] = &HunterAiObjectContextInternal::distracting_shot;
|
||||
creators["multi-shot"] = &HunterAiObjectContextInternal::multi_shot;
|
||||
creators["volley"] = &HunterAiObjectContextInternal::volley;
|
||||
creators["serpent sting"] = &HunterAiObjectContextInternal::serpent_sting;
|
||||
creators["serpent sting on attacker"] = &HunterAiObjectContextInternal::serpent_sting_on_attacker;
|
||||
creators["wyvern sting"] = &HunterAiObjectContextInternal::wyvern_sting;
|
||||
creators["viper sting"] = &HunterAiObjectContextInternal::viper_sting;
|
||||
creators["scorpid sting"] = &HunterAiObjectContextInternal::scorpid_sting;
|
||||
creators["hunter's mark"] = &HunterAiObjectContextInternal::hunters_mark;
|
||||
creators["mend pet"] = &HunterAiObjectContextInternal::mend_pet;
|
||||
creators["revive pet"] = &HunterAiObjectContextInternal::revive_pet;
|
||||
creators["call pet"] = &HunterAiObjectContextInternal::call_pet;
|
||||
creators["black arrow"] = &HunterAiObjectContextInternal::black_arrow;
|
||||
creators["freezing trap"] = &HunterAiObjectContextInternal::freezing_trap;
|
||||
creators["rapid fire"] = &HunterAiObjectContextInternal::rapid_fire;
|
||||
creators["boost"] = &HunterAiObjectContextInternal::rapid_fire;
|
||||
creators["readiness"] = &HunterAiObjectContextInternal::readiness;
|
||||
creators["aspect of the hawk"] = &HunterAiObjectContextInternal::aspect_of_the_hawk;
|
||||
creators["aspect of the wild"] = &HunterAiObjectContextInternal::aspect_of_the_wild;
|
||||
creators["aspect of the viper"] = &HunterAiObjectContextInternal::aspect_of_the_viper;
|
||||
creators["aspect of the pack"] = &HunterAiObjectContextInternal::aspect_of_the_pack;
|
||||
creators["aspect of the cheetah"] = &HunterAiObjectContextInternal::aspect_of_the_cheetah;
|
||||
creators["trueshot aura"] = &HunterAiObjectContextInternal::trueshot_aura;
|
||||
creators["feign death"] = &HunterAiObjectContextInternal::feign_death;
|
||||
creators["wing clip"] = &HunterAiObjectContextInternal::wing_clip;
|
||||
creators["raptor strike"] = &HunterAiObjectContextInternal::raptor_strike;
|
||||
creators["feed pet"] = &HunterAiObjectContextInternal::feed_pet;
|
||||
creators["bestial wrath"] = &HunterAiObjectContextInternal::bestial_wrath;
|
||||
creators["scare beast"] = &HunterAiObjectContextInternal::scare_beast;
|
||||
creators["scare beast on cc"] = &HunterAiObjectContextInternal::scare_beast_on_cc;
|
||||
}
|
||||
|
||||
private:
|
||||
static Action* scare_beast(PlayerbotAI* botAI) { return new CastScareBeastAction(botAI); }
|
||||
static Action* scare_beast_on_cc(PlayerbotAI* botAI) { return new CastScareBeastCcAction(botAI); }
|
||||
static Action* bestial_wrath(PlayerbotAI* botAI) { return new CastBestialWrathAction(botAI); }
|
||||
static Action* feed_pet(PlayerbotAI* botAI) { return new FeedPetAction(botAI); }
|
||||
static Action* feign_death(PlayerbotAI* botAI) { return new CastFeignDeathAction(botAI); }
|
||||
static Action* trueshot_aura(PlayerbotAI* botAI) { return new CastTrueshotAuraAction(botAI); }
|
||||
static Action* auto_shot(PlayerbotAI* botAI) { return new CastAutoShotAction(botAI); }
|
||||
static Action* aimed_shot(PlayerbotAI* botAI) { return new CastAimedShotAction(botAI); }
|
||||
static Action* chimera_shot(PlayerbotAI* botAI) { return new CastChimeraShotAction(botAI); }
|
||||
static Action* explosive_shot(PlayerbotAI* botAI) { return new CastExplosiveShotAction(botAI); }
|
||||
static Action* arcane_shot(PlayerbotAI* botAI) { return new CastArcaneShotAction(botAI); }
|
||||
static Action* concussive_shot(PlayerbotAI* botAI) { return new CastConcussiveShotAction(botAI); }
|
||||
static Action* distracting_shot(PlayerbotAI* botAI) { return new CastDistractingShotAction(botAI); }
|
||||
static Action* multi_shot(PlayerbotAI* botAI) { return new CastMultiShotAction(botAI); }
|
||||
static Action* volley(PlayerbotAI* botAI) { return new CastVolleyAction(botAI); }
|
||||
static Action* serpent_sting(PlayerbotAI* botAI) { return new CastSerpentStingAction(botAI); }
|
||||
static Action* serpent_sting_on_attacker(PlayerbotAI* botAI) { return new CastSerpentStingOnAttackerAction(botAI); }
|
||||
static Action* wyvern_sting(PlayerbotAI* botAI) { return new CastWyvernStingAction(botAI); }
|
||||
static Action* viper_sting(PlayerbotAI* botAI) { return new CastViperStingAction(botAI); }
|
||||
static Action* scorpid_sting(PlayerbotAI* botAI) { return new CastScorpidStingAction(botAI); }
|
||||
static Action* hunters_mark(PlayerbotAI* botAI) { return new CastHuntersMarkAction(botAI); }
|
||||
static Action* mend_pet(PlayerbotAI* botAI) { return new CastMendPetAction(botAI); }
|
||||
static Action* revive_pet(PlayerbotAI* botAI) { return new CastRevivePetAction(botAI); }
|
||||
static Action* call_pet(PlayerbotAI* botAI) { return new CastCallPetAction(botAI); }
|
||||
static Action* black_arrow(PlayerbotAI* botAI) { return new CastBlackArrow(botAI); }
|
||||
static Action* freezing_trap(PlayerbotAI* botAI) { return new CastFreezingTrap(botAI); }
|
||||
static Action* rapid_fire(PlayerbotAI* botAI) { return new CastRapidFireAction(botAI); }
|
||||
static Action* readiness(PlayerbotAI* botAI) { return new CastReadinessAction(botAI); }
|
||||
static Action* aspect_of_the_hawk(PlayerbotAI* botAI) { return new CastAspectOfTheHawkAction(botAI); }
|
||||
static Action* aspect_of_the_wild(PlayerbotAI* botAI) { return new CastAspectOfTheWildAction(botAI); }
|
||||
static Action* aspect_of_the_viper(PlayerbotAI* botAI) { return new CastAspectOfTheViperAction(botAI); }
|
||||
static Action* aspect_of_the_pack(PlayerbotAI* botAI) { return new CastAspectOfThePackAction(botAI); }
|
||||
static Action* aspect_of_the_cheetah(PlayerbotAI* botAI) { return new CastAspectOfTheCheetahAction(botAI); }
|
||||
static Action* wing_clip(PlayerbotAI* botAI) { return new CastWingClipAction(botAI); }
|
||||
static Action* raptor_strike(PlayerbotAI* botAI) { return new CastRaptorStrikeAction(botAI); }
|
||||
};
|
||||
|
||||
HunterAiObjectContext::HunterAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)
|
||||
{
|
||||
strategyContexts.Add(new HunterStrategyFactoryInternal());
|
||||
strategyContexts.Add(new HunterBuffStrategyFactoryInternal());
|
||||
actionContexts.Add(new HunterAiObjectContextInternal());
|
||||
triggerContexts.Add(new HunterTriggerFactoryInternal());
|
||||
}
|
||||
18
src/strategy/hunter/HunterAiObjectContext.h
Normal file
18
src/strategy/hunter/HunterAiObjectContext.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_HUNTERAIOBJECTCONTEXT_H
|
||||
#define _PLAYERBOT_HUNTERAIOBJECTCONTEXT_H
|
||||
|
||||
#include "AiObjectContext.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class HunterAiObjectContext : public AiObjectContext
|
||||
{
|
||||
public:
|
||||
HunterAiObjectContext(PlayerbotAI* botAI);
|
||||
};
|
||||
|
||||
#endif
|
||||
26
src/strategy/hunter/HunterBuffStrategies.cpp
Normal file
26
src/strategy/hunter/HunterBuffStrategies.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "HunterBuffStrategies.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void HunterBuffDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("aspect of the hawk", NextAction::array(0, new NextAction("aspect of the hawk", 90.0f), nullptr)));
|
||||
}
|
||||
|
||||
void HunterNatureResistanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("aspect of the wild", NextAction::array(0, new NextAction("aspect of the wild", 90.0f), nullptr)));
|
||||
}
|
||||
|
||||
void HunterBuffSpeedStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("aspect of the pack", NextAction::array(0, new NextAction("aspect of the pack", 10.0f), nullptr)));
|
||||
}
|
||||
|
||||
void HunterBuffManaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("aspect of the viper", NextAction::array(0, new NextAction("aspect of the viper", 10.0f), nullptr)));
|
||||
}
|
||||
48
src/strategy/hunter/HunterBuffStrategies.h
Normal file
48
src/strategy/hunter/HunterBuffStrategies.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU 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_HUNTERBUFFSTRATEGIES_H
|
||||
#define _PLAYERBOT_HUNTERBUFFSTRATEGIES_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class HunterBuffSpeedStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
HunterBuffSpeedStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "bspeed"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class HunterBuffManaStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
HunterBuffManaStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "bmana"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class HunterBuffDpsStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
HunterBuffDpsStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "bdps"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class HunterNatureResistanceStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
HunterNatureResistanceStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "rnature"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
65
src/strategy/hunter/HunterTriggers.cpp
Normal file
65
src/strategy/hunter/HunterTriggers.cpp
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU 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 "HunterTriggers.h"
|
||||
#include "HunterActions.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
|
||||
bool HunterNoStingsActiveTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return target && AI_VALUE2(uint8, "health", "current target") > 40 && !botAI->HasAura("serpent sting", target) &&
|
||||
!botAI->HasAura("scorpid sting", target) && !botAI->HasAura("viper sting", target);
|
||||
}
|
||||
|
||||
bool HuntersPetDeadTrigger::IsActive()
|
||||
{
|
||||
return AI_VALUE(bool, "pet dead") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
}
|
||||
|
||||
bool HuntersPetLowHealthTrigger::IsActive()
|
||||
{
|
||||
Unit* pet = AI_VALUE(Unit*, "pet target");
|
||||
return pet && AI_VALUE2(uint8, "health", "pet target") < 40 && !AI_VALUE2(bool, "dead", "pet target") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
}
|
||||
|
||||
bool HunterPetNotHappy::IsActive()
|
||||
{
|
||||
return !AI_VALUE(bool, "pet happy") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
}
|
||||
|
||||
bool HunterAspectOfTheViperTrigger::IsActive()
|
||||
{
|
||||
return SpellTrigger::IsActive() && !botAI->HasAura(spell, GetTarget());
|
||||
}
|
||||
|
||||
bool HunterAspectOfThePackTrigger::IsActive()
|
||||
{
|
||||
return BuffTrigger::IsActive() && !botAI->HasAura("aspect of the cheetah", GetTarget());
|
||||
};
|
||||
|
||||
bool HunterLowAmmoTrigger::IsActive()
|
||||
{
|
||||
return bot->GetGroup() && (AI_VALUE2(uint32, "item count", "ammo") < 100) && (AI_VALUE2(uint32, "item count", "ammo") > 0);
|
||||
}
|
||||
|
||||
bool HunterHasAmmoTrigger::IsActive()
|
||||
{
|
||||
return !AmmoCountTrigger::IsActive();
|
||||
}
|
||||
|
||||
bool SwitchToRangedTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return botAI->HasStrategy("close", BOT_STATE_COMBAT) && target && (target->GetVictim() != bot ||
|
||||
sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "current target"), 8.0f));
|
||||
}
|
||||
|
||||
bool SwitchToMeleeTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return botAI->HasStrategy("ranged", BOT_STATE_COMBAT) && target && (target->GetVictim() == bot ||
|
||||
sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "current target"), 8.0f));
|
||||
}
|
||||
138
src/strategy/hunter/HunterTriggers.h
Normal file
138
src/strategy/hunter/HunterTriggers.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU 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_HUNTERTRIGGERS_H
|
||||
#define _PLAYERBOT_HUNTERTRIGGERS_H
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
BEGIN_TRIGGER(HunterNoStingsActiveTrigger, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
class HunterAspectOfTheHawkTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
HunterAspectOfTheHawkTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "aspect of the hawk") { }
|
||||
};
|
||||
|
||||
class HunterAspectOfTheWildTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
HunterAspectOfTheWildTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "aspect of the wild") { }
|
||||
};
|
||||
|
||||
class HunterAspectOfTheViperTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
HunterAspectOfTheViperTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "aspect of the viper") { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class HunterAspectOfThePackTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
HunterAspectOfThePackTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "aspect of the pack") { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
BEGIN_TRIGGER(HuntersPetDeadTrigger, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
BEGIN_TRIGGER(HuntersPetLowHealthTrigger, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
class BlackArrowTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
BlackArrowTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "black arrow") { }
|
||||
};
|
||||
|
||||
class HuntersMarkTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
HuntersMarkTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "hunter's mark") { }
|
||||
};
|
||||
|
||||
class FreezingTrapTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
FreezingTrapTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "freezing trap") { }
|
||||
};
|
||||
|
||||
class RapidFireTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
RapidFireTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "rapid fire") { }
|
||||
};
|
||||
|
||||
class TrueshotAuraTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
TrueshotAuraTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "trueshot aura") { }
|
||||
};
|
||||
|
||||
class SerpentStingOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
SerpentStingOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "serpent sting") { }
|
||||
};
|
||||
|
||||
BEGIN_TRIGGER(HunterPetNotHappy, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
class ConsussiveShotSnareTrigger : public SnareTargetTrigger
|
||||
{
|
||||
public:
|
||||
ConsussiveShotSnareTrigger(PlayerbotAI* botAI) : SnareTargetTrigger(botAI, "concussive shot") { }
|
||||
};
|
||||
|
||||
class ScareBeastTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
ScareBeastTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "scare beast") { }
|
||||
};
|
||||
|
||||
class HunterLowAmmoTrigger : public AmmoCountTrigger
|
||||
{
|
||||
public:
|
||||
HunterLowAmmoTrigger(PlayerbotAI* botAI) : AmmoCountTrigger(botAI, "ammo", 1, 30) { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class HunterNoAmmoTrigger : public AmmoCountTrigger
|
||||
{
|
||||
public:
|
||||
HunterNoAmmoTrigger(PlayerbotAI* botAI) : AmmoCountTrigger(botAI, "ammo", 1, 10) { }
|
||||
};
|
||||
|
||||
class HunterHasAmmoTrigger : public AmmoCountTrigger
|
||||
{
|
||||
public:
|
||||
HunterHasAmmoTrigger(PlayerbotAI* botAI) : AmmoCountTrigger(botAI, "ammo", 1, 10) { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class SwitchToRangedTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
SwitchToRangedTrigger(PlayerbotAI* botAI) : Trigger(botAI, "switch to ranged") { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class SwitchToMeleeTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
SwitchToMeleeTrigger(PlayerbotAI* botAI) : Trigger(botAI, "switch to melee") { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user