miscs(raid strategy, distance triggers, etc)

This commit is contained in:
Yunfan Li
2023-06-06 00:11:35 +08:00
parent 516366a74d
commit 98e46a3d02
32 changed files with 2711 additions and 76 deletions

View File

@@ -76,6 +76,9 @@ void GenericHunterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
// triggers.push_back(new TriggerNode("no ammo", NextAction::array(0, new NextAction("switch to melee", ACTION_HIGH + 1), new NextAction("say::no ammo", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode("aspect of the viper", NextAction::array(0, new NextAction("aspect of the viper", ACTION_HIGH), NULL)));
triggers.push_back(new TriggerNode("enemy too close for shoot", NextAction::array(0, new NextAction("flee", ACTION_HIGH + 3), NULL)));
triggers.push_back(new TriggerNode("misdirection on main tank", NextAction::array(0, new NextAction("misdirection on main tank", ACTION_HIGH + 7), NULL)));
triggers.push_back(new TriggerNode("tranquilizing shot", NextAction::array(0, new NextAction("tranquilizing shot", 61.0f), NULL)));
}
NextAction** HunterBoostStrategy::getDefaultActions()

View File

@@ -67,7 +67,7 @@ END_SPELL_ACTION()
BEGIN_RANGED_SPELL_ACTION(CastKillShotAction, "kill shot")
END_SPELL_ACTION()
BEGIN_RANGED_SPELL_ACTION(CastTranquilizingShortAction, "tranquilizing shot")
BEGIN_RANGED_SPELL_ACTION(CastTranquilizingShotAction, "tranquilizing shot")
END_SPELL_ACTION()
class CastAspectOfTheHawkAction : public CastBuffSpellAction
@@ -218,4 +218,9 @@ class CastScareBeastCcAction : public CastSpellAction
bool Execute(Event event) override;
};
class CastMisdirectionOnMainTankAction : public BuffOnMainTankAction
{
public:
CastMisdirectionOnMainTankAction(PlayerbotAI* ai) : BuffOnMainTankAction(ai, "misdirection", true) {}
};
#endif

View File

@@ -80,6 +80,8 @@ class HunterTriggerFactoryInternal : public NamedObjectContext<Trigger>
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"] = &HunterTriggerFactoryInternal::remove_enrage;
}
private:
@@ -105,6 +107,8 @@ class HunterTriggerFactoryInternal : public NamedObjectContext<Trigger>
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); }
};
class HunterAiObjectContextInternal : public NamedObjectContext<Action>
@@ -152,6 +156,7 @@ class HunterAiObjectContextInternal : public NamedObjectContext<Action>
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;
}
private:
@@ -191,9 +196,10 @@ class HunterAiObjectContextInternal : public NamedObjectContext<Action>
static Action* wing_clip(PlayerbotAI* botAI) { return new CastWingClipAction(botAI); }
static Action* raptor_strike(PlayerbotAI* botAI) { return new CastRaptorStrikeAction(botAI); }
static Action* aspect_of_the_dragonhawk(PlayerbotAI* ai) { return new CastAspectOfTheDragonhawkAction(ai); }
static Action* tranquilizing_shot(PlayerbotAI* ai) { return new CastTranquilizingShortAction(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); }
};
HunterAiObjectContext::HunterAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)

View File

@@ -7,6 +7,7 @@
#include "GenericTriggers.h"
#include "Trigger.h"
#include "CureTriggers.h"
class PlayerbotAI;
@@ -149,4 +150,15 @@ class SwitchToMeleeTrigger : public Trigger
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) {}
};
#endif