Advertisement
Guest User

Untitled

a guest
May 26th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. /// <summary>
  2. /// Checks if the element for a skill is close enough to the desired element to wait for it.
  3. /// </summary>
  4. /// <param name="skill">skill to check the damage type element of</param>
  5. /// <param name="element">element you want to be the current element</param>
  6. /// <param name="start"> we can cast for this long before the specified element starts</param>
  7. /// <param name="finish"> we can cast for this long after the specified element starts</param>
  8. /// <returns></returns>
  9. public static bool ShouldWaitForConventionofElements(Skill skill, Element element = Element.Unknown, int start = 0, int finish = 4000)
  10. {
  11. if (!Settings.Combat.Misc.UseConventionElementOnly)
  12. return false;
  13.  
  14. if (!TargetUtil.AnyBossesInRange(200f))
  15. return false;
  16.  
  17. if (!Legendary.ConventionOfElements.IsEquipped)
  18. return false;
  19.  
  20. if (GetHasBuff(SNOPower.Pages_Buff_Infinite_Casting))
  21. return false;
  22.  
  23. if (Settings.Combat.Misc.IgnoreCoEunlessGRift && ZetaDia.CurrentRift.Type != RiftType.Greater)
  24. return false;
  25.  
  26. var theElement = element == Element.Unknown ? skill.Element : element;
  27. var timeTo = TimeToElementStart(theElement);
  28. var timeSince = TimeFromElementStart(theElement);
  29. var totalDuration = GetConventionRotation().Count*4000;
  30.  
  31. if (timeTo < start)
  32. return false;
  33.  
  34. if (timeSince < finish)
  35. return false;
  36.  
  37. //if (timeTo - start > skill.Cooldown.TotalMilliseconds &&
  38. // skill.Cooldown.TotalMilliseconds < totalDuration)
  39. // return false;
  40.  
  41. if ((timeTo - start) > GetRealCooldown(skill) &&
  42. GetRealCooldown(skill) < totalDuration)
  43. {
  44. return false;
  45. }
  46.  
  47. return true;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement