Monk.cs
Code:
// Deadly Reach: Foresight, every 27 seconds or 2.7 seconds with combo strike
if (!UseOOCBuff && !IsCurrentlyAvoiding && CombatBase.CanCast(SNOPower.Monk_DeadlyReach) && (isDualOrTriGen || hasForesight) &&
(SpellHistory.TimeSinceUse(SNOPower.Monk_DeadlyReach) > TimeSpan.FromMilliseconds(drInterval) ||
(SpellHistory.SpellUseCountInTime(SNOPower.Monk_DeadlyReach, TimeSpan.FromMilliseconds(27000)) < 3) && hasForesight))
{
Monk_TickSweepingWindSpam();
return new TrinityPower(SNOPower.Monk_DeadlyReach, 16f, Vector3.Zero, -1, CurrentTarget.ACDGuid, 0, 3, WAIT_FOR_ANIM);
}
we should strike 3 times in a row to applay +18% buff
this code will not do it, becouse we use DeadlyReach each ~3seconds
(SpellHistory.TimeSinceUse(SNOPower.Monk_DeadlyReach) > TimeSpan.FromMilliseconds(drInterval)
and
SpellHistory.SpellUseCountInTime(SNOPower.Monk_DeadlyReach, TimeSpan.FromMilliseconds(27000)) ~ 9
my "I'm fixed it" code for Foresight buff (with numbers that works for me [ TPS =30])
Code:
if (!UseOOCBuff && !IsCurrentlyAvoiding && CombatBase.CanCast(SNOPower.Monk_DeadlyReach) && (DRcount > 0 || DateTime.Now.Subtract(TimeDR).TotalMilliseconds > 27000))
{
if (DRcount == 0)
{
TimeDRstart = DateTime.Now;
}
DRcount++;
if (DateTime.Now.Subtract(TimeDRstart).TotalMilliseconds > 2500)
{
DRcount = 0;
}
if (DRcount == 20)
{
DRcount = 0;
TimeDR = DateTime.Now;
}
Monk_TickSweepingWindSpam();
return new TrinityPower(SNOPower.Monk_DeadlyReach, 16f, Vector3.Zero, -1, CurrentTarget.ACDGuid, 0, 3, WAIT_FOR_ANIM);
}
if we can't attemp to use DeadlyReach 20 times in 2500ms since TimeDRstart then whe should start over.
View attachment 108258
i don't know how SpellUseCounInTime works (does it count attempts to use abilities or actually use it?) Maybe i can make my code more simple and efficient.