Rogue eviscerate for almost dead enemy

This commit is contained in:
Yunfan Li
2024-01-07 00:47:20 +08:00
parent bc193f3cc3
commit 09db983a35
4 changed files with 25 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
*/
#include "RogueTriggers.h"
#include "GenericTriggers.h"
#include "Playerbots.h"
#include "ServerFacade.h"
@@ -116,4 +117,12 @@ bool OffHandWeaponNoEnchantTrigger::IsActive() {
if (!itemForSpell || itemForSpell->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
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, "expected group dps")) <= lifeTime;
}