mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-18 19:25:44 +00:00
Channel Cancel checks for Channeled AOE DPS Spells
Hello everyone, I liked the channel cancel I did on mage recently, where they cancel blizzard if there is only 1 enemy left. I decided to do the same for the following classes: Druid: Hurricane Hunter: Volley Priest: Mind Sear Warlock: Rain of Fire I moved the "ChannelCancel" action to it's own file, so other classes could benefit from it. I removed it from the mageactions.
This commit is contained in:
@@ -136,9 +136,9 @@ AoEHunterStrategy::AoEHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
|
||||
void AoEHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("volley channel check", NextAction::array(0, new NextAction("cancel channel", 23.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr)));
|
||||
triggers.push_back(
|
||||
new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr)));
|
||||
}
|
||||
|
||||
void HunterBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
|
||||
@@ -101,6 +101,7 @@ public:
|
||||
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:
|
||||
@@ -141,6 +142,7 @@ private:
|
||||
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>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Player.h"
|
||||
|
||||
bool KillCommandTrigger::IsActive()
|
||||
{
|
||||
@@ -139,3 +140,31 @@ bool SerpentStingOnAttackerTrigger::IsActive()
|
||||
!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;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "GenericTriggers.h"
|
||||
#include "Trigger.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include <set>
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
@@ -244,4 +245,19 @@ 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