// Rend spam
if (!bOOCBuff && !playerStatus.bIsIncapacitated && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Rend) &&
iAnythingWithinRange[RANGE_12] >= 1 &&
// Doesn't need CURRENT target to be in range, just needs ANYTHING to be within 9 foot, since it's an AOE!
(iAnythingWithinRange[RANGE_6] > 0 || targetCurrent.fRadiusDistance <= 6f) &&
// Don't use against goblins (they run too quick!)
(!targetCurrent.bThisTreasureGoblin || iAnythingWithinRange[RANGE_12] >= 5) &&
(
// This segment is for people who DON'T have whirlwind
(!hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind) &&
(
// *DON'T* use rend if we currently have wrath/earthquake/call available & needed but need to save up energy energy
(!bWaitingForSpecial || playerStatus.dCurrentEnergy >= 75) &&
// Bunch of optionals now that go hand in hand with all of the above...
(
// Either off full 4 second or so cooldown...
GilesUseTimer(SNOPower.Barbarian_Rend) ||
// ... or ability to spam rend every 0.4 seconds if more enemies in range than when last used rend...
(iAnythingWithinRange[RANGE_6] > iWithinRangeLastRend && DateTime.Now.Subtract(dictAbilityLastUse[SNOPower.Barbarian_Rend]).TotalMilliseconds >= 1000) ||
// ... or ability to spam rend every 1.1 seconds if current primary target changes...
(targetCurrent.iThisACDGUID != iACDGUIDLastRend && DateTime.Now.Subtract(dictAbilityLastUse[SNOPower.Barbarian_Rend]).TotalMilliseconds >= 1800) ||
// ... or ability to spam rend every 1.5 seconds with almost full fury
(playerStatus.dCurrentEnergyPct >= 0.85 && DateTime.Now.Subtract(dictAbilityLastUse[SNOPower.Barbarian_Rend]).TotalMilliseconds >= 2500) ||
// ... or ability to spam rend every 2 seconds with a lot of fury
(playerStatus.dCurrentEnergyPct >= 0.65 && DateTime.Now.Subtract(dictAbilityLastUse[SNOPower.Barbarian_Rend]).TotalMilliseconds >= 3500)
)
)) ||
// This segment is for people who *DO* have whirlwind
(hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind) &&
// See if it's off-cooldown and at least 40 fury, or use as a fury dump
(
(settings.bFuryDumpWrath && playerStatus.dCurrentEnergyPct >= 0.92 && GilesHasBuff(SNOPower.Barbarian_WrathOfTheBerserker)) ||
(settings.bFuryDumpAlways && playerStatus.dCurrentEnergyPct >= 0.92) ||
(DateTime.Now.Subtract(dictAbilityLastUse[SNOPower.Barbarian_Rend]).TotalMilliseconds >= 2800)
) &&
// Max once every 1.2 seconds even if fury dumping, so sprint can be fury dumped too
// DateTime.Now.Subtract(dictAbilityLastUse[SNOPower.Barbarian_Rend]).TotalMilliseconds >= 1200 &&
// 3+ mobs of any kind at close range *OR* one elite/boss/special at close range
(
(iAnythingWithinRange[RANGE_15] >= 3 && iElitesWithinRange[RANGE_12] >= 1) ||
(iAnythingWithinRange[RANGE_15] >= 3 && targetCurrent.bThisTreasureGoblin && targetCurrent.fRadiusDistance <= 13f) ||
iAnythingWithinRange[RANGE_15] >= 5 ||
((targetCurrent.bThisEliteRareUnique || targetCurrent.bThisBoss) && targetCurrent.fRadiusDistance <= 13f && iAnythingWithinRange[RANGE_15] >= 3)
)
)
) &&
// And finally, got at least 20 energy
playerStatus.dCurrentEnergy >= 20)
{
iWithinRangeLastRend = iAnythingWithinRange[RANGE_6];
iACDGUIDLastRend = targetCurrent.iThisACDGUID;
// Note - we have LONGER animation times for whirlwind-users
// Since whirlwind seems to interrupt rend so easily
int iPreDelay = 0;
int iPostDelay = 0;
if (hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind))
{
if (powerLastSnoPowerUsed == SNOPower.Barbarian_Whirlwind || powerLastSnoPowerUsed == SNOPower.None)
{
iPreDelay = 5;
iPostDelay = 5;
}
}
return new GilesPower(SNOPower.Barbarian_Rend, 0f, playerStatus.vCurrentPosition, iCurrentWorldID, -1, iPreDelay, iPostDelay, USE_SLOWLY);
}