diff --git a/src/strategy/hunter/DpsHunterStrategy.cpp b/src/strategy/hunter/DpsHunterStrategy.cpp index 3ba171a2..b8709378 100644 --- a/src/strategy/hunter/DpsHunterStrategy.cpp +++ b/src/strategy/hunter/DpsHunterStrategy.cpp @@ -41,8 +41,11 @@ DpsHunterStrategy::DpsHunterStrategy(PlayerbotAI* botAI) : GenericHunterStrategy NextAction** DpsHunterStrategy::getDefaultActions() { return NextAction::array( - 0, new NextAction("kill shot", ACTION_DEFAULT + 0.8f), new NextAction("chimera shot", ACTION_DEFAULT + 0.7f), - new NextAction("explosive shot", ACTION_DEFAULT + 0.6f), new NextAction("aimed shot", ACTION_DEFAULT + 0.5f), + 0, + new NextAction("explosive shot", ACTION_HIGH + 1.0f), + new NextAction("kill shot", ACTION_DEFAULT + 0.8f), + new NextAction("chimera shot", ACTION_DEFAULT + 0.6f), + new NextAction("aimed shot", ACTION_DEFAULT + 0.5f), new NextAction("silencing shot", ACTION_DEFAULT + 0.4f), new NextAction("kill command", ACTION_DEFAULT + 0.3f), // new NextAction("arcane shot", ACTION_DEFAULT + 0.2f), @@ -55,7 +58,7 @@ void DpsHunterStrategy::InitTriggers(std::vector& triggers) GenericHunterStrategy::InitTriggers(triggers); triggers.push_back( - new TriggerNode("black arrow", NextAction::array(0, new NextAction("black arrow", 15.0f), nullptr))); + new TriggerNode("black arrow", NextAction::array(0, new NextAction("black arrow", 19.0f), nullptr))); triggers.push_back( new TriggerNode("low mana", NextAction::array(0, new NextAction("viper sting", 23.0f), nullptr))); triggers.push_back( diff --git a/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp b/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp index ca7debfa..e64a9d78 100644 --- a/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp +++ b/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp @@ -49,6 +49,8 @@ void GenericHunterNonCombatStrategy::InitTriggers(std::vector& tri triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); triggers.push_back( new TriggerNode("low ammo", NextAction::array(0, new NextAction("say::low ammo", ACTION_NORMAL), nullptr))); + triggers.push_back( + new TriggerNode("no track", NextAction::array(0, new NextAction("track humanoids", ACTION_NORMAL), nullptr))); // triggers.push_back(new TriggerNode("no ammo", NextAction::array(0, new NextAction("switch to melee", // ACTION_NORMAL + 1), new NextAction("say::no ammo", ACTION_NORMAL), nullptr))); triggers.push_back(new // TriggerNode("has ammo", NextAction::array(0, new NextAction("switch to ranged", ACTION_NORMAL), nullptr))); diff --git a/src/strategy/hunter/HunterAiObjectContext.cpp b/src/strategy/hunter/HunterAiObjectContext.cpp index dbfb6a54..2dcd3550 100644 --- a/src/strategy/hunter/HunterAiObjectContext.cpp +++ b/src/strategy/hunter/HunterAiObjectContext.cpp @@ -75,6 +75,7 @@ public: 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; @@ -99,6 +100,7 @@ private: 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); } @@ -159,6 +161,7 @@ public: 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; @@ -182,6 +185,7 @@ private: 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); } diff --git a/src/strategy/hunter/HunterTriggers.cpp b/src/strategy/hunter/HunterTriggers.cpp index 941ce755..6c9354fa 100644 --- a/src/strategy/hunter/HunterTriggers.cpp +++ b/src/strategy/hunter/HunterTriggers.cpp @@ -56,7 +56,7 @@ bool HunterPetNotHappy::IsActive() bool HunterAspectOfTheViperTrigger::IsActive() { return SpellTrigger::IsActive() && !botAI->HasAura(spell, GetTarget()) && - AI_VALUE2(uint8, "mana", "self target") < sPlayerbotAIConfig->lowMana; + AI_VALUE2(uint8, "mana", "self target") < (sPlayerbotAIConfig->lowMana / 2); ; } @@ -88,3 +88,36 @@ bool SwitchToMeleeTrigger::IsActive() (target->GetVictim() == bot && sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "current target"), 8.0f)); } + +bool NoTrackTrigger::IsActive() +{ + std::vector 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); +} \ No newline at end of file diff --git a/src/strategy/hunter/HunterTriggers.h b/src/strategy/hunter/HunterTriggers.h index 2ff44fe3..e9d09c91 100644 --- a/src/strategy/hunter/HunterTriggers.h +++ b/src/strategy/hunter/HunterTriggers.h @@ -101,10 +101,18 @@ public: TrueshotAuraTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "trueshot aura") {} }; +class NoTrackTrigger : public BuffTrigger +{ +public: + NoTrackTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "no track") {} + bool IsActive() override; +}; + class SerpentStingOnAttackerTrigger : public DebuffOnAttackerTrigger { public: SerpentStingOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "serpent sting", true) {} + bool IsActive() override; }; BEGIN_TRIGGER(HunterPetNotHappy, Trigger)