mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Rogue eviscerate for almost dead enemy
This commit is contained in:
@@ -101,6 +101,11 @@ void DpsRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|||||||
NextAction::array(0,
|
NextAction::array(0,
|
||||||
new NextAction("rupture", ACTION_HIGH + 1), NULL)));
|
new NextAction("rupture", ACTION_HIGH + 1), NULL)));
|
||||||
|
|
||||||
|
triggers.push_back(new TriggerNode(
|
||||||
|
"target with combo points almost dead",
|
||||||
|
NextAction::array(0,
|
||||||
|
new NextAction("eviscerate", ACTION_HIGH + 1), NULL)));
|
||||||
|
|
||||||
triggers.push_back(new TriggerNode(
|
triggers.push_back(new TriggerNode(
|
||||||
"medium threat",
|
"medium threat",
|
||||||
NextAction::array(0, new NextAction("vanish", ACTION_HIGH), NULL)));
|
NextAction::array(0, new NextAction("vanish", ACTION_HIGH), NULL)));
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
|||||||
creators["off hand weapon no enchant"] = &RogueTriggerFactoryInternal::off_hand_weapon_no_enchant;
|
creators["off hand weapon no enchant"] = &RogueTriggerFactoryInternal::off_hand_weapon_no_enchant;
|
||||||
creators["tricks of the trade on main tank"] = &RogueTriggerFactoryInternal::tricks_of_the_trade_on_main_tank;
|
creators["tricks of the trade on main tank"] = &RogueTriggerFactoryInternal::tricks_of_the_trade_on_main_tank;
|
||||||
creators["adrenaline rush"] = &RogueTriggerFactoryInternal::adrenaline_rush;
|
creators["adrenaline rush"] = &RogueTriggerFactoryInternal::adrenaline_rush;
|
||||||
|
creators["target with combo points almost dead"] =&RogueTriggerFactoryInternal::target_with_combo_points_almost_dead;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -91,6 +92,7 @@ class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
|||||||
static Trigger* main_hand_weapon_no_enchant(PlayerbotAI* ai) { return new MainHandWeaponNoEnchantTrigger(ai); }
|
static Trigger* main_hand_weapon_no_enchant(PlayerbotAI* ai) { return new MainHandWeaponNoEnchantTrigger(ai); }
|
||||||
static Trigger* off_hand_weapon_no_enchant(PlayerbotAI* ai) { return new OffHandWeaponNoEnchantTrigger(ai); }
|
static Trigger* off_hand_weapon_no_enchant(PlayerbotAI* ai) { return new OffHandWeaponNoEnchantTrigger(ai); }
|
||||||
static Trigger* tricks_of_the_trade_on_main_tank(PlayerbotAI* ai) { return new TricksOfTheTradeOnMainTankTrigger(ai); }
|
static Trigger* tricks_of_the_trade_on_main_tank(PlayerbotAI* ai) { return new TricksOfTheTradeOnMainTankTrigger(ai); }
|
||||||
|
static Trigger* target_with_combo_points_almost_dead(PlayerbotAI* ai) { return new TargetWithComboPointsLowerHealTrigger(ai, 3, 3.0f); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class RogueAiObjectContextInternal : public NamedObjectContext<Action>
|
class RogueAiObjectContextInternal : public NamedObjectContext<Action>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "RogueTriggers.h"
|
#include "RogueTriggers.h"
|
||||||
|
#include "GenericTriggers.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "ServerFacade.h"
|
#include "ServerFacade.h"
|
||||||
|
|
||||||
@@ -116,4 +117,12 @@ bool OffHandWeaponNoEnchantTrigger::IsActive() {
|
|||||||
if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
|
if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TargetWithComboPointsLowerHealTrigger::IsActive() {
|
||||||
|
Unit* target = AI_VALUE(Unit*, "current target");
|
||||||
|
if (!target || !target->IsAlive() || !target->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ComboPointsAvailableTrigger::IsActive() && (target->GetHealth() / AI_VALUE(float, "expected group dps")) <= lifeTime;
|
||||||
}
|
}
|
||||||
@@ -113,4 +113,13 @@ class TricksOfTheTradeOnMainTankTrigger : public BuffOnMainTankTrigger
|
|||||||
TricksOfTheTradeOnMainTankTrigger(PlayerbotAI* ai) : BuffOnMainTankTrigger(ai, "tricks of the trade", true) {}
|
TricksOfTheTradeOnMainTankTrigger(PlayerbotAI* ai) : BuffOnMainTankTrigger(ai, "tricks of the trade", true) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TargetWithComboPointsLowerHealTrigger : public ComboPointsAvailableTrigger
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TargetWithComboPointsLowerHealTrigger(PlayerbotAI* ai, int32 combo_point = 5, float lifeTime = 8.0f) : ComboPointsAvailableTrigger(ai, combo_point), lifeTime(lifeTime) {}
|
||||||
|
bool IsActive() override;
|
||||||
|
private:
|
||||||
|
float lifeTime;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user