mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-27 07:26:23 +00:00
[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)
This commit is contained in:
109
src/Ai/Class/Hunter/Action/HunterActions.cpp
Normal file
109
src/Ai/Class/Hunter/Action/HunterActions.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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 "HunterActions.h"
|
||||
|
||||
#include "Event.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool CastViperStingAction::isUseful()
|
||||
{
|
||||
return CastAuraSpellAction::isUseful() && 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);
|
||||
}
|
||||
|
||||
bool CastAspectOfTheHawkAction::isUseful()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
if (bot->HasSpell(61846) || bot->HasSpell(61847)) // Aspect of the Dragonhawk spell IDs
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CastArcaneShotAction::isUseful()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
if (bot->HasSpell(53301) || bot->HasSpell(60051) || bot->HasSpell(60052) || bot->HasSpell(60053)) // Explosive Shot spell IDs
|
||||
return false;
|
||||
|
||||
// Armor Penetration rating check - will not cast Arcane Shot above 435 ArP
|
||||
int32 armorPenRating = bot->GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1) + bot->GetUInt32Value(CR_ARMOR_PENETRATION);
|
||||
if (armorPenRating > 435)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CastImmolationTrapAction::isUseful()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
if (bot->HasSpell(13813) || bot->HasSpell(14316) || bot->HasSpell(14317) || bot->HasSpell(27025) || bot->HasSpell(49066) || bot->HasSpell(49067)) // Explosive Trap spell IDs
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
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, pet->GetMaxPower(Powers(POWER_HAPPINESS)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CastAutoShotAction::isUseful()
|
||||
{
|
||||
if (botAI->IsInVehicle() && !botAI->IsInVehicle(false, false, true))
|
||||
return false;
|
||||
|
||||
if (AI_VALUE(Unit*, "current target") && bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL) &&
|
||||
bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)->m_targets.GetUnitTargetGUID() ==
|
||||
AI_VALUE(Unit*, "current target")->GetGUID())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return AI_VALUE(uint32, "active spell") != AI_VALUE2(uint32, "spell id", getName());
|
||||
}
|
||||
|
||||
bool CastDisengageAction::Execute(Event event)
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
if (!target)
|
||||
return false;
|
||||
// can cast spell check passed in isUseful()
|
||||
bot->SetOrientation(bot->GetAngle(target));
|
||||
return CastSpellAction::Execute(event);
|
||||
}
|
||||
|
||||
bool CastDisengageAction::isUseful()
|
||||
{
|
||||
return !botAI->HasStrategy("trap weave", BOT_STATE_COMBAT);
|
||||
}
|
||||
|
||||
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 CastSpellAction::isUseful() && !botAI->HasAura(spell, GetTarget()); }
|
||||
|
||||
std::vector<NextAction> CastWingClipAction::getPrerequisites()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
451
src/Ai/Class/Hunter/Action/HunterActions.h
Normal file
451
src/Ai/Class/Hunter/Action/HunterActions.h
Normal file
@@ -0,0 +1,451 @@
|
||||
/*
|
||||
* 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_HUNTERACTIONS_H
|
||||
#define _PLAYERBOT_HUNTERACTIONS_H
|
||||
|
||||
#include "AiObject.h"
|
||||
#include "Event.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "Unit.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
class Unit;
|
||||
|
||||
// Buff and Out of Combat Spells
|
||||
|
||||
class CastTrueshotAuraAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastTrueshotAuraAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "trueshot aura") {}
|
||||
};
|
||||
|
||||
class CastAspectOfTheHawkAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAspectOfTheHawkAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the hawk") {}
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastAspectOfTheMonkeyAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAspectOfTheMonkeyAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the monkey") {}
|
||||
};
|
||||
|
||||
class CastAspectOfTheDragonhawkAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAspectOfTheDragonhawkAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the dragonhawk") {}
|
||||
};
|
||||
|
||||
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") {}
|
||||
};
|
||||
|
||||
// Cooldown Spells
|
||||
|
||||
class CastRapidFireAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastRapidFireAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "rapid fire") {}
|
||||
};
|
||||
|
||||
class CastDeterrenceAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDeterrenceAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "deterrence") {}
|
||||
};
|
||||
|
||||
class CastReadinessAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastReadinessAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "readiness") {}
|
||||
};
|
||||
|
||||
class CastDisengageAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDisengageAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "disengage") {}
|
||||
|
||||
bool Execute(Event event) override;
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
// CC Spells
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
class CastFreezingTrap : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFreezingTrap(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "freezing trap") {}
|
||||
|
||||
Value<Unit*>* GetTargetValue() override;
|
||||
};
|
||||
|
||||
class CastWyvernStingAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastWyvernStingAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "wyvern sting", true) {}
|
||||
};
|
||||
|
||||
class CastSilencingShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastSilencingShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "silencing shot") {}
|
||||
};
|
||||
|
||||
class CastConcussiveShotAction : public CastSnareSpellAction
|
||||
{
|
||||
public:
|
||||
CastConcussiveShotAction(PlayerbotAI* botAI) : CastSnareSpellAction(botAI, "concussive shot") {}
|
||||
};
|
||||
|
||||
class CastIntimidationAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastIntimidationAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "intimidation", false, 5000) {}
|
||||
std::string const GetTargetName() override { return "pet target"; }
|
||||
};
|
||||
|
||||
// Threat Spells
|
||||
|
||||
class CastDistractingShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDistractingShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "distracting shot") {}
|
||||
};
|
||||
|
||||
class CastMisdirectionOnMainTankAction : public BuffOnMainTankAction
|
||||
{
|
||||
public:
|
||||
CastMisdirectionOnMainTankAction(PlayerbotAI* ai) : BuffOnMainTankAction(ai, "misdirection", true) {}
|
||||
};
|
||||
|
||||
class CastFeignDeathAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFeignDeathAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "feign death") {}
|
||||
};
|
||||
|
||||
// Pet Spells
|
||||
|
||||
class FeedPetAction : public Action
|
||||
{
|
||||
public:
|
||||
FeedPetAction(PlayerbotAI* botAI) : Action(botAI, "feed pet") {}
|
||||
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
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 CastKillCommandAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastKillCommandAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "kill command", false, 5000) {}
|
||||
std::string const GetTargetName() override { return "pet target"; }
|
||||
};
|
||||
|
||||
class CastBestialWrathAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBestialWrathAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "bestial wrath", false, 5000) {}
|
||||
std::string const GetTargetName() override { return "pet target"; }
|
||||
};
|
||||
|
||||
// Direct Damage Spells
|
||||
|
||||
class CastAutoShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastAutoShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "auto shot") {}
|
||||
ActionThreatType getThreatType() override { return ActionThreatType::None; }
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastArcaneShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastArcaneShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "arcane shot") {}
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastAimedShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastAimedShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "aimed shot") {}
|
||||
};
|
||||
|
||||
class CastChimeraShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastChimeraShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "chimera shot") {}
|
||||
};
|
||||
|
||||
class CastSteadyShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastSteadyShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "steady shot") {}
|
||||
};
|
||||
|
||||
class CastKillShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastKillShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "kill shot") {}
|
||||
};
|
||||
|
||||
// DoT/Debuff Spells
|
||||
|
||||
class CastHuntersMarkAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastHuntersMarkAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "hunter's mark") {}
|
||||
bool isUseful() override
|
||||
{
|
||||
// Bypass TTL check
|
||||
return CastAuraSpellAction::isUseful();
|
||||
}
|
||||
};
|
||||
|
||||
class CastTranquilizingShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastTranquilizingShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "tranquilizing shot") {}
|
||||
};
|
||||
|
||||
class CastViperStingAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastViperStingAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "viper sting", true) {}
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastSerpentStingAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSerpentStingAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "serpent sting", true) {}
|
||||
bool isUseful() override
|
||||
{
|
||||
// Bypass TTL check
|
||||
return CastAuraSpellAction::isUseful();
|
||||
}
|
||||
};
|
||||
|
||||
class CastScorpidStingAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastScorpidStingAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "scorpid sting", true) {}
|
||||
bool isUseful() override
|
||||
{
|
||||
// Bypass TTL check
|
||||
return CastAuraSpellAction::isUseful();
|
||||
}
|
||||
};
|
||||
|
||||
class CastSerpentStingOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastSerpentStingOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnAttackerAction(botAI, "serpent sting", true) {}
|
||||
bool isUseful() override
|
||||
{
|
||||
// Bypass TTL check
|
||||
return CastAuraSpellAction::isUseful();
|
||||
}
|
||||
};
|
||||
|
||||
class CastImmolationTrapAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastImmolationTrapAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "immolation trap") {}
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastExplosiveTrapAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastExplosiveTrapAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "explosive trap") {}
|
||||
};
|
||||
|
||||
class CastBlackArrow : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBlackArrow(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "black arrow", true) {}
|
||||
bool isUseful() override
|
||||
{
|
||||
if (botAI->HasStrategy("trap weave", BOT_STATE_COMBAT))
|
||||
return false;
|
||||
// Bypass TTL check
|
||||
return CastAuraSpellAction::isUseful();
|
||||
}
|
||||
};
|
||||
|
||||
class CastExplosiveShotAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastExplosiveShotAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {}
|
||||
bool isUseful() override
|
||||
{
|
||||
// Bypass TTL check
|
||||
return CastAuraSpellAction::isUseful();
|
||||
}
|
||||
};
|
||||
|
||||
// Rank 4
|
||||
class CastExplosiveShotRank4Action : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastExplosiveShotRank4Action(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {}
|
||||
|
||||
bool Execute(Event event) override { return botAI->CastSpell(60053, GetTarget()); }
|
||||
bool isUseful() override
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
return !target->HasAura(60053);
|
||||
}
|
||||
};
|
||||
|
||||
// Rank 3
|
||||
class CastExplosiveShotRank3Action : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastExplosiveShotRank3Action(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {}
|
||||
|
||||
bool Execute(Event event) override { return botAI->CastSpell(60052, GetTarget()); }
|
||||
bool isUseful() override
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
return !target->HasAura(60052);
|
||||
}
|
||||
};
|
||||
|
||||
// Rank 2
|
||||
class CastExplosiveShotRank2Action : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastExplosiveShotRank2Action(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {}
|
||||
|
||||
bool Execute(Event event) override { return botAI->CastSpell(60051, GetTarget()); }
|
||||
bool isUseful() override
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
return !target->HasAura(60051);
|
||||
}
|
||||
};
|
||||
|
||||
// Rank 1
|
||||
class CastExplosiveShotRank1Action : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastExplosiveShotRank1Action(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {}
|
||||
|
||||
bool Execute(Event event) override { return botAI->CastSpell(53301, GetTarget()); }
|
||||
bool isUseful() override
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
return !target->HasAura(53301);
|
||||
}
|
||||
};
|
||||
|
||||
// Melee Spells
|
||||
|
||||
class CastWingClipAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastWingClipAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "wing clip") {}
|
||||
|
||||
bool isUseful() override;
|
||||
std::vector<NextAction> getPrerequisites() override;
|
||||
};
|
||||
|
||||
class CastRaptorStrikeAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastRaptorStrikeAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "raptor strike") {}
|
||||
};
|
||||
|
||||
class CastMongooseBiteAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastMongooseBiteAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "mongoose bite") {}
|
||||
};
|
||||
|
||||
// AoE Spells
|
||||
|
||||
class CastMultiShotAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastMultiShotAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "multi-shot") {}
|
||||
};
|
||||
|
||||
class CastVolleyAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastVolleyAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "volley") {}
|
||||
ActionThreatType getThreatType() override { return ActionThreatType::Aoe; }
|
||||
};
|
||||
|
||||
#endif
|
||||
307
src/Ai/Class/Hunter/HunterAiObjectContext.cpp
Normal file
307
src/Ai/Class/Hunter/HunterAiObjectContext.cpp
Normal file
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
* 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 "HunterAiObjectContext.h"
|
||||
|
||||
#include "BeastMasteryHunterStrategy.h"
|
||||
#include "GenericHunterNonCombatStrategy.h"
|
||||
#include "GenericHunterStrategy.h"
|
||||
#include "HunterActions.h"
|
||||
#include "HunterBuffStrategies.h"
|
||||
#include "HunterTriggers.h"
|
||||
#include "MarksmanshipHunterStrategy.h"
|
||||
#include "NamedObjectContext.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SurvivalHunterStrategy.h"
|
||||
|
||||
class HunterStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
HunterStrategyFactoryInternal()
|
||||
{
|
||||
creators["nc"] = &HunterStrategyFactoryInternal::nc;
|
||||
creators["boost"] = &HunterStrategyFactoryInternal::boost;
|
||||
creators["pet"] = &HunterStrategyFactoryInternal::pet;
|
||||
creators["cc"] = &HunterStrategyFactoryInternal::cc;
|
||||
creators["trap weave"] = &HunterStrategyFactoryInternal::trap_weave;
|
||||
creators["bm"] = &HunterStrategyFactoryInternal::beast_mastery;
|
||||
creators["mm"] = &HunterStrategyFactoryInternal::marksmanship;
|
||||
creators["surv"] = &HunterStrategyFactoryInternal::survival;
|
||||
creators["aoe"] = &HunterStrategyFactoryInternal::aoe;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* nc(PlayerbotAI* botAI) { return new GenericHunterNonCombatStrategy(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); }
|
||||
static Strategy* trap_weave(PlayerbotAI* botAI) { return new HunterTrapWeaveStrategy(botAI); }
|
||||
static Strategy* beast_mastery(PlayerbotAI* botAI) { return new BeastMasteryHunterStrategy(botAI); }
|
||||
static Strategy* marksmanship(PlayerbotAI* botAI) { return new MarksmanshipHunterStrategy(botAI); }
|
||||
static Strategy* survival(PlayerbotAI* botAI) { return new SurvivalHunterStrategy(botAI); }
|
||||
static Strategy* aoe(PlayerbotAI* botAI) { return new AoEHunterStrategy(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["hunters pet medium health"] = &HunterTriggerFactoryInternal::hunters_pet_medium_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 monkey"] = &HunterTriggerFactoryInternal::aspect_of_the_monkey;
|
||||
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["no track"] = &HunterTriggerFactoryInternal::no_track;
|
||||
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;
|
||||
creators["misdirection on main tank"] = &HunterTriggerFactoryInternal::misdirection_on_main_tank;
|
||||
creators["tranquilizing shot enrage"] = &HunterTriggerFactoryInternal::remove_enrage;
|
||||
creators["tranquilizing shot magic"] = &HunterTriggerFactoryInternal::remove_magic;
|
||||
creators["immolation trap no cd"] = &HunterTriggerFactoryInternal::immolation_trap_no_cd;
|
||||
creators["kill command"] = &HunterTriggerFactoryInternal::kill_command;
|
||||
creators["explosive shot"] = &HunterTriggerFactoryInternal::explosive_shot;
|
||||
creators["lock and load"] = &HunterTriggerFactoryInternal::lock_and_load;
|
||||
creators["silencing shot"] = &HunterTriggerFactoryInternal::silencing_shot;
|
||||
creators["intimidation"] = &HunterTriggerFactoryInternal::intimidation;
|
||||
creators["volley channel check"] = &HunterTriggerFactoryInternal::volley_channel_check;
|
||||
}
|
||||
|
||||
private:
|
||||
static Trigger* auto_shot(PlayerbotAI* botAI) { return new AutoShotTrigger(botAI); }
|
||||
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* no_track(PlayerbotAI* botAI) { return new NoTrackTrigger(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_pet_medium_health(PlayerbotAI* botAI) { return new HuntersPetMediumHealthTrigger(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_monkey(PlayerbotAI* botAI) { return new HunterAspectOfTheMonkeyTrigger(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); }
|
||||
static Trigger* misdirection_on_main_tank(PlayerbotAI* ai) { return new MisdirectionOnMainTankTrigger(ai); }
|
||||
static Trigger* remove_enrage(PlayerbotAI* ai) { return new TargetRemoveEnrageTrigger(ai); }
|
||||
static Trigger* remove_magic(PlayerbotAI* ai) { return new TargetRemoveMagicTrigger(ai); }
|
||||
static Trigger* immolation_trap_no_cd(PlayerbotAI* ai) { return new ImmolationTrapNoCdTrigger(ai); }
|
||||
static Trigger* kill_command(PlayerbotAI* botAI) { return new KillCommandTrigger(botAI); }
|
||||
static Trigger* explosive_shot(PlayerbotAI* botAI) { return new ExplosiveShotTrigger(botAI); }
|
||||
static Trigger* lock_and_load(PlayerbotAI* botAI) { return new LockAndLoadTrigger(botAI); }
|
||||
static Trigger* silencing_shot(PlayerbotAI* botAI) { return new SilencingShotTrigger(botAI); }
|
||||
static Trigger* intimidation(PlayerbotAI* botAI) { return new IntimidationTrigger(botAI); }
|
||||
static Trigger* volley_channel_check(PlayerbotAI* botAI) { return new VolleyChannelCheckTrigger(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["kill command"] = &HunterAiObjectContextInternal::kill_command;
|
||||
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["deterrence"] = &HunterAiObjectContextInternal::deterrence;
|
||||
creators["readiness"] = &HunterAiObjectContextInternal::readiness;
|
||||
creators["aspect of the hawk"] = &HunterAiObjectContextInternal::aspect_of_the_hawk;
|
||||
creators["aspect of the monkey"] = &HunterAiObjectContextInternal::aspect_of_the_monkey;
|
||||
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["track humanoids"] = &HunterAiObjectContextInternal::track_humanoids;
|
||||
creators["feign death"] = &HunterAiObjectContextInternal::feign_death;
|
||||
creators["wing clip"] = &HunterAiObjectContextInternal::wing_clip;
|
||||
creators["raptor strike"] = &HunterAiObjectContextInternal::raptor_strike;
|
||||
creators["mongoose bite"] = &HunterAiObjectContextInternal::mongoose_bite;
|
||||
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;
|
||||
creators["aspect of the dragonhawk"] = &HunterAiObjectContextInternal::aspect_of_the_dragonhawk;
|
||||
creators["tranquilizing shot"] = &HunterAiObjectContextInternal::tranquilizing_shot;
|
||||
creators["steady shot"] = &HunterAiObjectContextInternal::steady_shot;
|
||||
creators["kill shot"] = &HunterAiObjectContextInternal::kill_shot;
|
||||
creators["misdirection on main tank"] = &HunterAiObjectContextInternal::misdirection_on_main_tank;
|
||||
creators["silencing shot"] = &HunterAiObjectContextInternal::silencing_shot;
|
||||
creators["disengage"] = &HunterAiObjectContextInternal::disengage;
|
||||
creators["immolation trap"] = &HunterAiObjectContextInternal::immolation_trap;
|
||||
creators["explosive trap"] = &HunterAiObjectContextInternal::explosive_trap;
|
||||
creators["explosive shot rank 4"] = &HunterAiObjectContextInternal::explosive_shot_rank_4;
|
||||
creators["explosive shot rank 3"] = &HunterAiObjectContextInternal::explosive_shot_rank_3;
|
||||
creators["explosive shot rank 2"] = &HunterAiObjectContextInternal::explosive_shot_rank_2;
|
||||
creators["explosive shot rank 1"] = &HunterAiObjectContextInternal::explosive_shot_rank_1;
|
||||
creators["intimidation"] = &HunterAiObjectContextInternal::intimidation;
|
||||
}
|
||||
|
||||
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* track_humanoids(PlayerbotAI* botAI) { return new CastBuffSpellAction(botAI, "track humanoids"); }
|
||||
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* kill_command(PlayerbotAI* botAI) { return new CastKillCommandAction(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* deterrence(PlayerbotAI* botAI) { return new CastDeterrenceAction(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_monkey(PlayerbotAI* botAI) { return new CastAspectOfTheMonkeyAction(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); }
|
||||
static Action* mongoose_bite(PlayerbotAI* botAI) { return new CastMongooseBiteAction(botAI); }
|
||||
static Action* aspect_of_the_dragonhawk(PlayerbotAI* ai) { return new CastAspectOfTheDragonhawkAction(ai); }
|
||||
static Action* tranquilizing_shot(PlayerbotAI* ai) { return new CastTranquilizingShotAction(ai); }
|
||||
static Action* steady_shot(PlayerbotAI* ai) { return new CastSteadyShotAction(ai); }
|
||||
static Action* kill_shot(PlayerbotAI* ai) { return new CastKillShotAction(ai); }
|
||||
static Action* misdirection_on_main_tank(PlayerbotAI* ai) { return new CastMisdirectionOnMainTankAction(ai); }
|
||||
static Action* silencing_shot(PlayerbotAI* ai) { return new CastSilencingShotAction(ai); }
|
||||
static Action* disengage(PlayerbotAI* ai) { return new CastDisengageAction(ai); }
|
||||
static Action* immolation_trap(PlayerbotAI* ai) { return new CastImmolationTrapAction(ai); }
|
||||
static Action* explosive_trap(PlayerbotAI* ai) { return new CastExplosiveTrapAction(ai); }
|
||||
static Action* explosive_shot_rank_4(PlayerbotAI* ai) { return new CastExplosiveShotRank4Action(ai); }
|
||||
static Action* explosive_shot_rank_3(PlayerbotAI* ai) { return new CastExplosiveShotRank3Action(ai); }
|
||||
static Action* explosive_shot_rank_2(PlayerbotAI* ai) { return new CastExplosiveShotRank2Action(ai); }
|
||||
static Action* explosive_shot_rank_1(PlayerbotAI* ai) { return new CastExplosiveShotRank1Action(ai); }
|
||||
static Action* intimidation(PlayerbotAI* ai) { return new CastIntimidationAction(ai); }
|
||||
};
|
||||
|
||||
SharedNamedObjectContextList<Strategy> HunterAiObjectContext::sharedStrategyContexts;
|
||||
SharedNamedObjectContextList<Action> HunterAiObjectContext::sharedActionContexts;
|
||||
SharedNamedObjectContextList<Trigger> HunterAiObjectContext::sharedTriggerContexts;
|
||||
SharedNamedObjectContextList<UntypedValue> HunterAiObjectContext::sharedValueContexts;
|
||||
|
||||
HunterAiObjectContext::HunterAiObjectContext(PlayerbotAI* botAI)
|
||||
: AiObjectContext(botAI, sharedStrategyContexts, sharedActionContexts, sharedTriggerContexts, sharedValueContexts)
|
||||
{
|
||||
}
|
||||
|
||||
void HunterAiObjectContext::BuildSharedContexts()
|
||||
{
|
||||
BuildSharedStrategyContexts(sharedStrategyContexts);
|
||||
BuildSharedActionContexts(sharedActionContexts);
|
||||
BuildSharedTriggerContexts(sharedTriggerContexts);
|
||||
BuildSharedValueContexts(sharedValueContexts);
|
||||
}
|
||||
|
||||
void HunterAiObjectContext::BuildSharedStrategyContexts(SharedNamedObjectContextList<Strategy>& strategyContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedStrategyContexts(strategyContexts);
|
||||
strategyContexts.Add(new HunterStrategyFactoryInternal());
|
||||
strategyContexts.Add(new HunterBuffStrategyFactoryInternal());
|
||||
}
|
||||
|
||||
void HunterAiObjectContext::BuildSharedActionContexts(SharedNamedObjectContextList<Action>& actionContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedActionContexts(actionContexts);
|
||||
actionContexts.Add(new HunterAiObjectContextInternal());
|
||||
}
|
||||
|
||||
void HunterAiObjectContext::BuildSharedTriggerContexts(SharedNamedObjectContextList<Trigger>& triggerContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedTriggerContexts(triggerContexts);
|
||||
triggerContexts.Add(new HunterTriggerFactoryInternal());
|
||||
}
|
||||
|
||||
void HunterAiObjectContext::BuildSharedValueContexts(SharedNamedObjectContextList<UntypedValue>& valueContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedValueContexts(valueContexts);
|
||||
}
|
||||
30
src/Ai/Class/Hunter/HunterAiObjectContext.h
Normal file
30
src/Ai/Class/Hunter/HunterAiObjectContext.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_HUNTERAIOBJECTCONTEXT_H
|
||||
#define _PLAYERBOT_HUNTERAIOBJECTCONTEXT_H
|
||||
|
||||
#include "AiObjectContext.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class HunterAiObjectContext : public AiObjectContext
|
||||
{
|
||||
public:
|
||||
HunterAiObjectContext(PlayerbotAI* botAI);
|
||||
|
||||
static void BuildSharedContexts();
|
||||
static void BuildSharedStrategyContexts(SharedNamedObjectContextList<Strategy>& strategyContexts);
|
||||
static void BuildSharedActionContexts(SharedNamedObjectContextList<Action>& actionContexts);
|
||||
static void BuildSharedTriggerContexts(SharedNamedObjectContextList<Trigger>& triggerContexts);
|
||||
static void BuildSharedValueContexts(SharedNamedObjectContextList<UntypedValue>& valueContexts);
|
||||
|
||||
static SharedNamedObjectContextList<Strategy> sharedStrategyContexts;
|
||||
static SharedNamedObjectContextList<Action> sharedActionContexts;
|
||||
static SharedNamedObjectContextList<Trigger> sharedTriggerContexts;
|
||||
static SharedNamedObjectContextList<UntypedValue> sharedValueContexts;
|
||||
};
|
||||
|
||||
#endif
|
||||
113
src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.cpp
Normal file
113
src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* 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 "BeastMasteryHunterStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
// ===== Action Node Factory =====
|
||||
class BeastMasteryHunterStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
BeastMasteryHunterStrategyActionNodeFactory()
|
||||
{
|
||||
creators["auto shot"] = &auto_shot;
|
||||
creators["kill command"] = &kill_command;
|
||||
creators["kill shot"] = &kill_shot;
|
||||
creators["viper sting"] = &viper_sting;
|
||||
creators["serpent sting"] = serpent_sting;
|
||||
creators["aimed shot"] = &aimed_shot;
|
||||
creators["arcane shot"] = &arcane_shot;
|
||||
creators["steady shot"] = &steady_shot;
|
||||
creators["multi-shot"] = &multi_shot;
|
||||
creators["volley"] = &volley;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* auto_shot(PlayerbotAI*) { return new ActionNode("auto shot", {}, {}, {}); }
|
||||
static ActionNode* kill_command(PlayerbotAI*) { return new ActionNode("kill command", {}, {}, {}); }
|
||||
static ActionNode* kill_shot(PlayerbotAI*) { return new ActionNode("kill shot", {}, {}, {}); }
|
||||
static ActionNode* viper_sting(PlayerbotAI*) { return new ActionNode("viper sting", {}, {}, {}); }
|
||||
static ActionNode* serpent_sting(PlayerbotAI*) { return new ActionNode("serpent sting", {}, {}, {}); }
|
||||
static ActionNode* aimed_shot(PlayerbotAI*) { return new ActionNode("aimed shot", {}, {}, {}); }
|
||||
static ActionNode* arcane_shot(PlayerbotAI*) { return new ActionNode("arcane shot", {}, {}, {}); }
|
||||
static ActionNode* steady_shot(PlayerbotAI*) { return new ActionNode("steady shot", {}, {}, {}); }
|
||||
static ActionNode* multi_shot(PlayerbotAI*) { return new ActionNode("multi shot", {}, {}, {}); }
|
||||
static ActionNode* volley(PlayerbotAI*) { return new ActionNode("volley", {}, {}, {}); }
|
||||
};
|
||||
|
||||
// ===== Single Target Strategy =====
|
||||
BeastMasteryHunterStrategy::BeastMasteryHunterStrategy(PlayerbotAI* botAI) : GenericHunterStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new BeastMasteryHunterStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
// ===== Default Actions =====
|
||||
std::vector<NextAction> BeastMasteryHunterStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("bestial wrath", 19.0f),
|
||||
NextAction("kill command", 5.7f),
|
||||
NextAction("kill shot", 5.6f),
|
||||
NextAction("serpent sting", 5.5f),
|
||||
NextAction("aimed shot", 5.4f),
|
||||
NextAction("arcane shot", 5.3f),
|
||||
NextAction("steady shot", 5.2f),
|
||||
NextAction("auto shot", 5.1f)
|
||||
};
|
||||
}
|
||||
|
||||
// ===== Trigger Initialization ===
|
||||
void BeastMasteryHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericHunterStrategy::InitTriggers(triggers);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"intimidation",
|
||||
{
|
||||
NextAction("intimidation", 40.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"kill command",
|
||||
{
|
||||
NextAction("kill command", 18.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"target critical health",
|
||||
{
|
||||
NextAction("kill shot", 18.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"low mana",
|
||||
{
|
||||
NextAction("viper sting", 17.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"no stings",
|
||||
{
|
||||
NextAction("serpent sting", 17.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"serpent sting on attacker",
|
||||
{
|
||||
NextAction("serpent sting on attacker", 16.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
24
src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.h
Normal file
24
src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.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_BEASTMASTERYHUNTERSTRATEGY_H
|
||||
#define _PLAYERBOT_BEASTMASTERYHUNTERSTRATEGY_H
|
||||
|
||||
#include "GenericHunterStrategy.h"
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class BeastMasteryHunterStrategy : public GenericHunterStrategy
|
||||
{
|
||||
public:
|
||||
BeastMasteryHunterStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "bm"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "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([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("rapid fire",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("readiness")},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* aspect_of_the_pack([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("aspect of the pack",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("aspect of the cheetah")},
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
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("trueshot aura", 2.0f)}));
|
||||
triggers.push_back(new TriggerNode("often", {
|
||||
NextAction("apply stone", 1.0f),
|
||||
NextAction("apply oil", 1.0f),
|
||||
}));
|
||||
triggers.push_back(new TriggerNode("low ammo", { NextAction("say::low ammo", ACTION_NORMAL)}));
|
||||
triggers.push_back(new TriggerNode("no track", { NextAction("track humanoids", ACTION_NORMAL)}));
|
||||
triggers.push_back(new TriggerNode("no ammo", { NextAction("equip upgrades", ACTION_HIGH + 1)}));
|
||||
}
|
||||
|
||||
void HunterPetStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", { NextAction("call pet", 60.0f)}));
|
||||
triggers.push_back(new TriggerNode("has pet", { NextAction("toggle pet spell", 60.0f)}));
|
||||
triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 60.0f)}));
|
||||
triggers.push_back(new TriggerNode("pet not happy", { NextAction("feed pet", 60.0f)}));
|
||||
triggers.push_back(new TriggerNode("hunters pet medium health", { NextAction("mend pet", 60.0f)}));
|
||||
triggers.push_back(new TriggerNode("hunters pet dead", { NextAction("revive pet", 60.0f)}));
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_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
|
||||
157
src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp
Normal file
157
src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* 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 "GenericHunterStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "Strategy.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["aspect of the dragonhawk"] = &aspect_of_the_dragonhawk;
|
||||
creators["feign death"] = &feign_death;
|
||||
creators["wing clip"] = &wing_clip;
|
||||
creators["mongoose bite"] = &mongoose_bite;
|
||||
creators["raptor strike"] = &raptor_strike;
|
||||
creators["explosive trap"] = &explosive_trap;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* rapid_fire([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("rapid fire",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("readiness") },
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* aspect_of_the_pack([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("aspect of the pack",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("aspect of the cheetah") },
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* aspect_of_the_dragonhawk([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("aspect of the dragonhawk",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("aspect of the hawk") },
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* feign_death([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("feign death",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* wing_clip([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("wing clip",
|
||||
/*P*/ {},
|
||||
// /*A*/ { NextAction("mongoose bite") },
|
||||
{},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* mongoose_bite([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("mongoose bite",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("raptor strike") },
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* raptor_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("raptor strike",
|
||||
/*P*/ { NextAction("melee") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* explosive_trap([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("explosive trap",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("immolation trap") },
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
GenericHunterStrategy::GenericHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericHunterStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
// Mark/Ammo/Mana Triggers
|
||||
triggers.push_back(new TriggerNode("no ammo", { NextAction("equip upgrades", 30.0f) }));
|
||||
triggers.push_back(new TriggerNode("hunter's mark", { NextAction("hunter's mark", 29.5f) }));
|
||||
triggers.push_back(new TriggerNode("rapid fire", { NextAction("rapid fire", 29.0f) }));
|
||||
triggers.push_back(new TriggerNode("aspect of the viper", { NextAction("aspect of the viper", 28.0f) }));
|
||||
triggers.push_back(new TriggerNode("aspect of the hawk", { NextAction("aspect of the dragonhawk", 27.5f) }));
|
||||
|
||||
// Aggro/Threat/Defensive Triggers
|
||||
triggers.push_back(new TriggerNode("has aggro", { NextAction("concussive shot", 20.0f) }));
|
||||
triggers.push_back(new TriggerNode("low tank threat", { NextAction("misdirection on main tank", 27.0f) }));
|
||||
triggers.push_back(new TriggerNode("low health", { NextAction("deterrence", 35.0f) }));
|
||||
triggers.push_back(new TriggerNode("concussive shot on snare target", { NextAction("concussive shot", 20.0f) }));
|
||||
triggers.push_back(new TriggerNode("medium threat", { NextAction("feign death", 35.0f) }));
|
||||
triggers.push_back(new TriggerNode("hunters pet medium health", { NextAction("mend pet", 22.0f) }));
|
||||
triggers.push_back(new TriggerNode("hunters pet low health", { NextAction("mend pet", 21.0f) }));
|
||||
|
||||
// Dispel Triggers
|
||||
triggers.push_back(new TriggerNode("tranquilizing shot enrage", { NextAction("tranquilizing shot", 61.0f) }));
|
||||
triggers.push_back(new TriggerNode("tranquilizing shot magic", { NextAction("tranquilizing shot", 61.0f) }));
|
||||
|
||||
// Ranged-based Triggers
|
||||
triggers.push_back(new TriggerNode("enemy within melee", {
|
||||
NextAction("explosive trap", 37.0f),
|
||||
NextAction("mongoose bite", 22.0f),
|
||||
NextAction("wing clip", 21.0f) }));
|
||||
|
||||
triggers.push_back(new TriggerNode("enemy too close for auto shot", {
|
||||
NextAction("disengage", 35.0f),
|
||||
NextAction("flee", 34.0f) }));
|
||||
}
|
||||
|
||||
// ===== AoE Strategy, 2/3+ enemies =====
|
||||
AoEHunterStrategy::AoEHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
void AoEHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("volley channel check", { NextAction("cancel channel", 23.0f) }));
|
||||
triggers.push_back(new TriggerNode("medium aoe", { NextAction("volley", 22.0f) }));
|
||||
triggers.push_back(new TriggerNode("light aoe", { NextAction("multi-shot", 21.0f) }));
|
||||
}
|
||||
|
||||
void HunterBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
void HunterCcStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("scare beast", { NextAction("scare beast on cc", 23.0f) }));
|
||||
triggers.push_back(new TriggerNode("freezing trap", { NextAction("freezing trap on cc", 23.0f) }));
|
||||
}
|
||||
|
||||
void HunterTrapWeaveStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("immolation trap no cd", { NextAction("reach melee", 23.0f) }));
|
||||
}
|
||||
60
src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.h
Normal file
60
src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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_GENERICHUNTERSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICHUNTERSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
#include "Strategy.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"; }
|
||||
uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; }
|
||||
};
|
||||
|
||||
class AoEHunterStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
AoEHunterStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "aoe"; }
|
||||
};
|
||||
|
||||
class HunterBoostStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
HunterBoostStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "boost"; }
|
||||
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"; }
|
||||
};
|
||||
|
||||
class HunterTrapWeaveStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
HunterTrapWeaveStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "trap weave"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
53
src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.cpp
Normal file
53
src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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 "HunterBuffStrategies.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class BuffHunterStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
BuffHunterStrategyActionNodeFactory() { creators["aspect of the hawk"] = &aspect_of_the_hawk; }
|
||||
|
||||
private:
|
||||
static ActionNode* aspect_of_the_hawk([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("aspect of the hawk",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("aspect of the monkey") },
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
HunterBuffDpsStrategy::HunterBuffDpsStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new BuffHunterStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void HunterBuffDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("aspect of the hawk", { NextAction("aspect of the dragonhawk", 20.1f),
|
||||
NextAction("aspect of the hawk", 20.0f) }));
|
||||
}
|
||||
|
||||
void HunterNatureResistanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("aspect of the wild",
|
||||
{ NextAction("aspect of the wild", 20.0f) }));
|
||||
}
|
||||
|
||||
void HunterBuffSpeedStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("aspect of the pack",
|
||||
{ NextAction("aspect of the pack", 20.0f) }));
|
||||
}
|
||||
|
||||
void HunterBuffManaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("aspect of the viper",
|
||||
{ NextAction("aspect of the viper", 20.0f) }));
|
||||
}
|
||||
49
src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.h
Normal file
49
src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_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);
|
||||
|
||||
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
|
||||
118
src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.cpp
Normal file
118
src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.cpp
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* 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 "MarksmanshipHunterStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
// ===== Action Node Factory =====
|
||||
class MarksmanshipHunterStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
MarksmanshipHunterStrategyActionNodeFactory()
|
||||
{
|
||||
creators["auto shot"] = &auto_shot;
|
||||
creators["silencing shot"] = &silencing_shot;
|
||||
creators["kill command"] = &kill_command;
|
||||
creators["kill shot"] = &kill_shot;
|
||||
creators["viper sting"] = &viper_sting;
|
||||
creators["serpent sting"] = serpent_sting;
|
||||
creators["chimera shot"] = &chimera_shot;
|
||||
creators["aimed shot"] = &aimed_shot;
|
||||
creators["arcane shot"] = &arcane_shot;
|
||||
creators["steady shot"] = &steady_shot;
|
||||
creators["multi-shot"] = &multi_shot;
|
||||
creators["volley"] = &volley;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* auto_shot(PlayerbotAI*) { return new ActionNode("auto shot", {}, {}, {}); }
|
||||
static ActionNode* silencing_shot(PlayerbotAI*) { return new ActionNode("silencing shot", {}, {}, {}); }
|
||||
static ActionNode* kill_command(PlayerbotAI*) { return new ActionNode("kill command", {}, {}, {}); }
|
||||
static ActionNode* kill_shot(PlayerbotAI*) { return new ActionNode("kill shot", {}, {}, {}); }
|
||||
static ActionNode* viper_sting(PlayerbotAI*) { return new ActionNode("viper sting", {}, {}, {}); }
|
||||
static ActionNode* serpent_sting(PlayerbotAI*) { return new ActionNode("serpent sting", {}, {}, {}); }
|
||||
static ActionNode* chimera_shot(PlayerbotAI*) { return new ActionNode("chimera shot", {}, {}, {}); }
|
||||
static ActionNode* aimed_shot(PlayerbotAI*) { return new ActionNode("aimed shot", {}, {}, {}); }
|
||||
static ActionNode* arcane_shot(PlayerbotAI*) { return new ActionNode("arcane shot", {}, {}, {}); }
|
||||
static ActionNode* steady_shot(PlayerbotAI*) { return new ActionNode("steady shot", {}, {}, {}); }
|
||||
static ActionNode* multi_shot(PlayerbotAI*) { return new ActionNode("multi shot", {}, {}, {}); }
|
||||
static ActionNode* volley(PlayerbotAI*) { return new ActionNode("volley", {}, {}, {}); }
|
||||
};
|
||||
|
||||
// ===== Single Target Strategy =====
|
||||
MarksmanshipHunterStrategy::MarksmanshipHunterStrategy(PlayerbotAI* botAI) : GenericHunterStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new MarksmanshipHunterStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
// ===== Default Actions =====
|
||||
std::vector<NextAction> MarksmanshipHunterStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("kill command", 5.8f),
|
||||
NextAction("kill shot", 5.7f),
|
||||
NextAction("serpent sting", 5.6f),
|
||||
NextAction("chimera shot", 5.5f),
|
||||
NextAction("aimed shot", 5.4f),
|
||||
NextAction("arcane shot", 5.3f),
|
||||
NextAction("steady shot", 5.2f),
|
||||
NextAction("auto shot", 5.1f)
|
||||
};
|
||||
}
|
||||
|
||||
// ===== Trigger Initialization ===
|
||||
void MarksmanshipHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericHunterStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"silencing shot",
|
||||
{
|
||||
NextAction("silencing shot", 40.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"kill command",
|
||||
{
|
||||
NextAction("kill command", 18.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"target critical health",
|
||||
{
|
||||
NextAction("kill shot", 18.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"low mana",
|
||||
{
|
||||
NextAction("viper sting", 17.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"no stings",
|
||||
{
|
||||
NextAction("serpent sting", 17.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"serpent sting on attacker",
|
||||
{
|
||||
NextAction("serpent sting on attacker", 16.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
24
src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.h
Normal file
24
src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.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_MARKSMANSHIPHUNTERSTRATEGY_H
|
||||
#define _PLAYERBOT_MARKSMANSHIPHUNTERSTRATEGY_H
|
||||
|
||||
#include "GenericHunterStrategy.h"
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MarksmanshipHunterStrategy : public GenericHunterStrategy
|
||||
{
|
||||
public:
|
||||
MarksmanshipHunterStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "mm"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
159
src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.cpp
Normal file
159
src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.cpp
Normal file
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* 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 "SurvivalHunterStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
// ===== Action Node Factory =====
|
||||
class SurvivalHunterStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
SurvivalHunterStrategyActionNodeFactory()
|
||||
{
|
||||
creators["auto shot"] = &auto_shot;
|
||||
creators["kill command"] = &kill_command;
|
||||
creators["kill shot"] = &kill_shot;
|
||||
creators["explosive shot"] = &explosive_shot;
|
||||
creators["black arrow"] = &black_arrow;
|
||||
creators["viper sting"] = &viper_sting;
|
||||
creators["serpent sting"] = serpent_sting;
|
||||
creators["aimed shot"] = &aimed_shot;
|
||||
creators["arcane shot"] = &arcane_shot;
|
||||
creators["steady shot"] = &steady_shot;
|
||||
creators["multi-shot"] = &multi_shot;
|
||||
creators["volley"] = &volley;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* auto_shot(PlayerbotAI*) { return new ActionNode("auto shot", {}, {}, {}); }
|
||||
static ActionNode* kill_command(PlayerbotAI*) { return new ActionNode("kill command", {}, {}, {}); }
|
||||
static ActionNode* kill_shot(PlayerbotAI*) { return new ActionNode("kill shot", {}, {}, {}); }
|
||||
static ActionNode* explosive_shot(PlayerbotAI*) { return new ActionNode("explosive shot", {}, {}, {}); }
|
||||
static ActionNode* black_arrow(PlayerbotAI*) { return new ActionNode("black arrow", {}, {}, {}); }
|
||||
static ActionNode* viper_sting(PlayerbotAI*) { return new ActionNode("viper sting", {}, {}, {}); }
|
||||
static ActionNode* serpent_sting(PlayerbotAI*) { return new ActionNode("serpent sting", {}, {}, {}); }
|
||||
static ActionNode* aimed_shot(PlayerbotAI*) { return new ActionNode("aimed shot", {}, {}, {}); }
|
||||
static ActionNode* arcane_shot(PlayerbotAI*) { return new ActionNode("arcane shot", {}, {}, {}); }
|
||||
static ActionNode* steady_shot(PlayerbotAI*) { return new ActionNode("steady shot", {}, {}, {}); }
|
||||
static ActionNode* multi_shot(PlayerbotAI*) { return new ActionNode("multi shot", {}, {}, {}); }
|
||||
static ActionNode* volley(PlayerbotAI*) { return new ActionNode("volley", {}, {}, {}); }
|
||||
};
|
||||
|
||||
// ===== Single Target Strategy =====
|
||||
SurvivalHunterStrategy::SurvivalHunterStrategy(PlayerbotAI* botAI) : GenericHunterStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new SurvivalHunterStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
// ===== Default Actions =====
|
||||
std::vector<NextAction> SurvivalHunterStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("kill command", 5.9f),
|
||||
NextAction("kill shot", 5.8f),
|
||||
NextAction("explosive shot", 5.7f),
|
||||
NextAction("black arrow", 5.6f),
|
||||
NextAction("serpent sting", 5.5f),
|
||||
NextAction("aimed shot", 5.4f),
|
||||
NextAction("arcane shot", 5.3f),
|
||||
NextAction("steady shot", 5.2f),
|
||||
NextAction("auto shot", 5.1f)
|
||||
};
|
||||
}
|
||||
|
||||
// ===== Trigger Initialization ===
|
||||
void SurvivalHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericHunterStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"lock and load",
|
||||
{
|
||||
NextAction("explosive shot rank 4", 28.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"lock and load",
|
||||
{
|
||||
NextAction("explosive shot rank 3", 27.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"lock and load",
|
||||
{
|
||||
NextAction("explosive shot rank 2", 27.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"lock and load",
|
||||
{
|
||||
NextAction("explosive shot rank 1", 26.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"kill command",
|
||||
{
|
||||
NextAction("kill command", 18.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"target critical health",
|
||||
{
|
||||
NextAction("kill shot", 18.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"explosive shot",
|
||||
{
|
||||
NextAction("explosive shot", 17.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"black arrow",
|
||||
{
|
||||
NextAction("black arrow", 16.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"low mana",
|
||||
{
|
||||
NextAction("viper sting", 16.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"no stings",
|
||||
{
|
||||
NextAction("serpent sting", 15.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"serpent sting on attacker",
|
||||
{
|
||||
NextAction("serpent sting on attacker", 15.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
24
src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.h
Normal file
24
src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.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_SURVIVALHUNTERSTRATEGY_H
|
||||
#define _PLAYERBOT_SURVIVALHUNTERSTRATEGY_H
|
||||
|
||||
#include "GenericHunterStrategy.h"
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class SurvivalHunterStrategy : public GenericHunterStrategy
|
||||
{
|
||||
public:
|
||||
SurvivalHunterStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "surv"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
170
src/Ai/Class/Hunter/Trigger/HunterTriggers.cpp
Normal file
170
src/Ai/Class/Hunter/Trigger/HunterTriggers.cpp
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* 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 "HunterTriggers.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "GenericTriggers.h"
|
||||
#include "HunterActions.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Player.h"
|
||||
|
||||
bool KillCommandTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
return !botAI->HasAura("kill command", target);
|
||||
}
|
||||
|
||||
bool BlackArrowTrigger::IsActive()
|
||||
{
|
||||
if (botAI->HasStrategy("trap weave", BOT_STATE_COMBAT))
|
||||
return false;
|
||||
|
||||
return DebuffTrigger::IsActive();
|
||||
return BuffTrigger::IsActive();
|
||||
}
|
||||
|
||||
bool HunterAspectOfTheHawkTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
return SpellTrigger::IsActive() && !botAI->HasAura("aspect of the hawk", target) &&
|
||||
!botAI->HasAura("aspect of the dragonhawk", target) &&
|
||||
(!AI_VALUE2(bool, "has mana", "self target") || AI_VALUE2(uint8, "mana", "self target") > 70);
|
||||
}
|
||||
|
||||
bool HunterNoStingsActiveTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
return DebuffTrigger::IsActive() && target && !botAI->HasAura("serpent sting", target, false, true) &&
|
||||
!botAI->HasAura("scorpid sting", target, false, true) && !botAI->HasAura("viper sting", target, false, true);
|
||||
return BuffTrigger::IsActive();
|
||||
}
|
||||
|
||||
bool HuntersPetDeadTrigger::IsActive()
|
||||
{
|
||||
// Unit* pet = AI_VALUE(Unit*, "pet target");
|
||||
// return pet && AI_VALUE2(bool, "dead", "pet target") && !AI_VALUE2(bool, "mounted", "self target");
|
||||
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 HuntersPetMediumHealthTrigger::IsActive()
|
||||
{
|
||||
Unit* pet = AI_VALUE(Unit*, "pet target");
|
||||
return pet && AI_VALUE2(uint8, "health", "pet target") < sPlayerbotAIConfig->mediumHealth &&
|
||||
!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()) &&
|
||||
AI_VALUE2(uint8, "mana", "self target") < (sPlayerbotAIConfig->lowMana / 2);
|
||||
;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
bool NoTrackTrigger::IsActive()
|
||||
{
|
||||
std::vector<std::string> track_list = {
|
||||
"track beasts",
|
||||
"track demons",
|
||||
"track dragonkin",
|
||||
"track elementals",
|
||||
"track giants",
|
||||
"track hidden",
|
||||
"track humanoids"
|
||||
};
|
||||
|
||||
for (auto &track: track_list)
|
||||
{
|
||||
if (botAI->HasAura(track, bot))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SerpentStingOnAttackerTrigger::IsActive()
|
||||
{
|
||||
if (!DebuffOnAttackerTrigger::IsActive())
|
||||
return false;
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !botAI->HasAura("scorpid sting", target, false, true) &&
|
||||
!botAI->HasAura("viper sting", target, false, true);
|
||||
return BuffTrigger::IsActive();
|
||||
}
|
||||
|
||||
const std::set<uint32> VolleyChannelCheckTrigger::VOLLEY_SPELL_IDS = {
|
||||
1510, // Volley Rank 1
|
||||
14294, // Volley Rank 2
|
||||
14295, // Volley Rank 3
|
||||
27022, // Volley Rank 4
|
||||
58431, // Volley Rank 5
|
||||
58434 // Volley Rank 6
|
||||
};
|
||||
|
||||
bool VolleyChannelCheckTrigger::IsActive()
|
||||
{
|
||||
Player* bot = botAI->GetBot();
|
||||
|
||||
// Check if the bot is channeling a spell
|
||||
if (Spell* spell = bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||
{
|
||||
// Only trigger if the spell being channeled is Volley
|
||||
if (VOLLEY_SPELL_IDS.count(spell->m_spellInfo->Id))
|
||||
{
|
||||
uint8 attackerCount = AI_VALUE(uint8, "attacker count");
|
||||
return attackerCount < minEnemies;
|
||||
}
|
||||
}
|
||||
|
||||
// Not channeling Volley
|
||||
return false;
|
||||
}
|
||||
263
src/Ai/Class/Hunter/Trigger/HunterTriggers.h
Normal file
263
src/Ai/Class/Hunter/Trigger/HunterTriggers.h
Normal file
@@ -0,0 +1,263 @@
|
||||
/*
|
||||
* 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_HUNTERTRIGGERS_H
|
||||
#define _PLAYERBOT_HUNTERTRIGGERS_H
|
||||
|
||||
#include "CureTriggers.h"
|
||||
#include "GenericTriggers.h"
|
||||
#include "Trigger.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include <set>
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
// Buff and Out of Combat Triggers
|
||||
|
||||
class HunterAspectOfTheMonkeyTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
HunterAspectOfTheMonkeyTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "aspect of the monkey") {}
|
||||
};
|
||||
|
||||
class HunterAspectOfTheHawkTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
HunterAspectOfTheHawkTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "aspect of the hawk") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
class TrueshotAuraTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
TrueshotAuraTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "trueshot aura") {}
|
||||
};
|
||||
|
||||
class NoTrackTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
NoTrackTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "no track") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
// Cooldown Triggers
|
||||
|
||||
class RapidFireTrigger : public BoostTrigger
|
||||
{
|
||||
public:
|
||||
RapidFireTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "rapid fire") {}
|
||||
};
|
||||
|
||||
class BestialWrathTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
BestialWrathTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "bestial wrath") {}
|
||||
};
|
||||
|
||||
class IntimidationTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
IntimidationTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "intimidation") {}
|
||||
};
|
||||
|
||||
class KillCommandTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
KillCommandTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "kill command") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class LockAndLoadTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
LockAndLoadTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "lock and load") {}
|
||||
|
||||
bool IsActive() override
|
||||
{
|
||||
return botAI->HasAura("lock and load", botAI->GetBot());
|
||||
}
|
||||
};
|
||||
|
||||
// CC Triggers
|
||||
|
||||
class FreezingTrapTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
FreezingTrapTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "freezing trap") {}
|
||||
};
|
||||
|
||||
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 SilencingShotTrigger : public InterruptSpellTrigger
|
||||
{
|
||||
public:
|
||||
SilencingShotTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "silencing shot") {}
|
||||
};
|
||||
|
||||
// DoT/Debuff Triggers
|
||||
|
||||
class HuntersMarkTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
HuntersMarkTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "hunter's mark", 1, true, 0.5f) {}
|
||||
bool IsActive() override { return BuffTrigger::IsActive(); }
|
||||
};
|
||||
|
||||
class ExplosiveShotTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
ExplosiveShotTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "explosive shot", 1, true) {}
|
||||
bool IsActive() override { return BuffTrigger::IsActive(); }
|
||||
};
|
||||
|
||||
class BlackArrowTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
BlackArrowTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "black arrow", 1, true) {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class HunterNoStingsActiveTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
HunterNoStingsActiveTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "no stings") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class SerpentStingOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
SerpentStingOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "serpent sting", true) {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
// Damage/Combat Triggers
|
||||
|
||||
class AutoShotTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
AutoShotTrigger(PlayerbotAI* botAI) : Trigger(botAI, "auto shot") {}
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
class MisdirectionOnMainTankTrigger : public BuffOnMainTankTrigger
|
||||
{
|
||||
public:
|
||||
MisdirectionOnMainTankTrigger(PlayerbotAI* ai) : BuffOnMainTankTrigger(ai, "misdirection", true) {}
|
||||
};
|
||||
|
||||
class TargetRemoveEnrageTrigger : public TargetAuraDispelTrigger
|
||||
{
|
||||
public:
|
||||
TargetRemoveEnrageTrigger(PlayerbotAI* ai) : TargetAuraDispelTrigger(ai, "tranquilizing shot", DISPEL_ENRAGE) {}
|
||||
};
|
||||
|
||||
class TargetRemoveMagicTrigger : public TargetAuraDispelTrigger
|
||||
{
|
||||
public:
|
||||
TargetRemoveMagicTrigger(PlayerbotAI* ai) : TargetAuraDispelTrigger(ai, "tranquilizing shot", DISPEL_MAGIC) {}
|
||||
};
|
||||
|
||||
class ImmolationTrapNoCdTrigger : public SpellNoCooldownTrigger
|
||||
{
|
||||
public:
|
||||
ImmolationTrapNoCdTrigger(PlayerbotAI* ai) : SpellNoCooldownTrigger(ai, "immolation trap") {}
|
||||
};
|
||||
|
||||
BEGIN_TRIGGER(HuntersPetDeadTrigger, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
BEGIN_TRIGGER(HuntersPetLowHealthTrigger, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
BEGIN_TRIGGER(HuntersPetMediumHealthTrigger, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
BEGIN_TRIGGER(HunterPetNotHappy, Trigger)
|
||||
END_TRIGGER()
|
||||
|
||||
class VolleyChannelCheckTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
VolleyChannelCheckTrigger(PlayerbotAI* botAI, uint32 minEnemies = 2)
|
||||
: Trigger(botAI, "volley channel check"), minEnemies(minEnemies)
|
||||
{
|
||||
}
|
||||
|
||||
bool IsActive() override;
|
||||
|
||||
protected:
|
||||
uint32 minEnemies;
|
||||
static const std::set<uint32> VOLLEY_SPELL_IDS;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user