Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,19 @@ void DpsAoeHunterStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
triggers.push_back(new TriggerNode(
"serpent sting on attacker",
NextAction::array(0, new NextAction("serpent sting on attacker", 49.0f), NULL)));

triggers.push_back(new TriggerNode(
"has feign death",
NextAction::array(0, new NextAction("remove feign death", 53.0f), NULL)));
}

void DpsHunterDebuffStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
{
triggers.push_back(new TriggerNode(
"no stings",
NextAction::array(0, new NextAction("serpent sting", 50.0f), NULL)));

triggers.push_back(new TriggerNode(
"has feign death",
NextAction::array(0, new NextAction("remove feign death", 53.0f), NULL)));
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ void GenericHunterNonCombatStrategy::InitTriggers(std::list<TriggerNode*> &trigg
triggers.push_back(new TriggerNode(
"hunters pet low health",
NextAction::array(0, new NextAction("mend pet", 60.0f), NULL)));

triggers.push_back(new TriggerNode(
"has feign death",
NextAction::array(0, new NextAction("remove feign death", 53.0f), NULL)));
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ void GenericHunterStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
"medium threat",
NextAction::array(0, new NextAction("feign death", 52.0f), NULL)));

triggers.push_back(new TriggerNode(
"has feign death",
NextAction::array(0, new NextAction("remove feign death", 53.0f), NULL)));

triggers.push_back(new TriggerNode(
"hunters pet low health",
NextAction::array(0, new NextAction("mend pet", 60.0f), NULL)));
Expand Down
15 changes: 15 additions & 0 deletions src/modules/Bots/playerbot/strategy/hunter/HunterActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ namespace ai
CastFeignDeathAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "feign death") {}
};

class RemoveFeignDeathAction : public Action
{
public:
RemoveFeignDeathAction(PlayerbotAI* ai) : Action(ai, "remove feign death") {}
virtual bool Execute(Event event)
{
bot->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
return true;
}
virtual bool isUseful()
{
return bot->hasUnitState(UNIT_STAT_DIED);
}
};

class CastRapidFireAction : public CastBuffSpellAction
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ namespace ai
creators["aspect of the viper"] = &TriggerFactoryInternal::aspect_of_the_viper;
creators["trueshot aura"] = &TriggerFactoryInternal::trueshot_aura;
creators["serpent sting on attacker"] = &TriggerFactoryInternal::serpent_sting_on_attacker;
creators["has feign death"] = &TriggerFactoryInternal::has_feign_death;
}

private:
static Trigger* serpent_sting_on_attacker(PlayerbotAI* ai) { return new SerpentStingOnAttackerTrigger(ai); }
static Trigger* has_feign_death(PlayerbotAI* ai) { return new FeignDeathTrigger(ai); }
static Trigger* trueshot_aura(PlayerbotAI* ai) { return new TrueshotAuraTrigger(ai); }
static Trigger* aspect_of_the_viper(PlayerbotAI* ai) { return new HunterAspectOfTheViperTrigger(ai); }
static Trigger* black_arrow(PlayerbotAI* ai) { return new BlackArrowTrigger(ai); }
Expand Down Expand Up @@ -142,6 +144,7 @@ namespace ai
creators["aspect of the cheetah"] = &AiObjectContextInternal::aspect_of_the_cheetah;
creators["trueshot aura"] = &AiObjectContextInternal::trueshot_aura;
creators["feign death"] = &AiObjectContextInternal::feign_death;
creators["remove feign death"] = &AiObjectContextInternal::remove_feign_death;
creators["wing clip"] = &AiObjectContextInternal::wing_clip;
creators["disengage"] = &AiObjectContextInternal::disengage;
creators["immolation trap"] = &AiObjectContextInternal::immolation_trap;
Expand All @@ -157,6 +160,7 @@ namespace ai

private:
static Action* feign_death(PlayerbotAI* ai) { return new CastFeignDeathAction(ai); }
static Action* remove_feign_death(PlayerbotAI* ai) { return new RemoveFeignDeathAction(ai); }
static Action* trueshot_aura(PlayerbotAI* ai) { return new CastTrueshotAuraAction(ai); }
static Action* auto_shot(PlayerbotAI* ai) { return new CastAutoShotAction(ai); }
static Action* aimed_shot(PlayerbotAI* ai) { return new CastAimedShotAction(ai); }
Expand Down
27 changes: 27 additions & 0 deletions src/modules/Bots/playerbot/strategy/hunter/HunterTriggers.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,31 @@ namespace ai
SerpentStingOnAttackerTrigger(PlayerbotAI* ai) : DebuffOnAttackerTrigger(ai, "serpent sting") {}
};

class FeignDeathTrigger : public Trigger
{
public:
FeignDeathTrigger(PlayerbotAI* ai) : Trigger(ai, "has feign death", 1) {}
virtual bool IsActive()
{
if (!bot->hasUnitState(UNIT_STAT_DIED))
return false;

if (AI_VALUE(uint8, "attacker count") > 0)
return false;

Unit::AuraList const& auras = bot->GetAurasByType(SPELL_AURA_FEIGN_DEATH);
if (auras.empty())
return false;

Aura* aura = auras.front();
int32 maxDuration = aura->GetAuraMaxDuration();
int32 remaining = aura->GetAuraDuration();

if (maxDuration > 0)
return (maxDuration - remaining) >= 5000;

return true;
}
};

}
Loading