mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-17 17:14:36 +00:00
General trigger fix
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user