General trigger fix

This commit is contained in:
Yunfan Li
2024-09-01 17:19:12 +08:00
parent 360a025b34
commit 52bb8b9770
6 changed files with 29 additions and 28 deletions

View File

@@ -77,8 +77,6 @@ public:
creators["tricks of the trade on main tank"] = &RogueTriggerFactoryInternal::tricks_of_the_trade_on_main_tank;
creators["adrenaline rush"] = &RogueTriggerFactoryInternal::adrenaline_rush;
creators["blade fury"] = &RogueTriggerFactoryInternal::blade_fury;
creators["target with combo points almost dead"] =
&RogueTriggerFactoryInternal::target_with_combo_points_almost_dead;
}
private:
@@ -102,10 +100,6 @@ private:
{
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>

View File

@@ -124,14 +124,3 @@ bool OffHandWeaponNoEnchantTrigger::IsActive()
return false;
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, "estimated group dps")) <= lifeTime;
}

View File

@@ -127,17 +127,6 @@ public:
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