Guest User

Untitled

a guest
Oct 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 106.17 KB | None | 0 0
  1. /*
  2. * CustomClass for TheNoobBot
  3. * Credit : Rival, Geesus, Enelya, Marstor, Vesper, Neo2003
  4. * Thanks you !
  5. */
  6.  
  7. using System;
  8. using System.IO;
  9. using System.Threading;
  10. using System.Windows.Forms;
  11. using nManager.Helpful;
  12. using nManager.Wow.Class;
  13. using nManager.Wow.Enums;
  14. using nManager.Wow.Helpers;
  15. using nManager.Wow.ObjectManager;
  16. using Keybindings = nManager.Wow.Enums.Keybindings;
  17. using Timer = nManager.Helpful.Timer;
  18.  
  19. public class Main : ICustomClass
  20. {
  21.     internal static float range = 3.5f;
  22.     internal static bool loop = true;
  23.  
  24.     public float Range
  25.     {
  26.         get { return range; }
  27.         set { range = value; }
  28.     }
  29.  
  30.     public void Initialize()
  31.     {
  32.         try
  33.         {
  34.             Logging.WriteFight("Loading combat system.");
  35.  
  36.             switch (ObjectManager.Me.WowClass)
  37.             {
  38.                 #region Paladin Specialisation checking
  39.                 case WoWClass.Paladin:
  40.                     var Retribution_Spell = new Spell("Templar's Verdict");
  41.                     var Protection_Spell = new Spell("Avenger's Shield");
  42.                     var Holy_Spell = new Spell("Holy Shock");
  43.                     if (Retribution_Spell.KnownSpell)
  44.                     {
  45.                         Logging.WriteFight("Loading Paladin Retribution class...");
  46.                         new Paladin_Retribution();
  47.                         break;
  48.                     }
  49.                     else if (Protection_Spell.KnownSpell)
  50.                     {
  51.                         Logging.WriteFight("Loading Paladin Protection class...");
  52.                         new Paladin_Protection();
  53.                         break;
  54.                     }
  55.                     else if (Holy_Spell.KnownSpell)
  56.                     {
  57.                         Logging.WriteFight("Loading Paladin Holy class...");
  58.                         new Paladin_Holy();
  59.                         break;
  60.                     }
  61.                     else
  62.                     {
  63.                         Logging.WriteFight("No specialisation detected.");
  64.                         Logging.WriteFight("Loading Paladin Retribution class...");
  65.                         new Paladin_Retribution();
  66.                         break;
  67.                     }
  68.                 #endregion
  69.  
  70.                default:
  71.                     Dispose();
  72.                     break;
  73.             }
  74.         }
  75.         catch { }
  76.         Logging.WriteFight("Combat system stopped.");
  77.     }
  78.  
  79.     public void Dispose()
  80.     {
  81.         Logging.WriteFight("Combat system stopped.");
  82.         loop = false;
  83.     }
  84.  
  85.     public void ShowConfiguration()
  86.     {
  87.         Directory.CreateDirectory(Application.StartupPath + "\\CustomClasses\\Settings\\");
  88.         switch (ObjectManager.Me.WowClass)
  89.         {
  90.             #region Paladin Specialisation checking
  91.             case WoWClass.Paladin:
  92.                 var Retribution_Spell = new Spell("Templar's Verdict");
  93.                 var Protection_Spell = new Spell("Avenger's Shield");
  94.                 var Holy_Spell = new Spell("Holy Shock");
  95.  
  96.                 if (Retribution_Spell.KnownSpell)
  97.                 {
  98.                     string CurrentSettingsFile = Application.StartupPath + "\\CustomClasses\\Settings\\Paladin_Retribution.xml";
  99.                     Paladin_Retribution.PaladinRetributionSettings CurrentSetting;
  100.                     CurrentSetting = new Paladin_Retribution.PaladinRetributionSettings();
  101.                     if (System.IO.File.Exists(CurrentSettingsFile))
  102.                     {
  103.                         CurrentSetting = Settings.Load<Paladin_Retribution.PaladinRetributionSettings>(CurrentSettingsFile);
  104.                     }
  105.                     CurrentSetting.ToForm();
  106.                     CurrentSetting.Save(CurrentSettingsFile);
  107.                 }
  108.                 else if (Holy_Spell.KnownSpell)
  109.                 {
  110.                     string CurrentSettingsFile = Application.StartupPath + "\\CustomClasses\\Settings\\Paladin_Holy.xml";
  111.                     Paladin_Holy.PaladinHolySettings CurrentSetting;
  112.                     CurrentSetting = new Paladin_Holy.PaladinHolySettings();
  113.                     if (System.IO.File.Exists(CurrentSettingsFile))
  114.                     {
  115.                         CurrentSetting = Settings.Load<Paladin_Holy.PaladinHolySettings>(CurrentSettingsFile);
  116.                     }
  117.                     CurrentSetting.ToForm();
  118.                     CurrentSetting.Save(CurrentSettingsFile);
  119.                 }
  120.                 else
  121.                 {
  122.                     System.Windows.Forms.MessageBox.Show("Your specification haven't be found, loading Paladin Retribution Settings");
  123.                     string CurrentSettingsFile = Application.StartupPath + "\\CustomClasses\\Settings\\Paladin_Retribution.xml";
  124.                     Paladin_Retribution.PaladinRetributionSettings CurrentSetting;
  125.                     CurrentSetting = new Paladin_Retribution.PaladinRetributionSettings();
  126.                     if (System.IO.File.Exists(CurrentSettingsFile))
  127.                     {
  128.                         CurrentSetting = Settings.Load<Paladin_Retribution.PaladinRetributionSettings>(CurrentSettingsFile);
  129.                     }
  130.                     CurrentSetting.ToForm();
  131.                     CurrentSetting.Save(CurrentSettingsFile);
  132.                 }
  133.                 break;
  134.             #endregion
  135.         }
  136.     }
  137. }
  138.  
  139. #region Paladin
  140.  
  141.  
  142. public class Paladin_Holy
  143. {
  144.     [Serializable]
  145.     public class PaladinHolySettings : nManager.Helpful.Settings
  146.     {
  147.         public bool UseDivineProtection = true;
  148.  
  149.         public PaladinHolySettings()
  150.         {
  151.             ConfigWinForm(new System.Drawing.Point(400, 400), "Paladin Holy Settings");
  152.             AddControlInWinForm("Use Divine Protection", "UseDivineProtection", "Protection Cycle");
  153.         }
  154.     }
  155.     #region Professions & Racial
  156.     private readonly Spell Arcane_Torrent = new Spell("Arcane Torrent");
  157.     private readonly Spell Lifeblood = new Spell("Lifeblood");
  158.     private readonly Spell Stoneform = new Spell("Stoneform");
  159.     private readonly Spell Tailoring = new Spell("Tailoring");
  160.     private readonly Spell Leatherworking = new Spell("Leatherworking");
  161.     private readonly Spell Gift_of_the_Naaru = new Spell("Gift of the Naaru");
  162.     private readonly Spell War_Stomp = new Spell("War Stomp");
  163.     private readonly Spell Berserking = new Spell("Berserking");
  164.     #endregion
  165.  
  166.     #region Paladin Seals & Buffs
  167.     private readonly Spell SealOfTheRighteousness = new Spell("Seal of Righteousness");
  168.     private readonly Spell SealOfTruth = new Spell("Seal of Truth");
  169.     private readonly Spell SealOfInsight = new Spell("Seal of Insight");
  170.     private readonly Spell SealOfJustice = new Spell("Seal of Justice");
  171.     private readonly Spell BlessingOfKings = new Spell("Blessing of Kings");
  172.     #endregion
  173.  
  174.     #region Offensive Spell
  175.     private readonly Spell HammerOfJustice = new Spell("Hammer of Justice");
  176.     private readonly Spell HammerOfWrath = new Spell("Hammer of Wrath");
  177.     private readonly Spell HolyShock = new Spell("Holy Shock");
  178.     private readonly Spell Denounce = new Spell("Denounce");
  179.     #endregion
  180.  
  181.     #region Offensive Cooldown
  182.     private readonly Spell HolyAvenger = new Spell("HolyAvenger");
  183.     private readonly Spell AvengingWrath = new Spell("Avenging Wrath");
  184.     private readonly Spell DivineFavor = new Spell("Divine Favor");
  185.     #endregion
  186.  
  187.     #region Defensive Cooldown
  188.     private readonly Spell DevotionAura = new Spell("Devotion Aura");
  189.     private readonly Spell DivineProtection = new Spell("Divine Protection");
  190.     private readonly Spell DivineShield = new Spell("Divine Shield");
  191.     private readonly Spell HandOfProtection = new Spell("Hand of Protection");
  192.     #endregion
  193.  
  194.     #region Healing Spell
  195.     private readonly Spell DivinePlea = new Spell("Divine Plea");
  196.     private readonly Spell DivineLight = new Spell("Divine Light");
  197.     private readonly Spell HolyRadiance = new Spell("Holy Radiance");
  198.     private readonly Spell FlashOfLight = new Spell("Flash of Light");
  199.     private readonly Spell HolyLight = new Spell("Holy Light");
  200.     private readonly Spell LayOnHands = new Spell("Lay on Hands");
  201.     private readonly Spell WordOfGlory = new Spell("Word of Glory");
  202.     private readonly Spell GlyphOfHarshWords = new Spell("Glyph of Harsh Words");
  203.     #endregion
  204.  
  205.     public Paladin_Holy()
  206.     {
  207.         Main.range = 20f;
  208.  
  209.         UInt64 lastTarget = 0;
  210.  
  211.         while (Main.loop)
  212.         {
  213.             try
  214.             {
  215.                 if (!ObjectManager.Me.IsMounted)
  216.                 {
  217.                     Patrolling();
  218.  
  219.                     if (Fight.InFight && ObjectManager.Me.Target > 0)
  220.                     {
  221.                         if (ObjectManager.Me.Target != lastTarget && HolyShock.IsDistanceGood)
  222.                         {
  223.                             Pull();
  224.                             lastTarget = ObjectManager.Me.Target;
  225.                         }
  226.  
  227.                         Combat();
  228.                     }
  229.                 }
  230.             }
  231.             catch
  232.             {
  233.             }
  234.             Thread.Sleep(50);
  235.         }
  236.     }
  237.  
  238.     private void Pull()
  239.     {
  240.         if (HolyShock.KnownSpell && HolyShock.IsDistanceGood && HolyShock.IsSpellUsable)
  241.         {
  242.             HolyShock.Launch();
  243.             return;
  244.         }
  245.     }
  246.  
  247.     private void Combat()
  248.     {
  249.         DPS_Cycle();
  250.  
  251.         Heal();
  252.  
  253.         DPS_Burst();
  254.     }
  255.  
  256.     private void Patrolling()
  257.     {
  258.         if (!ObjectManager.Me.IsMounted)
  259.         {
  260.             Seal();
  261.             Blessing();
  262.         }
  263.     }
  264.  
  265.     private void Seal()
  266.     {
  267.         if (ObjectManager.Me.IsMounted)
  268.             return;
  269.         if (SealOfInsight.KnownSpell)
  270.         {
  271.             if (!SealOfInsight.HaveBuff && SealOfInsight.IsSpellUsable)
  272.             {
  273.                 SealOfInsight.Launch();
  274.             }
  275.         }
  276.         else if (SealOfTruth.KnownSpell)
  277.         {
  278.             if (!SealOfTruth.HaveBuff && SealOfTruth.IsSpellUsable)
  279.             {
  280.                 SealOfTruth.Launch();
  281.             }
  282.         }
  283.         else if (SealOfTheRighteousness.KnownSpell)
  284.             if (!SealOfTheRighteousness.HaveBuff && SealOfTheRighteousness.IsSpellUsable)
  285.             {
  286.                 {
  287.                     SealOfTheRighteousness.Launch();
  288.                 }
  289.             }
  290.     }
  291.  
  292.     private void Blessing()
  293.     {
  294.         if (ObjectManager.Me.IsMounted)
  295.             return;
  296.  
  297.         if (BlessingOfKings.KnownSpell && !BlessingOfKings.HaveBuff && BlessingOfKings.IsSpellUsable)
  298.         {
  299.             BlessingOfKings.Launch();
  300.         }
  301.     }
  302.  
  303.     private void Heal()
  304.     {
  305.         if (ObjectManager.Me.HealthPercent < 95 && !Fight.InFight && ObjectManager.GetNumberAttackPlayer() == 0)
  306.         {
  307.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  308.             {
  309.                 FlashOfLight.Launch();
  310.                 MovementManager.StopMove();
  311.                 return;
  312.             }
  313.         }
  314.         if (DivineShield.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent <= 5 && !ObjectManager.Me.HaveBuff(25771) && DivineShield.IsSpellUsable)
  315.         {
  316.             DivineShield.Launch();
  317.             return;
  318.         }
  319.         if (LayOnHands.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent <= 20 && !ObjectManager.Me.HaveBuff(25771) && LayOnHands.IsSpellUsable)
  320.         {
  321.             LayOnHands.Launch();
  322.             return;
  323.         }
  324.         if (ObjectManager.Me.BarTwoPercentage < 10)
  325.         {
  326.             if (Arcane_Torrent.KnownSpell && Arcane_Torrent.IsSpellUsable)
  327.                 Arcane_Torrent.Launch();
  328.             if (DivinePlea.KnownSpell && DivinePlea.IsSpellUsable)
  329.             {
  330.                 DivinePlea.Launch();
  331.                 return;
  332.             }
  333.         }
  334.         if (ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent < 50)
  335.         {
  336.             if (WordOfGlory.KnownSpell && WordOfGlory.IsSpellUsable && (!GlyphOfHarshWords.KnownSpell /* || cast on me */))
  337.                 WordOfGlory.Launch();
  338.             if (DivineLight.KnownSpell && DivineLight.IsSpellUsable)
  339.             {
  340.                 DivineLight.Launch();
  341.                 return;
  342.             }
  343.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  344.             {
  345.                 FlashOfLight.Launch();
  346.                 return;
  347.             }
  348.             if (HolyLight.KnownSpell && HolyLight.IsSpellUsable)
  349.             {
  350.                 HolyLight.Launch();
  351.                 return;
  352.             }
  353.         }
  354.         if (ObjectManager.Me.HealthPercent >= 0 && ObjectManager.Me.HealthPercent < 30)
  355.         {
  356.             if (WordOfGlory.KnownSpell && WordOfGlory.IsSpellUsable && (!GlyphOfHarshWords.KnownSpell /* || cast on me */))
  357.                 WordOfGlory.Launch();
  358.             if (DivineProtection.KnownSpell && DivineProtection.IsSpellUsable)
  359.                 DivineProtection.Launch();
  360.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  361.             {
  362.                 FlashOfLight.Launch();
  363.                 return;
  364.             }
  365.             if (HolyLight.KnownSpell && HolyLight.IsSpellUsable)
  366.             {
  367.                 HolyLight.Launch();
  368.                 return;
  369.             }
  370.             if (DivineLight.KnownSpell && DivineLight.IsSpellUsable)
  371.             {
  372.                 DivineLight.Launch();
  373.                 return;
  374.             }
  375.         }
  376.     }
  377.     private void DPS_Burst()
  378.     {
  379.         if (DivineFavor.KnownSpell && DivineFavor.IsSpellUsable)
  380.         {
  381.             if (AvengingWrath.KnownSpell && AvengingWrath.IsSpellUsable)
  382.             {
  383.                 AvengingWrath.Launch();
  384.             }
  385.             if (Lifeblood.KnownSpell && Lifeblood.IsSpellUsable)
  386.             {
  387.                 Lifeblood.Launch();
  388.             }
  389.             if (HolyAvenger.KnownSpell && HolyAvenger.IsSpellUsable)
  390.             {
  391.                 HolyAvenger.Launch();
  392.             }
  393.             DivineFavor.Launch();
  394.             return;
  395.         }
  396.         else if (Lifeblood.KnownSpell && Lifeblood.IsSpellUsable)
  397.         {
  398.             Lifeblood.Launch();
  399.             return;
  400.         }
  401.     }
  402.     private void DPS_Cycle()
  403.     {
  404.         if (HolyShock.KnownSpell && HolyShock.IsDistanceGood && HolyShock.IsSpellUsable)
  405.         {
  406.             HolyShock.Launch();
  407.             return;
  408.         }
  409.         if (HammerOfWrath.KnownSpell && HammerOfWrath.IsDistanceGood && HammerOfWrath.IsSpellUsable)
  410.         {
  411.             HammerOfWrath.Launch();
  412.             return;
  413.         }
  414.         if (GlyphOfHarshWords.KnownSpell && WordOfGlory.KnownSpell && WordOfGlory.IsSpellUsable && ObjectManager.Me.HolyPower >= 3)
  415.         {
  416.             WordOfGlory.Launch();
  417.             return;
  418.         }
  419.         if (HammerOfJustice.KnownSpell && HammerOfJustice.IsDistanceGood && HammerOfJustice.IsSpellUsable)
  420.         {
  421.             HammerOfJustice.Launch();
  422.             return;
  423.         }
  424.         if (Denounce.KnownSpell && Denounce.IsDistanceGood && Denounce.IsSpellUsable)
  425.         {
  426.             Denounce.Launch();
  427.             return;
  428.         }
  429.     }
  430. }
  431.  
  432. public class Paladin_Protection
  433. {
  434.     #region Professions & Racial
  435.     private readonly Spell Arcane_Torrent = new Spell("Arcane Torrent");
  436.     private readonly Spell Lifeblood = new Spell("Lifeblood");
  437.     private readonly Spell Stoneform = new Spell("Stoneform");
  438.     private readonly Spell Tailoring = new Spell("Tailoring");
  439.     private readonly Spell Leatherworking = new Spell("Leatherworking");
  440.     private readonly Spell Gift_of_the_Naaru = new Spell("Gift of the Naaru");
  441.     private readonly Spell War_Stomp = new Spell("War Stomp");
  442.     private readonly Spell Berserking = new Spell("Berserking");
  443.     #endregion
  444.  
  445.     #region Paladin Seals & Buffs
  446.     private readonly Spell SealOfTheRighteousness = new Spell("Seal of Righteousness");
  447.     private readonly Spell SealOfTruth = new Spell("Seal of Truth");
  448.     private readonly Spell SealOfInsight = new Spell("Seal of Insight");
  449.     private readonly Spell BlessingOfMight = new Spell("Blessing of Might");
  450.     private readonly Spell BlessingOfKings = new Spell("Blessing of Kings");
  451.     #endregion
  452.  
  453.     #region Offensive Spell
  454.     private readonly Spell HammerOfTheRighteous = new Spell("Hammer of the Righteous"); // 115798 = Weakened Blows
  455.     private readonly Spell ShieldOfTheRighteous = new Spell("Shield of the Righteous");
  456.     private readonly Spell AvengersShield = new Spell("Avenger's Shield");
  457.     private readonly Spell CrusaderStrike = new Spell("Crusader Strike");
  458.     private readonly Spell Consecration = new Spell("Consecration");
  459.     private readonly Spell HolyWrath = new Spell("Holy Wrath");
  460.     private readonly Spell Judgment = new Spell("Judgment");
  461.     private readonly Spell HammerOfJustice = new Spell("Hammer of Justice");
  462.     private readonly Spell HammerOfWrath = new Spell("Hammer of Wrath");
  463.     #endregion
  464.  
  465.     #region Offensive Cooldown
  466.     private readonly Spell HolyAvenger = new Spell("Holy Avenger");
  467.     private readonly Spell AvengingWrath = new Spell("Avenging Wrath");
  468.     #endregion
  469.  
  470.     #region Defensive Cooldown
  471.     Timer OnCD = new Timer(0);
  472.     private readonly Spell GuardianOfAncientKings = new Spell("Guardian of Ancient Kings");
  473.     private readonly Spell HolyShield = new Spell("Holy Shield");
  474.     private readonly Spell ArdentDefender = new Spell("Ardent Defender");
  475.     private readonly Spell SacredShield = new Spell("Sacred Shield");
  476.     private readonly Spell HandOfPurity = new Spell("Hand Of Purity");
  477.     private readonly Spell DevotionAura = new Spell("Devotion Aura");
  478.     private readonly Spell DivineProtection = new Spell("Divine Protection");
  479.     private readonly Spell DivineShield = new Spell("Divine Shield");
  480.     private readonly Spell HandOfProtection = new Spell("Hand of Protection");
  481.     #endregion
  482.  
  483.     #region Healing Spell
  484.     private readonly Spell FlashOfLight = new Spell("Flash of Light");
  485.     private readonly Spell LayOnHands = new Spell("Lay on Hands");
  486.     private readonly Spell WordOfGlory = new Spell("Word of Glory");
  487.     #endregion
  488.  
  489.     public Paladin_Protection()
  490.     {
  491.         Main.range = 3.6f;
  492.  
  493.         UInt64 lastTarget = 0;
  494.  
  495.         while (Main.loop)
  496.         {
  497.             try
  498.             {
  499.                 if (!ObjectManager.Me.IsMounted)
  500.                 {
  501.                     if (Fight.InFight && ObjectManager.Me.Target > 0)
  502.                     {
  503.                         if (ObjectManager.Me.Target != lastTarget && Judgment.IsDistanceGood)
  504.                         {
  505.                             Pull();
  506.                             lastTarget = ObjectManager.Me.Target;
  507.                         }
  508.                         Combat();
  509.                         Seal();
  510.                         Blessing();
  511.                     }
  512.                     else
  513.                     {
  514.                         Patrolling();
  515.                     }
  516.                 }
  517.             }
  518.             catch
  519.             {
  520.             }
  521.             Thread.Sleep(150);
  522.         }
  523.     }
  524.  
  525.     private void Pull()
  526.     {
  527.         DPS_Burst();
  528.         if (Judgment.KnownSpell && Judgment.IsDistanceGood && Judgment.IsSpellUsable)
  529.         {
  530.             Judgment.Launch();
  531.             Thread.Sleep(1000);
  532.         }
  533.         if (AvengersShield.KnownSpell && AvengersShield.IsDistanceGood && AvengersShield.IsSpellUsable)
  534.         {
  535.             AvengersShield.Launch();
  536.         }
  537.     }
  538.  
  539.     private void Combat()
  540.     {
  541.         if (OnCD.IsReady)
  542.             Defense_Cycle();
  543.  
  544.         DPS_Cycle();
  545.  
  546.         Heal();
  547.  
  548.         DPS_Burst();
  549.     }
  550.  
  551.     private void Patrolling()
  552.     {
  553.         if (!ObjectManager.Me.IsMounted)
  554.         {
  555.             Seal();
  556.             Blessing();
  557.             Heal();
  558.         }
  559.     }
  560.  
  561.     private void Seal()
  562.     {
  563.         if (ObjectManager.Me.IsMounted)
  564.             return;
  565.  
  566.         if (SealOfTruth.KnownSpell && ObjectManager.GetNumberAttackPlayer() <= 7)
  567.         {
  568.             if (!SealOfTruth.HaveBuff && SealOfTruth.IsSpellUsable)
  569.                 SealOfTruth.Launch();
  570.         }
  571.         else if (SealOfTheRighteousness.KnownSpell)
  572.         {
  573.             if (!SealOfTheRighteousness.HaveBuff && SealOfTheRighteousness.IsSpellUsable)
  574.                 SealOfTheRighteousness.Launch();
  575.         }
  576.     }
  577.  
  578.     private void Blessing()
  579.     {
  580.         if (ObjectManager.Me.IsMounted)
  581.             return;
  582.         else if (BlessingOfMight.KnownSpell)
  583.         {
  584.             if (!BlessingOfMight.HaveBuff && BlessingOfMight.IsSpellUsable)
  585.                 BlessingOfMight.Launch();
  586.         }
  587.         else if (BlessingOfKings.KnownSpell)
  588.         {
  589.             if (!BlessingOfKings.HaveBuff && BlessingOfKings.IsSpellUsable)
  590.                 BlessingOfKings.Launch();
  591.         }
  592.     }
  593.  
  594.     private void Heal()
  595.     {
  596.         if (ObjectManager.Me.HealthPercent < 95 && !Fight.InFight && ObjectManager.GetNumberAttackPlayer() == 0)
  597.         {
  598.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  599.             {
  600.                 FlashOfLight.Launch();
  601.                 MovementManager.StopMove();
  602.                 return;
  603.             }
  604.         }
  605.         if (DivineShield.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent <= 5 && !ObjectManager.Me.HaveBuff(25771) && DivineShield.IsSpellUsable)
  606.         {
  607.             DivineShield.Launch();
  608.             return;
  609.         }
  610.         if (LayOnHands.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent <= 20 && !ObjectManager.Me.HaveBuff(25771) && LayOnHands.IsSpellUsable)
  611.         {
  612.             LayOnHands.Launch();
  613.             return;
  614.         }
  615.         if (ObjectManager.Me.BarTwoPercentage < 10)
  616.         {
  617.             if (Arcane_Torrent.KnownSpell && Arcane_Torrent.IsSpellUsable)
  618.             {
  619.                 Arcane_Torrent.Launch();
  620.                 return;
  621.             }
  622.         }
  623.         if (ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent < 50)
  624.         {
  625.             if (WordOfGlory.KnownSpell && WordOfGlory.IsSpellUsable)
  626.                 WordOfGlory.Launch();
  627.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  628.             {
  629.                 FlashOfLight.Launch();
  630.                 return;
  631.             }
  632.         }
  633.         if (ObjectManager.Me.HealthPercent >= 0 && ObjectManager.Me.HealthPercent < 30)
  634.         {
  635.             if (WordOfGlory.KnownSpell && WordOfGlory.IsSpellUsable)
  636.                 WordOfGlory.Launch();
  637.             if (DivineProtection.KnownSpell && DivineProtection.IsSpellUsable)
  638.                 DivineProtection.Launch();
  639.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  640.             {
  641.                 FlashOfLight.Launch();
  642.                 return;
  643.             }
  644.         }
  645.     }
  646.     private void DPS_Burst()
  647.     {
  648.         if (HolyAvenger.KnownSpell && HolyAvenger.IsSpellUsable)
  649.         {
  650.             HolyAvenger.Launch();
  651.             if (AvengingWrath.KnownSpell && AvengingWrath.IsSpellUsable)
  652.             {
  653.                 AvengingWrath.Launch();
  654.                 return;
  655.             }
  656.         }
  657.         else if (AvengingWrath.KnownSpell && AvengingWrath.IsSpellUsable)
  658.         {
  659.             AvengingWrath.Launch();
  660.             return;
  661.         }
  662.     }
  663.     private void Defense_Cycle()
  664.     {
  665.         if (SacredShield.KnownSpell && SacredShield.IsSpellUsable && !SacredShield.HaveBuff)
  666.         {
  667.             SacredShield.Launch();
  668.             OnCD = new Timer(0);
  669.         }
  670.         else if (HolyShield.KnownSpell && HolyShield.IsSpellUsable)
  671.         {
  672.             HolyShield.Launch();
  673.             OnCD = new Timer(1000 * 10);
  674.             return;
  675.         }
  676.         else if (HandOfPurity.KnownSpell && HandOfPurity.IsSpellUsable && !HandOfPurity.HaveBuff)
  677.         {
  678.             HandOfPurity.Launch();
  679.             OnCD = new Timer(1000 * 6);
  680.         }
  681.         else if (HammerOfJustice.KnownSpell && HammerOfJustice.IsSpellUsable)
  682.         {
  683.             HammerOfJustice.Launch();
  684.             OnCD = new Timer(1000 * 6);
  685.             return;
  686.         }
  687.         else if (DivineShield.KnownSpell && DivineShield.IsSpellUsable && !ObjectManager.Me.HaveBuff(25771))
  688.         {
  689.             DivineShield.Launch();
  690.             OnCD = new Timer(1000 * 8);
  691.             return;
  692.         }
  693.         else if (DivineProtection.KnownSpell && DivineProtection.IsSpellUsable)
  694.         {
  695.             DivineProtection.Launch();
  696.             OnCD = new Timer(1000 * 10);
  697.             return;
  698.         }
  699.         else if (DevotionAura.KnownSpell && DevotionAura.IsSpellUsable)
  700.         {
  701.             DevotionAura.Launch();
  702.             OnCD = new Timer(1000 * 6);
  703.             return;
  704.         }
  705.         else if (GuardianOfAncientKings.KnownSpell && GuardianOfAncientKings.IsSpellUsable)
  706.         {
  707.             GuardianOfAncientKings.Launch();
  708.             OnCD = new Timer(1000 * 12);
  709.             return;
  710.         }
  711.         else if (ArdentDefender.KnownSpell && ArdentDefender.IsSpellUsable)
  712.         {
  713.             ArdentDefender.Launch();
  714.             OnCD = new Timer(1000 * 10);
  715.             return;
  716.         }
  717.         else if (LayOnHands.KnownSpell && LayOnHands.IsSpellUsable && !ObjectManager.Me.HaveBuff(25771))
  718.         {
  719.             LayOnHands.Launch();
  720.             OnCD = new Timer(1000 * 5);
  721.             return;
  722.         }
  723.         else if (WordOfGlory.KnownSpell && WordOfGlory.IsSpellUsable)
  724.         {
  725.             WordOfGlory.Launch();
  726.             OnCD = new Timer(1000 * 5);
  727.             return;
  728.         }
  729.         else if (HandOfProtection.KnownSpell && HandOfProtection.IsSpellUsable && !ObjectManager.Me.HaveBuff(25771))
  730.         {
  731.             HandOfProtection.Launch();
  732.             OnCD = new Timer(1000 * 8);
  733.             return;
  734.         }
  735.     }
  736.     private void DPS_Cycle()
  737.     {
  738.         if (ShieldOfTheRighteous.KnownSpell && ShieldOfTheRighteous.IsSpellUsable && ShieldOfTheRighteous.IsDistanceGood && (ObjectManager.Me.HaveBuff(90174) || ObjectManager.Me.HolyPower >= 3))
  739.         {
  740.             ShieldOfTheRighteous.Launch();
  741.             return;
  742.         }
  743.         if ((ObjectManager.GetNumberAttackPlayer() >= 3 || !ObjectManager.Target.HaveBuff(115798)) && !ObjectManager.Me.HaveBuff(90174) && ObjectManager.Me.HolyPower < 3)
  744.         {
  745.             if (HammerOfTheRighteous.KnownSpell && HammerOfTheRighteous.IsDistanceGood && HammerOfTheRighteous.IsSpellUsable)
  746.             {
  747.                 HammerOfTheRighteous.Launch();
  748.                 return;
  749.             }
  750.         }
  751.         else
  752.         {
  753.             if (CrusaderStrike.KnownSpell && CrusaderStrike.IsDistanceGood && CrusaderStrike.IsSpellUsable && !ObjectManager.Me.HaveBuff(90174) && ObjectManager.Me.HolyPower < 3)
  754.             {
  755.                 CrusaderStrike.Launch();
  756.                 return;
  757.             }
  758.         }
  759.         if (AvengersShield.KnownSpell && AvengersShield.IsDistanceGood && AvengersShield.IsSpellUsable && !ObjectManager.Me.HaveBuff(90174) && ObjectManager.Me.HolyPower < 3)
  760.         {
  761.             AvengersShield.Launch();
  762.             return;
  763.         }
  764.         if (HammerOfWrath.KnownSpell && HammerOfWrath.IsDistanceGood && HammerOfWrath.IsSpellUsable && !ObjectManager.Me.HaveBuff(90174) && ObjectManager.Me.HolyPower < 3)
  765.         {
  766.             HammerOfWrath.Launch();
  767.             return;
  768.         }
  769.         if (Judgment.KnownSpell && Judgment.IsDistanceGood && Judgment.IsSpellUsable && !ObjectManager.Me.HaveBuff(90174) && ObjectManager.Me.HolyPower < 3)
  770.         {
  771.             Judgment.Launch();
  772.             return;
  773.         }
  774.         if (Consecration.KnownSpell && Consecration.IsSpellUsable && !ObjectManager.Me.HaveBuff(90174) && ObjectManager.Me.HolyPower < 3)
  775.         {
  776.             // Consecration.Launch(); // If the glyph is activated, it's a huge loss of time to have this .Launch() here "2-3 sec" without doing anything.
  777.             SpellManager.CastSpellByIDAndPosition(26573, ObjectManager.Target.Position);
  778.             return;
  779.         }
  780.         if (HolyWrath.KnownSpell && HolyWrath.IsSpellUsable && !ObjectManager.Me.HaveBuff(90174) && ObjectManager.Me.HolyPower < 3 && !Judgment.IsSpellUsable && !CrusaderStrike.IsSpellUsable && !Consecration.IsSpellUsable)
  781.         {
  782.             HolyWrath.Launch();
  783.             return;
  784.         }
  785.     }
  786. }
  787.  
  788. public class Paladin_Retribution
  789. {
  790.     [Serializable]
  791.     public class PaladinRetributionSettings : nManager.Helpful.Settings
  792.     {
  793.         /* Professions & Racials */
  794.         public bool UseArcaneTorrent = true;
  795.         public bool UseLifeblood = true;
  796.         public bool UseStoneform = true;
  797.         public bool UseGiftoftheNaaru = true;
  798.         public bool UseWarStomp = true;
  799.         public bool UseBerserking = true;
  800.         /* Paladin Seals & Buffs */
  801.         public bool UseSealOfTheRighteousness = true;
  802.         public bool UseSealOfTruth = true;
  803.         public bool UseSealOfJustice = false;
  804.         public bool UseBlessingOfMight = true;
  805.         public bool UseBlessingOfKings = true;
  806.         /* Offensive Spell */
  807.         public bool UseTemplarsVerdict = true;
  808.         public bool UseDivineStorm = true;
  809.         public bool UseExorcism = true;
  810.         public bool UseHammerOfWrath = true;
  811.         public bool UseCrusaderStrike = true;
  812.         public bool UseHammerOfTheRighteous = true;
  813.         public bool UseJudgment = true;
  814.         public bool UseHammerOfJustice = true;
  815.         /* Offensive Cooldown */
  816.         public bool UseInquisition = true;
  817.         public bool UseGuardianOfAncientKings = true;
  818.         public bool UseHolyAvenger = true;
  819.         public bool UseAvengingWrath = true;
  820.         /* Defensive Cooldown */
  821.         public bool UseDivineProtection = true;
  822.         public bool UseDevotionAura = true;
  823.         public bool UseSacredShield = true;
  824.         public bool UseDivineShield = true;
  825.         public bool UseHandOfProtection = false;
  826.         /* Healing Spell */
  827.         public bool UseFlashOfLight = true;
  828.         public bool UseLayOnHands = true;
  829.         public bool UseWordOfGlory = true;
  830.  
  831.         private PaladinRetributionSettings()
  832.         {
  833.             ConfigWinForm(new System.Drawing.Point(400, 400), "Paladin Retribution Settings");
  834.             /* Professions & Racials */
  835.             AddControlInWinForm("Use Arcane Torrent", "UseArcaneTorrent", "Professions & Racials");
  836.             AddControlInWinForm("Use Lifeblood", "UseLifeblood", "Professions & Racials");
  837.             AddControlInWinForm("Use Stoneform", "UseStoneform", "Professions & Racials");
  838.             AddControlInWinForm("Use Gift of the Naaru", "UseGiftoftheNaaru", "Professions & Racials");
  839.             AddControlInWinForm("Use War Stomp", "UseWarStomp", "Professions & Racials");
  840.             AddControlInWinForm("Use Berserking", "UseBerserking", "Professions & Racials");
  841.             /* Paladin Seals & Buffs */
  842.             AddControlInWinForm("Use Seal of the Righteousness", "UseSealOfTheRighteousness", "Paladin Seals & Buffs");
  843.             AddControlInWinForm("Use Seal of Truth", "UseSealOfTruth", "Paladin Seals & Buffs");
  844.             AddControlInWinForm("Use Seal of Justice", "UseSealOfJustice", "Paladin Seals & Buffs");
  845.             AddControlInWinForm("Use Blessing of Might", "UseBlessingOfMight", "Paladin Seals & Buffs");
  846.             AddControlInWinForm("Use Blessing of Kings", "UseBlessingOfKings", "Paladin Seals & Buffs");
  847.             /* Offensive Spell */
  848.             AddControlInWinForm("Use Templar's Verdict", "UseTemplarsVerdict", "Offensive Spell");
  849.             AddControlInWinForm("Use Divine Storm", "UseDivineStorm", "Offensive Spell");
  850.             AddControlInWinForm("Use Exorcism", "UseExorcism", "Offensive Spell");
  851.             AddControlInWinForm("Use Hammer of Wrath", "UseHammerOfWrath", "Offensive Spell");
  852.             AddControlInWinForm("Use Crusader Strike", "UseCrusaderStrike", "Offensive Spell");
  853.             AddControlInWinForm("Use Hammer of the Righteous", "UseHammerOfTheRighteous", "Offensive Spell");
  854.             AddControlInWinForm("Use Judgment", "UseJudgment", "Offensive Spell");
  855.             AddControlInWinForm("Use Hammer of Justice", "UseHammerOfJustice", "Offensive Spell");
  856.             /* Offensive Cooldown */
  857.             AddControlInWinForm("Use Inquisition", "UseInquisition", "Offensive Cooldown");
  858.             AddControlInWinForm("Use Guardian of Ancient Kings", "UseGuardianOfAncientKings", "Offensive Cooldown");
  859.             AddControlInWinForm("Use Holy Avenger", "UseHolyAvenger", "Offensive Cooldown");
  860.             AddControlInWinForm("Use Avenging Wrath", "UseAvengingWrath", "Offensive Cooldown");
  861.             /* Defensive Cooldown */
  862.             AddControlInWinForm("Use Divine Protection", "UseDivineProtection", "Offensive Cooldown");
  863.             AddControlInWinForm("Use Devotion Aura", "UseDevotionAura", "Offensive Cooldown");
  864.             AddControlInWinForm("Use Sacred Shield", "UseSacredShield", "Offensive Cooldown");
  865.             AddControlInWinForm("Use Divine Shield", "UseDivineShield", "Offensive Cooldown");
  866.             AddControlInWinForm("Use Hand of Protection", "UseHandOfProtection", "Offensive Cooldown");
  867.             /* Healing Spell */
  868.             AddControlInWinForm("Use Flash of Light", "UseFlashOfLight", "Healing Spell");
  869.             AddControlInWinForm("Use Lay on Hands", "UseLayOnHands", "Healing Spell");
  870.             AddControlInWinForm("Use Word of Glory", "UseWordOfGlory", "Healing Spell");
  871.         }
  872.         private GetSettings()
  873.         {
  874.             string CurrentSettingsFile = Application.StartupPath + "\\CustomClasses\\Settings\\Paladin_Retribution.xml";
  875.             Paladin_Retribution.PaladinRetributionSettings CurrentSetting;
  876.             CurrentSetting = new Paladin_Retribution.PaladinRetributionSettings();
  877.             if (System.IO.File.Exists(CurrentSettingsFile))
  878.             {
  879.                 CurrentSetting = Settings.Load<Paladin_Retribution.PaladinRetributionSettings>(CurrentSettingsFile);
  880.             }
  881.         }
  882.     }
  883.  
  884.     private readonly Settings mySettings = new PaladinRetributionSettings().GetSettings();
  885.     #region Professions & Racials
  886.     private readonly Spell Arcane_Torrent = new Spell("Arcane Torrent");
  887.     private readonly Spell Lifeblood = new Spell("Lifeblood");
  888.     private readonly Spell Stoneform = new Spell("Stoneform");
  889.     private readonly Spell Gift_of_the_Naaru = new Spell("Gift of the Naaru");
  890.     private readonly Spell War_Stomp = new Spell("War Stomp");
  891.     private readonly Spell Berserking = new Spell("Berserking");
  892.     #endregion
  893.  
  894.     #region Paladin Seals & Buffs
  895.     private readonly Spell SealOfTheRighteousness = new Spell("Seal of Righteousness");
  896.     private readonly Spell SealOfTruth = new Spell("Seal of Truth");
  897.     private readonly Spell SealOfJustice = new Spell("Seal of Justice");
  898.     private readonly Spell BlessingOfMight = new Spell("Blessing of Might");
  899.     private readonly Spell BlessingOfKings = new Spell("Blessing of Kings");
  900.     #endregion
  901.  
  902.     #region Offensive Spell
  903.     private readonly Spell TemplarsVerdict = new Spell("Templar's Verdict");
  904.     private readonly Spell BoundlessConviction = new Spell("Boundless Conviction");
  905.     private readonly Spell DivineStorm = new Spell("Divine Storm");
  906.     private readonly Spell Exorcism = new Spell("Exorcism");
  907.     private readonly Spell HammerOfWrath = new Spell("Hammer of Wrath");
  908.     private readonly Spell CrusaderStrike = new Spell("Crusader Strike");
  909.     private readonly Spell HammerOfTheRighteous = new Spell("Hammer of the Righteous");
  910.     private readonly Spell Judgment = new Spell("Judgment");
  911.     private readonly Spell HammerOfJustice = new Spell("Hammer of Justice");
  912.  
  913.     #endregion
  914.  
  915.     #region Offensive Cooldown
  916.     private readonly Spell Inquisition = new Spell("Inquisition");
  917.     private Timer InquisitionToUseInPriotiy = new Timer(0);
  918.     private readonly Spell GuardianOfAncientKings = new Spell("Guardian of Ancient Kings");
  919.     private Timer BurstTime = new Timer(0);
  920.     private readonly Spell HolyAvenger = new Spell("Holy Avenger");
  921.     private readonly Spell AvengingWrath = new Spell("Avenging Wrath");
  922.     #endregion
  923.  
  924.     #region Defensive Cooldown
  925.     private readonly Spell DivineProtection = new Spell("Divine Protection");
  926.     private readonly Spell DevotionAura = new Spell("Devotion Aura");
  927.     private readonly Spell SacredShield = new Spell("Sacred Shield");
  928.     private readonly Spell DivineShield = new Spell("Divine Shield");
  929.     private readonly Spell HandOfProtection = new Spell("Hand of Protection");
  930.     #endregion
  931.  
  932.     #region Healing Spell
  933.     private readonly Spell FlashOfLight = new Spell("Flash of Light");
  934.     private readonly Spell LayOnHands = new Spell("Lay on Hands");
  935.     private readonly Spell WordOfGlory = new Spell("Word of Glory");
  936.     #endregion
  937.  
  938.     public Paladin_Retribution()
  939.     {
  940.         Main.range = 3.6f;
  941.  
  942.         UInt64 lastTarget = 0;
  943.  
  944.         while (Main.loop)
  945.         {
  946.             try
  947.             {
  948.                 if (!ObjectManager.Me.IsMounted)
  949.                 {
  950.                     if (Fight.InFight && ObjectManager.Me.Target > 0)
  951.                     {
  952.                         if (ObjectManager.Me.Target != lastTarget && (Judgment.IsDistanceGood || Exorcism.IsDistanceGood))
  953.                         {
  954.                             Pull();
  955.                             lastTarget = ObjectManager.Me.Target;
  956.                         }
  957.                         Combat();
  958.                         Seal();
  959.                         Blessing();
  960.                     }
  961.                     else
  962.                     {
  963.                         Patrolling();
  964.                     }
  965.                 }
  966.             }
  967.             catch
  968.             {
  969.             }
  970.             Thread.Sleep(150);
  971.         }
  972.     }
  973.  
  974.     private void Pull()
  975.     {
  976.         if (Exorcism.KnownSpell && Exorcism.IsDistanceGood && Exorcism.IsSpellUsable && PaladinRetributionSettings.UseExorcism)
  977.         {
  978.             Exorcism.Launch();
  979.         }
  980.         else if (Judgment.KnownSpell && Judgment.IsDistanceGood && Judgment.IsSpellUsable)
  981.         {
  982.             Judgment.Launch();
  983.         }
  984.     }
  985.  
  986.     private void Combat()
  987.     {
  988.         DPS_Cycle();
  989.  
  990.         DPS_Burst();
  991.  
  992.         DPS_Cycle();
  993.  
  994.         Heal();
  995.  
  996.         DPS_Cycle();
  997.     }
  998.  
  999.     private void Patrolling()
  1000.     {
  1001.         if (!ObjectManager.Me.IsMounted)
  1002.         {
  1003.             Seal();
  1004.             Blessing();
  1005.             Heal();
  1006.         }
  1007.     }
  1008.  
  1009.     private void Seal()
  1010.     {
  1011.         if (ObjectManager.Me.IsMounted)
  1012.             return;
  1013.  
  1014.         if (SealOfTruth.KnownSpell && ObjectManager.GetNumberAttackPlayer() <= 7)
  1015.         {
  1016.             if (!SealOfTruth.HaveBuff && SealOfTruth.IsSpellUsable)
  1017.                 SealOfTruth.Launch();
  1018.         }
  1019.         else if (SealOfTheRighteousness.KnownSpell)
  1020.         {
  1021.             if (!SealOfTheRighteousness.HaveBuff && SealOfTheRighteousness.IsSpellUsable)
  1022.                 SealOfTheRighteousness.Launch();
  1023.         }
  1024.     }
  1025.  
  1026.     private void Blessing()
  1027.     {
  1028.         if (ObjectManager.Me.IsMounted)
  1029.             return;
  1030.         else if (BlessingOfMight.KnownSpell)
  1031.         {
  1032.             if (!BlessingOfMight.HaveBuff && BlessingOfMight.IsSpellUsable)
  1033.                 BlessingOfMight.Launch();
  1034.         }
  1035.         else if (BlessingOfKings.KnownSpell)
  1036.         {
  1037.             if (!BlessingOfKings.HaveBuff && BlessingOfKings.IsSpellUsable)
  1038.                 BlessingOfKings.Launch();
  1039.         }
  1040.     }
  1041.  
  1042.     private void Heal()
  1043.     {
  1044.         if (ObjectManager.Me.HealthPercent < 95 && !Fight.InFight && ObjectManager.GetNumberAttackPlayer() == 0)
  1045.         {
  1046.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  1047.             {
  1048.                 FlashOfLight.Launch();
  1049.                 MovementManager.StopMove();
  1050.                 return;
  1051.             }
  1052.         }
  1053.         if (DivineShield.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent <= 5 && !ObjectManager.Me.HaveBuff(25771) && DivineShield.IsSpellUsable)
  1054.         {
  1055.             DivineShield.Launch();
  1056.             return;
  1057.         }
  1058.         if (LayOnHands.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent <= 20 && !ObjectManager.Me.HaveBuff(25771) && LayOnHands.IsSpellUsable)
  1059.         {
  1060.             LayOnHands.Launch();
  1061.             return;
  1062.         }
  1063.         if (ObjectManager.Me.BarTwoPercentage < 10)
  1064.         {
  1065.             if (Arcane_Torrent.KnownSpell && Arcane_Torrent.IsSpellUsable)
  1066.             {
  1067.                 Arcane_Torrent.Launch();
  1068.                 return;
  1069.             }
  1070.         }
  1071.         if (ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent < 50)
  1072.         {
  1073.             if (WordOfGlory.KnownSpell && WordOfGlory.IsSpellUsable)
  1074.                 WordOfGlory.Launch();
  1075.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  1076.             {
  1077.                 FlashOfLight.Launch();
  1078.                 return;
  1079.             }
  1080.         }
  1081.         if (ObjectManager.Me.HealthPercent >= 0 && ObjectManager.Me.HealthPercent < 30)
  1082.         {
  1083.             if (WordOfGlory.KnownSpell && WordOfGlory.IsSpellUsable)
  1084.                 WordOfGlory.Launch();
  1085.             if (DivineProtection.KnownSpell && DivineProtection.IsSpellUsable)
  1086.                 DivineProtection.Launch();
  1087.             if (FlashOfLight.KnownSpell && FlashOfLight.IsSpellUsable)
  1088.             {
  1089.                 FlashOfLight.Launch();
  1090.                 return;
  1091.             }
  1092.         }
  1093.     }
  1094.     private void DPS_Burst()
  1095.     {
  1096.         if (!GuardianOfAncientKings.KnownSpell || GuardianOfAncientKings.HaveBuff || !GuardianOfAncientKings.IsSpellUsable)
  1097.         {
  1098.             if ((!GuardianOfAncientKings.KnownSpell || BurstTime.IsReady) && AvengingWrath.KnownSpell && AvengingWrath.IsSpellUsable && (!HolyAvenger.KnownSpell || HolyAvenger.IsSpellUsable))
  1099.             {
  1100.                 AvengingWrath.Launch();
  1101.                 if ((!Inquisition.HaveBuff || InquisitionToUseInPriotiy.IsReady) && Inquisition.KnownSpell && Inquisition.IsSpellUsable && (ObjectManager.Me.HaveBuff(90174) || ObjectManager.Me.HolyPower >= 3))
  1102.                 {
  1103.                     Inquisition.Launch();
  1104.                     InquisitionToUseInPriotiy = new Timer(1000 * (10 * 3 - 6));
  1105.                 }
  1106.                 if (HolyAvenger.KnownSpell && HolyAvenger.IsSpellUsable)
  1107.                     HolyAvenger.Launch();
  1108.                 return;
  1109.             }
  1110.             else if ((!GuardianOfAncientKings.KnownSpell || BurstTime.IsReady) && HolyAvenger.KnownSpell && HolyAvenger.IsSpellUsable)
  1111.             {
  1112.                 HolyAvenger.Launch();
  1113.                 if ((!Inquisition.HaveBuff || InquisitionToUseInPriotiy.IsReady) && Inquisition.KnownSpell && Inquisition.IsSpellUsable && (ObjectManager.Me.HaveBuff(90174) || ObjectManager.Me.HolyPower >= 3))
  1114.                 {
  1115.                     Inquisition.Launch();
  1116.                     InquisitionToUseInPriotiy = new Timer(1000 * (10 * 3 - 6));
  1117.                 }
  1118.                 if (AvengingWrath.KnownSpell && AvengingWrath.IsSpellUsable)
  1119.                     AvengingWrath.Launch();
  1120.                 return;
  1121.             }
  1122.         }
  1123.         else
  1124.             if (GuardianOfAncientKings.KnownSpell && GuardianOfAncientKings.IsSpellUsable && AvengingWrath.IsSpellUsable && (!HolyAvenger.KnownSpell || HolyAvenger.IsSpellUsable))
  1125.             {
  1126.                 GuardianOfAncientKings.Launch();
  1127.                 BurstTime = new Timer(1000 * 6.5);
  1128.                 return;
  1129.             }
  1130.     }
  1131.     private void DPS_Cycle()
  1132.     {
  1133.         /*if (HammerOfJustice.KnownSpell && HammerOfJustice.IsDistanceGood && HammerOfJustice.IsSpellUsable)
  1134.         {
  1135.            // TODO : If target can be stun, if not, it will be a pure loss of DPS.
  1136.             HammerOfJustice.Launch();
  1137.             return;
  1138.         }*/
  1139.         if (Inquisition.KnownSpell && (!Inquisition.HaveBuff || InquisitionToUseInPriotiy.IsReady) && Inquisition.IsSpellUsable && (ObjectManager.Me.HaveBuff(90174) || ObjectManager.Me.HolyPower >= 3))
  1140.         {
  1141.             Inquisition.Launch();
  1142.             InquisitionToUseInPriotiy = new Timer(1000 * (10 * 3 - 6));
  1143.             return;
  1144.         }
  1145.         else if (ObjectManager.GetNumberAttackPlayer() <= 1 && TemplarsVerdict.KnownSpell && (!Inquisition.KnownSpell || Inquisition.HaveBuff) && TemplarsVerdict.IsSpellUsable && TemplarsVerdict.IsDistanceGood && (ObjectManager.Me.HaveBuff(90174) || ObjectManager.Me.HolyPower == 5 || (ObjectManager.Me.HolyPower >= 3 && (!BoundlessConviction.KnownSpell || HolyAvenger.HaveBuff))))
  1146.         {
  1147.             TemplarsVerdict.Launch();
  1148.             return;
  1149.         }
  1150.         else if (ObjectManager.GetNumberAttackPlayer() >= 2 && DivineStorm.KnownSpell && (!Inquisition.KnownSpell || Inquisition.HaveBuff) && DivineStorm.IsSpellUsable && DivineStorm.IsDistanceGood && (ObjectManager.Me.HaveBuff(90174) || ObjectManager.Me.HolyPower == 5 || (ObjectManager.Me.HolyPower >= 3 && (!BoundlessConviction.KnownSpell || HolyAvenger.HaveBuff))))
  1151.         {
  1152.             DivineStorm.Launch();
  1153.             return;
  1154.         }
  1155.         else if (HammerOfWrath.KnownSpell && HammerOfWrath.IsDistanceGood && HammerOfWrath.IsSpellUsable)
  1156.         {
  1157.             HammerOfWrath.Launch();
  1158.             return;
  1159.         }
  1160.         else if (Exorcism.KnownSpell && Exorcism.IsDistanceGood && Exorcism.IsSpellUsable)
  1161.         {
  1162.             Exorcism.Launch();
  1163.             return;
  1164.         }
  1165.         else if ((ObjectManager.GetNumberAttackPlayer() <= 3 || ObjectManager.Target.HaveBuff(115798)) && CrusaderStrike.KnownSpell && CrusaderStrike.IsDistanceGood && CrusaderStrike.IsSpellUsable)
  1166.         {
  1167.             CrusaderStrike.Launch();
  1168.             return;
  1169.         }
  1170.         else if ((ObjectManager.GetNumberAttackPlayer() >= 4 || !ObjectManager.Target.HaveBuff(115798)) && HammerOfTheRighteous.KnownSpell && HammerOfTheRighteous.IsDistanceGood && HammerOfTheRighteous.IsSpellUsable && !ObjectManager.Me.HaveBuff(90174))
  1171.         {
  1172.             HammerOfTheRighteous.Launch();
  1173.             return;
  1174.         }
  1175.         else if (Judgment.KnownSpell && Judgment.IsDistanceGood && Judgment.IsSpellUsable)
  1176.         {
  1177.             Judgment.Launch();
  1178.             return;
  1179.         }
  1180.         else if (ObjectManager.GetNumberAttackPlayer() <= 1 && TemplarsVerdict.KnownSpell && (!Inquisition.KnownSpell || Inquisition.HaveBuff) && TemplarsVerdict.IsSpellUsable && TemplarsVerdict.IsDistanceGood && (ObjectManager.Me.HaveBuff(90174) || ObjectManager.Me.HolyPower >= 3))
  1181.         {
  1182.             TemplarsVerdict.Launch();
  1183.             return;
  1184.         }
  1185.         else if (ObjectManager.GetNumberAttackPlayer() >= 2 && DivineStorm.KnownSpell && (!Inquisition.KnownSpell || Inquisition.HaveBuff) && DivineStorm.IsSpellUsable && DivineStorm.IsDistanceGood && (ObjectManager.Me.HaveBuff(90174) || ObjectManager.Me.HolyPower >= 3))
  1186.         {
  1187.             DivineStorm.Launch();
  1188.             return;
  1189.         }
  1190.         else if (SacredShield.KnownSpell && SacredShield.IsDistanceGood && SacredShield.IsSpellUsable
  1191.         && (!Inquisition.KnownSpell || Inquisition.HaveBuff)
  1192.         && (!TemplarsVerdict.KnownSpell || TemplarsVerdict.IsSpellUsable)
  1193.         && (!Judgment.KnownSpell || Judgment.IsSpellUsable)
  1194.         && (!Judgment.KnownSpell || Judgment.IsSpellUsable)
  1195.         && (!CrusaderStrike.KnownSpell || CrusaderStrike.IsSpellUsable)
  1196.         && (!HammerOfWrath.KnownSpell || HammerOfWrath.IsSpellUsable)
  1197.         && (!Exorcism.KnownSpell || Exorcism.IsSpellUsable)
  1198.         && (!Exorcism.KnownSpell || Exorcism.IsSpellUsable)
  1199.         && (!Exorcism.KnownSpell || Exorcism.IsSpellUsable))
  1200.         {
  1201.             // Since we have a GCD available and spell to cast, we can use the Sacred Shield. (Loss of DPS if not placed here.)
  1202.             SacredShield.Launch();
  1203.             return;
  1204.         }
  1205.         else
  1206.             return;
  1207.     }
  1208. }
  1209. #endregion
  1210. public class Survival
  1211. {
  1212.     #region InitializeSpell
  1213.  
  1214.     // Survival Only
  1215.     Spell Explosive_Shot = new Spell("Explosive Shot");
  1216.     Spell Counterattack = new Spell("Counterattack");
  1217.     Spell Black_Arrow = new Spell("Black Arrow");
  1218.  
  1219.     // DPS
  1220.     Spell Raptor_Strike = new Spell("Raptor Strike");
  1221.     Spell Arcane_Shot = new Spell("Arcane Shot");
  1222.     Spell Steady_Shot = new Spell("Steady Shot");
  1223.     Spell Serpent_Sting = new Spell("Serpent Sting");
  1224.     Spell Multi_Shot = new Spell("Multi-Shot");
  1225.     Spell Kill_Shot = new Spell("Kill Shot");
  1226.     Spell Explosive_Trap = new Spell("Explosive Trap");
  1227.     Spell Cobra_Shot = new Spell("Cobra Shot");
  1228.     Spell Immolation_Trap = new Spell("Immolation Trap");
  1229.  
  1230.     // BUFF & HELPING
  1231.     Spell Concussive_Shot = new Spell("Concussive Shot");
  1232.     Spell Aspect_of_the_Hawk = new Spell("Aspect of the Hawk");
  1233.     Spell Disengage = new Spell("Disengage");
  1234.     Spell Hunters_Mark = new Spell("Hunter's Mark");
  1235.     Spell Scatter_Shot = new Spell("Scatter Shot"); // 19503
  1236.     Spell Feign_Death = new Spell("Feign Death");   //  5384
  1237.     Spell Snake_Trap = new Spell("Snake Trap");
  1238.     Spell Ice_Trap = new Spell("Ice Trap");
  1239.     Spell Freezing_Trap = new Spell("Freezing Trap");
  1240.     Spell Trap_Launcher = new Spell("Trap Launcher");   //  77769
  1241.     Spell Rapid_Fire = new Spell("Rapid Fire"); //  3045
  1242.     Spell Misdirection = new Spell("Misdirection");
  1243.     Spell Deterrence = new Spell("Deterrence"); //  19263
  1244.     Spell Wing_Clip = new Spell("Wing Clip");
  1245.  
  1246.     // PET
  1247.     Spell Kill_Command = new Spell("Kill Command");
  1248.     Spell Mend_Pet = new Spell("Mend Pet"); //  136
  1249.     Spell Revive_Pet = new Spell("Revive Pet"); //  982
  1250.     Spell Call_Pet = new Spell("Call Pet 1");   //  883
  1251.  
  1252.     // TIMER
  1253.     Timer look = new Timer(0);
  1254.     Timer fighttimer = new Timer(0);
  1255.     Timer petheal = new Timer(0);
  1256.     Timer traplaunchertimer = new Timer(0);
  1257.     Timer disengagetimer = new Timer(0);
  1258.     Timer Serpent_Sting_debuff = new Timer(0);
  1259.     Timer mountchill = new Timer(0);
  1260.  
  1261.     // Profession & Racials
  1262.     Spell Arcane_Torrent = new Spell("Arcane Torrent");
  1263.     Spell Lifeblood = new Spell("Lifeblood");
  1264.     Spell Stoneform = new Spell("Stoneform");
  1265.     Spell Tailoring = new Spell("Tailoring");
  1266.     Spell Leatherworking = new Spell("Leatherworking");
  1267.     Spell Gift_of_the_Naaru = new Spell("Gift of the Naaru");
  1268.     Spell War_Stomp = new Spell("War Stomp");
  1269.     Spell Berserking = new Spell("Berserking");
  1270.  
  1271.     #endregion InitializeSpell
  1272.  
  1273.     public Survival()
  1274.     {
  1275.         Main.range = 30.0f;
  1276.         UInt64 lastTarget = 0;
  1277.  
  1278.         while (Main.loop)
  1279.         {
  1280.  
  1281.             if (!ObjectManager.Me.IsMounted)
  1282.             {
  1283.                 buffoutfight();
  1284.  
  1285.                 if (!Fight.InFight && look.IsReady)
  1286.                 {
  1287.                     look = new Timer(5000);
  1288.                     Lua.RunMacroText("/targetfriendplayer");
  1289.                 }
  1290.  
  1291.                 if (Fight.InFight && ObjectManager.Me.Target > 0 && ObjectManager.Target.GetDistance > Main.range)
  1292.                 {
  1293.                     fighttimer = new Timer(60000);
  1294.                 }
  1295.  
  1296.                 if (Fight.InFight && ObjectManager.Me.Target > 0)
  1297.                 {
  1298.                     if (ObjectManager.Me.Target != lastTarget && ObjectManager.Target.GetDistance <= Main.range)
  1299.                     {
  1300.                         pull();
  1301.                         lastTarget = ObjectManager.Me.Target;
  1302.                     }
  1303.                     fight();
  1304.                     if (!Fight.InFight)
  1305.                     {
  1306.                         Logging.WriteFight(" - Target Down - ");
  1307.                         look = new Timer(5000);
  1308.                     }
  1309.  
  1310.                     if (fighttimer.IsReady && ObjectManager.Target.HealthPercent > 90 && ObjectManager.Me.Target > 0 && ObjectManager.GetNumberAttackPlayer() < 2)
  1311.                     {
  1312.                         Logging.WriteFight(" - Target Evading - ");
  1313.                         break;
  1314.                     }
  1315.                 }
  1316.             }
  1317.             if (ObjectManager.Me.IsMounted) mountchill = new Timer(2000);
  1318.             Thread.Sleep(350);
  1319.         }
  1320.     }
  1321.  
  1322.     public void pull()
  1323.     {
  1324.  
  1325.         if (hardmob()) Logging.WriteFight(" -  Pull Hard Mob - ");
  1326.         if (!hardmob()) Logging.WriteFight(" -  Pull Easy Mob - ");
  1327.         fighttimer = new Timer(60000);
  1328.  
  1329.         if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood)
  1330.         {
  1331.             SpellManager.CastSpellByIdLUA(5116);
  1332.             // Concussive_Shot.Launch();
  1333.         }
  1334.     }
  1335.  
  1336.     public void buffoutfight()
  1337.     {
  1338.  
  1339.         if (Fight.InFight || ObjectManager.Me.IsDeadMe) return;
  1340.  
  1341.         pet();
  1342.  
  1343.         if (!ObjectManager.Me.HaveBuff(79640) &&
  1344.             ItemsManager.GetItemCountByIdLUA(58149) == 1)
  1345.         {
  1346.             Logging.WriteFight("Use Alchi Flask");
  1347.             Lua.RunMacroText("/use item:58149");
  1348.         }
  1349.  
  1350.         if (Aspect_of_the_Hawk.KnownSpell && Aspect_of_the_Hawk.IsSpellUsable &&
  1351.             !Aspect_of_the_Hawk.HaveBuff)
  1352.         {
  1353.             SpellManager.CastSpellByIdLUA(13165);
  1354.             // Aspect_of_the_Hawk.Launch();
  1355.         }
  1356.  
  1357.     }
  1358.  
  1359.     public void fight()
  1360.     {
  1361.         pet();
  1362.         selfheal();
  1363.         buffinfight();
  1364.         if (ObjectManager.GetNumberAttackPlayer() > 1) fighttimer = new Timer(60000);
  1365.  
  1366.         if (ObjectManager.GetNumberAttackPlayer() > 2 && Explosive_Trap.IsSpellUsable && Trap_Launcher.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  1367.         {
  1368.             traplaunchertimer = new Timer(1100);
  1369.             Trap_Launcher.Launch();
  1370.             while (!traplaunchertimer.IsReady)
  1371.             {
  1372.                 if (Explosive_Trap.KnownSpell && Explosive_Trap.IsSpellUsable)
  1373.                 {
  1374.                     SpellManager.CastSpellByIDAndPosition(13813, ObjectManager.Target.Position);
  1375.                 }
  1376.             }
  1377.         }
  1378.  
  1379.         if (ObjectManager.GetNumberAttackPlayer() < 2 && Immolation_Trap.IsSpellUsable && Trap_Launcher.IsSpellUsable && Arcane_Shot.IsDistanceGood &&
  1380.             !ObjectManager.Target.IsTargetingMe && ObjectManager.Target.HealthPercent > 70)
  1381.         {
  1382.             traplaunchertimer = new Timer(1100);
  1383.             Trap_Launcher.Launch();
  1384.             while (!traplaunchertimer.IsReady)
  1385.             {
  1386.                 if (Immolation_Trap.KnownSpell && Immolation_Trap.IsSpellUsable)
  1387.                 {
  1388.                     SpellManager.CastSpellByIDAndPosition(13795, ObjectManager.Target.Position);
  1389.                 }
  1390.             }
  1391.         }
  1392.  
  1393.         if (ObjectManager.GetNumberAttackPlayer() < 2 && Immolation_Trap.IsSpellUsable && !Trap_Launcher.KnownSpell && Arcane_Shot.IsDistanceGood)
  1394.         {
  1395.  
  1396.             Immolation_Trap.Launch();
  1397.         }
  1398.  
  1399.  
  1400.  
  1401.         if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  1402.         {
  1403.             SpellManager.CastSpellByIdLUA(53351);
  1404.             // Kill_Shot.Launch();
  1405.         }
  1406.  
  1407.         if (Hunters_Mark.KnownSpell && Hunters_Mark.IsSpellUsable && Hunters_Mark.IsDistanceGood && !Hunters_Mark.TargetHaveBuff)
  1408.         {
  1409.             SpellManager.CastSpellByIdLUA(1130);
  1410.             // Hunters_Mark.Launch();
  1411.         }
  1412.  
  1413.         if ((ObjectManager.GetNumberAttackPlayer() > 2 || hardmob()) && Misdirection.KnownSpell && Misdirection.IsSpellUsable)
  1414.         {
  1415.             Lua.RunMacroText("/cast [@pet] Misdirection");
  1416.             Lua.RunMacroText("/cast [@pet] Irreführung");
  1417.             Lua.RunMacroText("/cast [@pet] Détournement");
  1418.             Lua.RunMacroText("/cast [@pet] ???????????????");
  1419.             Lua.RunMacroText("/cast [@pet] Redirección");
  1420.             Lua.RunMacroText("/cast [@pet] Redirecionar");
  1421.         }
  1422.  
  1423.         if (ObjectManager.Me.HaveBuff(56453))
  1424.         {
  1425.             if (Explosive_Shot.KnownSpell && Explosive_Shot.IsSpellUsable && Explosive_Shot.IsDistanceGood)
  1426.             {
  1427.                 SpellManager.CastSpellByIdLUA(53301);
  1428.                 // Explosive_Shot.Launch();
  1429.             }
  1430.             if (Arcane_Shot.KnownSpell && Arcane_Shot.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  1431.             {
  1432.                 SpellManager.CastSpellByIdLUA(3044);
  1433.                 // Arcane_Shot.Launch();
  1434.             }
  1435.             return;
  1436.         }
  1437.  
  1438.         if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood && !ObjectManager.Target.HaveBuff(1978))
  1439.         {
  1440.             SpellManager.CastSpellByIdLUA(5116);
  1441.             // Concussive_Shot.Launch();
  1442.         }
  1443.  
  1444.         if (!ObjectManager.Target.HaveBuff(1978) && Serpent_Sting_debuff.IsReady && Arcane_Shot.IsDistanceGood)
  1445.         {
  1446.             Serpent_Sting_debuff = new Timer(2500);
  1447.             Serpent_Sting.Launch();
  1448.         }
  1449.  
  1450.         if (!ObjectManager.Target.HaveBuff(1978) && !Serpent_Sting_debuff.IsReady)
  1451.         {
  1452.             if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  1453.             {
  1454.                 Kill_Shot.Launch();
  1455.             }
  1456.         }
  1457.  
  1458.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) && Snake_Trap.IsSpellUsable && Arcane_Shot.IsDistanceGood && !ObjectManager.Target.GetMove && Trap_Launcher.KnownSpell)
  1459.         {
  1460.             traplaunchertimer = new Timer(1100);
  1461.             Trap_Launcher.Launch();
  1462.             while (!traplaunchertimer.IsReady)
  1463.             {
  1464.                 if (Snake_Trap.KnownSpell && Snake_Trap.IsSpellUsable && Trap_Launcher.HaveBuff)
  1465.                 {
  1466.                     SpellManager.CastSpellByIDAndPosition(34600, ObjectManager.Target.Position);
  1467.                 }
  1468.             }
  1469.         }
  1470.  
  1471.         if (Freezing_Trap.KnownSpell && Freezing_Trap.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  1472.         {
  1473.             SpellManager.CastSpellByIdLUA(1499);
  1474.             // Freezing_Trap.Launch();
  1475.         }
  1476.  
  1477.         if (ObjectManager.Target.HaveBuff(1978))
  1478.         {
  1479.             if (Multi_Shot.KnownSpell && Multi_Shot.IsSpellUsable && Multi_Shot.IsDistanceGood && ObjectManager.GetNumberAttackPlayer() > 1)
  1480.             {
  1481.                 SpellManager.CastSpellByIdLUA(2643);
  1482.                 // Multi_Shot.Launch();
  1483.             }
  1484.             if (Explosive_Shot.KnownSpell && Explosive_Shot.IsSpellUsable && Explosive_Shot.IsDistanceGood && ObjectManager.Me.BarTwoPercentage > 70)
  1485.             {
  1486.                 SpellManager.CastSpellByIdLUA(53301);
  1487.                 // Explosive_Shot.Launch();
  1488.             }
  1489.  
  1490.             if (Black_Arrow.KnownSpell && Black_Arrow.IsSpellUsable && Black_Arrow.IsDistanceGood && !Explosive_Shot.IsSpellUsable)
  1491.             {
  1492.                 SpellManager.CastSpellByIdLUA(3674);
  1493.                 // Black_Arrow.Launch();
  1494.             }
  1495.  
  1496.             if (Arcane_Shot.KnownSpell && Arcane_Shot.IsSpellUsable && Arcane_Shot.IsDistanceGood && !Explosive_Shot.IsSpellUsable && !Black_Arrow.IsSpellUsable)
  1497.             {
  1498.                 SpellManager.CastSpellByIdLUA(3044);
  1499.                 // Arcane_Shot.Launch();
  1500.             }
  1501.         }
  1502.  
  1503.         if (ObjectManager.Me.BarTwoPercentage < 70 && ObjectManager.Target.HaveBuff(1978))
  1504.         {
  1505.             if (Steady_Shot.KnownSpell && Steady_Shot.IsSpellUsable && Steady_Shot.IsDistanceGood && !Cobra_Shot.KnownSpell)
  1506.             {
  1507.                 SpellManager.CastSpellByIdLUA(56641);
  1508.                 // Steady_Shot.Launch();
  1509.             }
  1510.             else if (Cobra_Shot.KnownSpell && Cobra_Shot.IsSpellUsable && Cobra_Shot.IsDistanceGood && ObjectManager.Target.HaveBuff(1978))
  1511.             {
  1512.                 SpellManager.CastSpellByIdLUA(77767);
  1513.                 // Cobra_Shot.Launch();
  1514.             }
  1515.         }
  1516.  
  1517.         if (Arcane_Torrent.KnownSpell && Arcane_Torrent.IsSpellUsable &&
  1518.             ObjectManager.Target.IsCast && ObjectManager.Target.GetDistance < 8)
  1519.         {
  1520.             Arcane_Torrent.Launch();
  1521.         }
  1522.  
  1523.     }
  1524.  
  1525.     private void pet()
  1526.     {
  1527.  
  1528.         if (ObjectManager.Me.IsMounted || !mountchill.IsReady) return;
  1529.  
  1530.         if ((ObjectManager.Pet.Health == 0 || ObjectManager.Pet.Guid == 0) &&
  1531.             !ObjectManager.Me.IsMounted && !ObjectManager.Me.IsDeadMe)
  1532.         {
  1533.             Call_Pet.Launch();
  1534.             Thread.Sleep(1000);
  1535.             if (!ObjectManager.Pet.IsAlive)
  1536.             {
  1537.                 Revive_Pet.Launch();
  1538.                 Thread.Sleep(1000);
  1539.             }
  1540.         }
  1541.  
  1542.         if (Mend_Pet.KnownSpell && Mend_Pet.IsSpellUsable && petheal.IsReady &&
  1543.             ObjectManager.Pet.Health > 0 && ObjectManager.Pet.HealthPercent < 70)
  1544.         {
  1545.             petheal = new Timer(9000);
  1546.             Mend_Pet.Launch();
  1547.         }
  1548.  
  1549.         if (Fight.InFight) Lua.RunMacroText("/petattack");
  1550.  
  1551.     }
  1552.  
  1553.     private void buffinfight()
  1554.     {
  1555.  
  1556.         if (!Fight.InFight) return;
  1557.  
  1558.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) &&
  1559.             ObjectManager.Me.HealthPercent < 65 &&
  1560.             ObjectManager.Target.GetDistance < 5 &&
  1561.             Stoneform.KnownSpell && Stoneform.IsSpellUsable)
  1562.         {
  1563.             SpellManager.CastSpellByIdLUA(20594);
  1564.             // Stoneform.Launch();
  1565.         }
  1566.  
  1567.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) &&
  1568.             ObjectManager.Me.HealthPercent < 65 &&
  1569.             ObjectManager.Target.GetDistance < 5 &&
  1570.             War_Stomp.KnownSpell && War_Stomp.IsSpellUsable)
  1571.         {
  1572.             SpellManager.CastSpellByIdLUA(20549);
  1573.             // War_Stomp.Launch();
  1574.         }
  1575.  
  1576.         if (Berserking.KnownSpell && Berserking.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  1577.         {
  1578.             SpellManager.CastSpellByIdLUA(1454);
  1579.             // Berserking.Launch();
  1580.         }
  1581.  
  1582.         if (Rapid_Fire.KnownSpell && Rapid_Fire.IsSpellUsable && (hardmob() || ObjectManager.GetNumberAttackPlayer() > 2) && Arcane_Shot.IsDistanceGood)
  1583.         {
  1584.             Rapid_Fire.Launch();
  1585.         }
  1586.  
  1587.     }
  1588.  
  1589.     private void selfheal()
  1590.     {
  1591.  
  1592.         if (ObjectManager.Me.HealthPercent < 80 &&
  1593.             Lifeblood.KnownSpell && Lifeblood.IsSpellUsable)
  1594.         {
  1595.             Lifeblood.Launch();
  1596.         }
  1597.  
  1598.         if (ObjectManager.Me.HealthPercent < 80 &&
  1599.             Gift_of_the_Naaru.KnownSpell && Gift_of_the_Naaru.IsSpellUsable)
  1600.         {
  1601.             Gift_of_the_Naaru.Launch();
  1602.         }
  1603.  
  1604.         if (Disengage.KnownSpell && Disengage.IsSpellUsable && Disengage.IsDistanceGood &&
  1605.             ObjectManager.Target.HealthPercent > 30 && ObjectManager.Target.GetDistance < 5)
  1606.         {
  1607.             disengagetimer = new Timer(2000);
  1608.             while (ObjectManager.Target.GetDistance < 5 && !disengagetimer.IsReady)
  1609.                 if (Wing_Clip.KnownSpell && Wing_Clip.IsSpellUsable && Wing_Clip.IsDistanceGood && !Wing_Clip.TargetHaveBuff)
  1610.                 {
  1611.                     SpellManager.CastSpellByIdLUA(2974);
  1612.                     // Wing_Clip.Launch();
  1613.                 }
  1614.             SpellManager.CastSpellByIdLUA(781);
  1615.             // Disengage.Launch();
  1616.             if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood)
  1617.             {
  1618.                 SpellManager.CastSpellByIdLUA(5116);
  1619.                 // Concussive_Shot.Launch();
  1620.             }
  1621.             return;
  1622.         }
  1623.  
  1624.         if (ObjectManager.Target.GetDistance < 10 && ((Disengage.KnownSpell && !Disengage.IsSpellUsable) || !Disengage.KnownSpell))
  1625.         {
  1626.             disengagetimer = new Timer(5000);
  1627.             while (ObjectManager.Target.GetDistance < 10 || !disengagetimer.IsReady)
  1628.             {
  1629.                 if (!Fight.InFight) return;
  1630.                 Keyboard.DownKey(nManager.Wow.Memory.WowProcess.MainWindowHandle, "S");
  1631.                 Thread.Sleep(100);
  1632.  
  1633.                 if (Mend_Pet.KnownSpell && Mend_Pet.IsSpellUsable && petheal.IsReady &&
  1634.                     ObjectManager.Pet.Health > 0 && ObjectManager.Pet.HealthPercent < 70)
  1635.                 {
  1636.                     petheal = new Timer(9000);
  1637.                     Mend_Pet.Launch();
  1638.                 }
  1639.  
  1640.                 if (Wing_Clip.KnownSpell && Wing_Clip.IsSpellUsable && Wing_Clip.IsDistanceGood && !Wing_Clip.TargetHaveBuff)
  1641.                 {
  1642.                     SpellManager.CastSpellByIdLUA(2974);
  1643.                     // Wing_Clip.Launch();
  1644.                 }
  1645.  
  1646.                 if (Counterattack.KnownSpell && Counterattack.IsSpellUsable && Counterattack.IsDistanceGood)
  1647.                 {
  1648.                     SpellManager.CastSpellByIdLUA(19306);
  1649.                     // Counterattack.Launch();
  1650.                 }
  1651.  
  1652.                 if (Raptor_Strike.KnownSpell && Raptor_Strike.IsSpellUsable && Raptor_Strike.IsDistanceGood)
  1653.                 {
  1654.                     SpellManager.CastSpellByIdLUA(2973);
  1655.                     // Raptor_Strike.Launch();
  1656.                 }
  1657.  
  1658.                 if (Kill_Command.KnownSpell && Kill_Command.IsSpellUsable && Kill_Command.IsDistanceGood)
  1659.                 {
  1660.                     SpellManager.CastSpellByIdLUA(34026);
  1661.                     // Kill_Command.Launch();
  1662.                 }
  1663.  
  1664.                 if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  1665.                 {
  1666.                     SpellManager.CastSpellByIdLUA(53351);
  1667.                     // Kill_Shot.Launch();
  1668.                 }
  1669.  
  1670.                 if (Explosive_Shot.KnownSpell && Explosive_Shot.IsSpellUsable && Explosive_Shot.IsDistanceGood && ObjectManager.Me.BarTwoPercentage > 70)
  1671.                 {
  1672.                     SpellManager.CastSpellByIdLUA(53301);
  1673.                     // Explosive_Shot.Launch();
  1674.                 }
  1675.  
  1676.                 if (Black_Arrow.KnownSpell && Black_Arrow.IsSpellUsable && Black_Arrow.IsDistanceGood && !Explosive_Shot.IsSpellUsable)
  1677.                 {
  1678.                     SpellManager.CastSpellByIdLUA(3674);
  1679.                     // Black_Arrow.Launch();
  1680.                 }
  1681.  
  1682.                 if (Arcane_Shot.KnownSpell && Arcane_Shot.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  1683.                 {
  1684.                     SpellManager.CastSpellByIdLUA(3044);
  1685.                     // Arcane_Shot.Launch();
  1686.                 }
  1687.  
  1688.                 if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable)
  1689.                 {
  1690.                     Feign_Death.Launch();
  1691.                     Thread.Sleep(3000);
  1692.                 }
  1693.  
  1694.                 if (Freezing_Trap.KnownSpell && Freezing_Trap.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  1695.                 {
  1696.                     SpellManager.CastSpellByIdLUA(1499);
  1697.                     // Freezing_Trap.Launch();
  1698.                 }
  1699.  
  1700.                 if (Scatter_Shot.KnownSpell && Scatter_Shot.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  1701.                 {
  1702.                     Scatter_Shot.Launch();
  1703.                 }
  1704.  
  1705.                 if (ObjectManager.Me.HealthPercent < 30 && ObjectManager.Target.IsTargetingMe)
  1706.                 {
  1707.                     if (!Feign_Death.IsSpellUsable && !Scatter_Shot.IsSpellUsable && Deterrence.KnownSpell && Deterrence.KnownSpell)
  1708.                     {
  1709.                         Deterrence.Launch();
  1710.                     }
  1711.                 }
  1712.  
  1713.                 Keyboard.DownKey(nManager.Wow.Memory.WowProcess.MainWindowHandle, "{SPACE}");
  1714.             }
  1715.         }
  1716.  
  1717.         if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable && ObjectManager.Me.HealthPercent < 15 && ObjectManager.Pet.Health > 10)
  1718.         {
  1719.             Feign_Death.Launch();
  1720.             Thread.Sleep(3000);
  1721.         }
  1722.  
  1723.         if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable && ObjectManager.Me.HealthPercent < 15 && (ObjectManager.Pet.Health == 0 || ObjectManager.Pet.Guid == 0))
  1724.         {
  1725.             Feign_Death.Launch();
  1726.             Lua.RunMacroText("/cleartarget");
  1727.             Thread.Sleep(30000);
  1728.         }
  1729.  
  1730.     }
  1731.  
  1732.     public bool hardmob()
  1733.     {
  1734.         if (((ObjectManager.Target.MaxHealth * 100) / ObjectManager.Me.MaxHealth) > 110)
  1735.         {
  1736.             return true;
  1737.         }
  1738.         return false;
  1739.     }
  1740. }
  1741. public class Marks
  1742. {
  1743.     #region InitializeSpell
  1744.  
  1745.     // Marks Only
  1746.     Spell Aimed_Shot = new Spell("Aimed Shot");
  1747.     Spell Silencing_Shot = new Spell("Silencing Shot");
  1748.     Spell Readiness = new Spell("Readiness");
  1749.     Spell Chimera_Shot = new Spell("Chimera Shot");
  1750.  
  1751.     // DPS
  1752.     Spell Raptor_Strike = new Spell("Raptor Strike");
  1753.     Spell Arcane_Shot = new Spell("Arcane Shot");
  1754.     Spell Steady_Shot = new Spell("Steady Shot");
  1755.     Spell Serpent_Sting = new Spell("Serpent Sting");
  1756.     Spell Multi_Shot = new Spell("Multi-Shot");
  1757.     Spell Kill_Shot = new Spell("Kill Shot");
  1758.     Spell Explosive_Trap = new Spell("Explosive Trap");
  1759.     Spell Cobra_Shot = new Spell("Cobra Shot");
  1760.     Spell Immolation_Trap = new Spell("Immolation Trap");
  1761.  
  1762.     // BUFF & HELPING
  1763.     Spell Concussive_Shot = new Spell("Concussive Shot");
  1764.     Spell Aspect_of_the_Hawk = new Spell("Aspect of the Hawk");
  1765.     Spell Disengage = new Spell("Disengage");
  1766.     Spell Hunters_Mark = new Spell("Hunter's Mark");
  1767.     Spell Scatter_Shot = new Spell("Scatter Shot"); // 19503
  1768.     Spell Feign_Death = new Spell("Feign Death");   //  5384
  1769.     Spell Snake_Trap = new Spell("Snake Trap");
  1770.     Spell Ice_Trap = new Spell("Ice Trap");
  1771.     Spell Freezing_Trap = new Spell("Freezing Trap");
  1772.     Spell Trap_Launcher = new Spell("Trap Launcher");   //  77769
  1773.     Spell Rapid_Fire = new Spell("Rapid Fire"); //  3045
  1774.     Spell Misdirection = new Spell("Misdirection");
  1775.     Spell Deterrence = new Spell("Deterrence"); //  19263
  1776.     Spell Wing_Clip = new Spell("Wing Clip");
  1777.  
  1778.     // PET
  1779.     Spell Kill_Command = new Spell("Kill Command");
  1780.     Spell Mend_Pet = new Spell("Mend Pet"); //  136
  1781.     Spell Revive_Pet = new Spell("Revive Pet"); //  982
  1782.     Spell Call_Pet = new Spell("Call Pet 1");   //  883
  1783.  
  1784.     // TIMER
  1785.     Timer look = new Timer(0);
  1786.     Timer fighttimer = new Timer(0);
  1787.     Timer petheal = new Timer(0);
  1788.     Timer traplaunchertimer = new Timer(0);
  1789.     Timer disengagetimer = new Timer(0);
  1790.     Timer Serpent_Sting_debuff = new Timer(0);
  1791.     Timer mountchill = new Timer(0);
  1792.  
  1793.     // Profession & Racials
  1794.     Spell Arcane_Torrent = new Spell("Arcane Torrent");
  1795.     Spell Lifeblood = new Spell("Lifeblood");
  1796.     Spell Stoneform = new Spell("Stoneform");
  1797.     Spell Tailoring = new Spell("Tailoring");
  1798.     Spell Leatherworking = new Spell("Leatherworking");
  1799.     Spell Gift_of_the_Naaru = new Spell("Gift of the Naaru");
  1800.     Spell War_Stomp = new Spell("War Stomp");
  1801.     Spell Berserking = new Spell("Berserking");
  1802.  
  1803.     #endregion InitializeSpell
  1804.  
  1805.     public Marks()
  1806.     {
  1807.         Main.range = 30.0f;
  1808.         UInt64 lastTarget = 0;
  1809.  
  1810.         while (Main.loop)
  1811.         {
  1812.  
  1813.             if (!ObjectManager.Me.IsMounted)
  1814.             {
  1815.                 buffoutfight();
  1816.  
  1817.                 if (!Fight.InFight && look.IsReady)
  1818.                 {
  1819.                     look = new Timer(5000);
  1820.                     Lua.RunMacroText("/targetfriendplayer");
  1821.                 }
  1822.  
  1823.                 if (Fight.InFight && ObjectManager.Me.Target > 0 && ObjectManager.Target.GetDistance > Main.range)
  1824.                 {
  1825.                     fighttimer = new Timer(60000);
  1826.                 }
  1827.  
  1828.                 if (Fight.InFight && ObjectManager.Me.Target > 0)
  1829.                 {
  1830.                     if (ObjectManager.Me.Target != lastTarget && ObjectManager.Target.GetDistance <= Main.range)
  1831.                     {
  1832.                         pull();
  1833.                         lastTarget = ObjectManager.Me.Target;
  1834.                     }
  1835.                     fight();
  1836.                     if (!Fight.InFight)
  1837.                     {
  1838.                         Logging.WriteFight(" - Target Down - ");
  1839.                         look = new Timer(5000);
  1840.                     }
  1841.  
  1842.                     if (fighttimer.IsReady && ObjectManager.Target.HealthPercent > 90 && ObjectManager.Me.Target > 0 && ObjectManager.GetNumberAttackPlayer() < 2)
  1843.                     {
  1844.                         Logging.WriteFight(" - Target Evading - ");
  1845.                         break;
  1846.                     }
  1847.                 }
  1848.             }
  1849.             if (ObjectManager.Me.IsMounted) mountchill = new Timer(2000);
  1850.             Thread.Sleep(350);
  1851.         }
  1852.     }
  1853.  
  1854.     public void pull()
  1855.     {
  1856.  
  1857.         if (hardmob()) Logging.WriteFight(" -  Pull Hard Mob - ");
  1858.         if (!hardmob()) Logging.WriteFight(" -  Pull Easy Mob - ");
  1859.         fighttimer = new Timer(60000);
  1860.  
  1861.         if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood)
  1862.         {
  1863.             SpellManager.CastSpellByIdLUA(5116);
  1864.             // Concussive_Shot.Launch();
  1865.         }
  1866.     }
  1867.  
  1868.     public void buffoutfight()
  1869.     {
  1870.  
  1871.         if (Fight.InFight || ObjectManager.Me.IsDeadMe) return;
  1872.  
  1873.         pet();
  1874.  
  1875.         if (!ObjectManager.Me.HaveBuff(79640) &&
  1876.             ItemsManager.GetItemCountByIdLUA(58149) == 1)
  1877.         {
  1878.             Logging.WriteFight("Use Alchi Flask");
  1879.             Lua.RunMacroText("/use item:58149");
  1880.         }
  1881.  
  1882.         if (Aspect_of_the_Hawk.KnownSpell && Aspect_of_the_Hawk.IsSpellUsable &&
  1883.             !Aspect_of_the_Hawk.HaveBuff)
  1884.         {
  1885.             SpellManager.CastSpellByIdLUA(13165);
  1886.             // Aspect_of_the_Hawk.Launch();
  1887.         }
  1888.  
  1889.     }
  1890.  
  1891.     public void fight()
  1892.     {
  1893.         pet();
  1894.         selfheal();
  1895.         buffinfight();
  1896.         if (ObjectManager.GetNumberAttackPlayer() > 1) fighttimer = new Timer(60000);
  1897.  
  1898.         if (ObjectManager.GetNumberAttackPlayer() > 2 && Explosive_Trap.IsSpellUsable && Trap_Launcher.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  1899.         {
  1900.             traplaunchertimer = new Timer(1000);
  1901.             Trap_Launcher.Launch();
  1902.             while (!traplaunchertimer.IsReady)
  1903.             {
  1904.                 if (Explosive_Trap.KnownSpell && Explosive_Trap.IsSpellUsable)
  1905.                 {
  1906.                     SpellManager.CastSpellByIDAndPosition(13813, ObjectManager.Target.Position);
  1907.                 }
  1908.             }
  1909.         }
  1910.  
  1911.         if (ObjectManager.GetNumberAttackPlayer() < 2 && Immolation_Trap.IsSpellUsable && Trap_Launcher.IsSpellUsable && Arcane_Shot.IsDistanceGood &&
  1912.             !ObjectManager.Target.IsTargetingMe && ObjectManager.Target.HealthPercent > 70)
  1913.         {
  1914.             traplaunchertimer = new Timer(1000);
  1915.             Trap_Launcher.Launch();
  1916.             while (!traplaunchertimer.IsReady)
  1917.             {
  1918.                 if (Immolation_Trap.KnownSpell && Immolation_Trap.IsSpellUsable)
  1919.                 {
  1920.                     SpellManager.CastSpellByIDAndPosition(13795, ObjectManager.Target.Position);
  1921.                 }
  1922.             }
  1923.         }
  1924.  
  1925.         if (ObjectManager.GetNumberAttackPlayer() < 2 && Immolation_Trap.IsSpellUsable && !Trap_Launcher.KnownSpell && Arcane_Shot.IsDistanceGood)
  1926.         {
  1927.  
  1928.             Immolation_Trap.Launch();
  1929.         }
  1930.  
  1931.  
  1932.  
  1933.         if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  1934.         {
  1935.             SpellManager.CastSpellByIdLUA(53351);
  1936.             // Kill_Shot.Launch();
  1937.         }
  1938.  
  1939.         if (Hunters_Mark.KnownSpell && Hunters_Mark.IsSpellUsable && Hunters_Mark.IsDistanceGood && !Hunters_Mark.TargetHaveBuff && !Chimera_Shot.KnownSpell)
  1940.         {
  1941.             SpellManager.CastSpellByIdLUA(1130);
  1942.             // Hunters_Mark.Launch();
  1943.         }
  1944.  
  1945.         if ((ObjectManager.GetNumberAttackPlayer() > 2 || hardmob()) && Misdirection.KnownSpell && Misdirection.IsSpellUsable)
  1946.         {
  1947.             Lua.RunMacroText("/cast [@pet] Misdirection");
  1948.             Lua.RunMacroText("/cast [@pet] Irreführung");
  1949.             Lua.RunMacroText("/cast [@pet] Détournement");
  1950.             Lua.RunMacroText("/cast [@pet] ???????????????");
  1951.             Lua.RunMacroText("/cast [@pet] Redirección");
  1952.             Lua.RunMacroText("/cast [@pet] Redirecionar");
  1953.         }
  1954.  
  1955.         if (ObjectManager.Me.HaveBuff(82926) && Aimed_Shot.IsSpellUsable && Aimed_Shot.IsDistanceGood)
  1956.         {
  1957.             SpellManager.CastSpellByIdLUA(19434);
  1958.             // Aimed_Shot.Launch();
  1959.         }
  1960.  
  1961.         if (ObjectManager.Me.HaveBuff(82897))
  1962.         {
  1963.             Kill_Command.Launch();
  1964.         }
  1965.  
  1966.         if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood && !ObjectManager.Target.HaveBuff(1978))
  1967.         {
  1968.             SpellManager.CastSpellByIdLUA(5116);
  1969.             // Concussive_Shot.Launch();
  1970.         }
  1971.  
  1972.         if (!ObjectManager.Target.HaveBuff(1978) && Serpent_Sting_debuff.IsReady && Arcane_Shot.IsDistanceGood)
  1973.         {
  1974.             Serpent_Sting_debuff = new Timer(2000);
  1975.             Serpent_Sting.Launch();
  1976.         }
  1977.  
  1978.         if (!ObjectManager.Target.HaveBuff(1978) && !Serpent_Sting_debuff.IsReady)
  1979.         {
  1980.             if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  1981.             {
  1982.                 Kill_Shot.Launch();
  1983.             }
  1984.             if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  1985.             {
  1986.                 Kill_Command.Launch();
  1987.             }
  1988.         }
  1989.  
  1990.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) && Snake_Trap.IsSpellUsable && Arcane_Shot.IsDistanceGood && !ObjectManager.Target.GetMove && Trap_Launcher.KnownSpell && look.IsReady)
  1991.         {
  1992.             traplaunchertimer = new Timer(1000);
  1993.             Trap_Launcher.Launch();
  1994.             while (!traplaunchertimer.IsReady)
  1995.             {
  1996.                 if (Snake_Trap.KnownSpell && Snake_Trap.IsSpellUsable && Trap_Launcher.HaveBuff)
  1997.                 {
  1998.                     SpellManager.CastSpellByIDAndPosition(34600, ObjectManager.Target.Position);
  1999.                 }
  2000.             }
  2001.         }
  2002.  
  2003.         if (Freezing_Trap.KnownSpell && Freezing_Trap.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  2004.         {
  2005.             SpellManager.CastSpellByIdLUA(1499);
  2006.             // Freezing_Trap.Launch();
  2007.         }
  2008.  
  2009.         if (Scatter_Shot.KnownSpell && Scatter_Shot.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 2)
  2010.         {
  2011.             Scatter_Shot.Launch();
  2012.         }
  2013.  
  2014.         if (ObjectManager.Me.BarTwoPercentage > 44 && ObjectManager.Target.HaveBuff(1978))
  2015.         {
  2016.             if (Multi_Shot.KnownSpell && Multi_Shot.IsSpellUsable && Multi_Shot.IsDistanceGood && ObjectManager.GetNumberAttackPlayer() > 1)
  2017.             {
  2018.                 SpellManager.CastSpellByIdLUA(2643);
  2019.                 // Multi_Shot.Launch();
  2020.             }
  2021.             if (Chimera_Shot.KnownSpell && Chimera_Shot.IsSpellUsable && Chimera_Shot.IsDistanceGood)
  2022.             {
  2023.                 SpellManager.CastSpellByIdLUA(53209);
  2024.                 // Chimera_Shot.Launch();
  2025.             }
  2026.  
  2027.             if (Aimed_Shot.KnownSpell && Aimed_Shot.IsSpellUsable && Aimed_Shot.IsDistanceGood && !Chimera_Shot.IsSpellUsable)
  2028.             {
  2029.                 SpellManager.CastSpellByIdLUA(19434);
  2030.                 // Aimed_Shot.Launch();
  2031.             }
  2032.  
  2033.             if (Arcane_Shot.KnownSpell && Arcane_Shot.IsSpellUsable && Arcane_Shot.IsDistanceGood && !Chimera_Shot.IsSpellUsable && !Aimed_Shot.IsSpellUsable)
  2034.             {
  2035.                 SpellManager.CastSpellByIdLUA(3044);
  2036.                 // Arcane_Shot.Launch();
  2037.             }
  2038.         }
  2039.  
  2040.         if (ObjectManager.Me.BarTwoPercentage < 50 && ObjectManager.Target.HaveBuff(1978))
  2041.         {
  2042.             if (Steady_Shot.KnownSpell && Steady_Shot.IsSpellUsable && Steady_Shot.IsDistanceGood)
  2043.             {
  2044.                 SpellManager.CastSpellByIdLUA(56641);
  2045.                 // Steady_Shot.Launch();
  2046.             }
  2047.  
  2048.         }
  2049.  
  2050.         if (Arcane_Torrent.KnownSpell && Arcane_Torrent.IsSpellUsable &&
  2051.             ObjectManager.Target.IsCast && ObjectManager.Target.GetDistance < 8)
  2052.         {
  2053.             Arcane_Torrent.Launch();
  2054.         }
  2055.  
  2056.         if (Silencing_Shot.KnownSpell && Silencing_Shot.IsSpellUsable && Silencing_Shot.IsDistanceGood &&
  2057.             ObjectManager.Target.IsCast)
  2058.         {
  2059.             Silencing_Shot.Launch();
  2060.         }
  2061.  
  2062.     }
  2063.  
  2064.     private void pet()
  2065.     {
  2066.  
  2067.         if (ObjectManager.Me.IsMounted || !mountchill.IsReady) return;
  2068.  
  2069.         if ((ObjectManager.Pet.Health == 0 || ObjectManager.Pet.Guid == 0) &&
  2070.             !ObjectManager.Me.IsMounted && !ObjectManager.Me.IsDeadMe)
  2071.         {
  2072.             Call_Pet.Launch();
  2073.             Thread.Sleep(1000);
  2074.             if (!ObjectManager.Pet.IsAlive)
  2075.             {
  2076.                 Revive_Pet.Launch();
  2077.                 Thread.Sleep(1000);
  2078.             }
  2079.         }
  2080.  
  2081.         if (Mend_Pet.KnownSpell && Mend_Pet.IsSpellUsable && petheal.IsReady &&
  2082.             ObjectManager.Pet.Health > 0 && ObjectManager.Pet.HealthPercent < 70)
  2083.         {
  2084.             petheal = new Timer(9000);
  2085.             Mend_Pet.Launch();
  2086.         }
  2087.  
  2088.         if (Fight.InFight) Lua.RunMacroText("/petattack");
  2089.  
  2090.     }
  2091.  
  2092.     private void buffinfight()
  2093.     {
  2094.  
  2095.         if (!Fight.InFight) return;
  2096.  
  2097.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) &&
  2098.             ObjectManager.Me.HealthPercent < 65 &&
  2099.             ObjectManager.Target.GetDistance < 5 &&
  2100.             Stoneform.KnownSpell && Stoneform.IsSpellUsable)
  2101.         {
  2102.             SpellManager.CastSpellByIdLUA(20594);
  2103.             // Stoneform.Launch();
  2104.         }
  2105.  
  2106.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) &&
  2107.             ObjectManager.Me.HealthPercent < 65 &&
  2108.             ObjectManager.Target.GetDistance < 5 &&
  2109.             War_Stomp.KnownSpell && War_Stomp.IsSpellUsable)
  2110.         {
  2111.             SpellManager.CastSpellByIdLUA(20549);
  2112.             // War_Stomp.Launch();
  2113.         }
  2114.  
  2115.         if (Berserking.KnownSpell && Berserking.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  2116.         {
  2117.             SpellManager.CastSpellByIdLUA(1454);
  2118.             // Berserking.Launch();
  2119.         }
  2120.  
  2121.         if (Rapid_Fire.KnownSpell && Rapid_Fire.IsSpellUsable && (hardmob() || ObjectManager.GetNumberAttackPlayer() > 2) && Arcane_Shot.IsDistanceGood)
  2122.         {
  2123.             Rapid_Fire.Launch();
  2124.         }
  2125.  
  2126.         if (Readiness.KnownSpell && Readiness.IsSpellUsable && (hardmob() || ObjectManager.GetNumberAttackPlayer() > 2) && Arcane_Shot.IsDistanceGood &&
  2127.             !Rapid_Fire.IsSpellUsable && !Chimera_Shot.IsSpellUsable)
  2128.         {
  2129.             Readiness.Launch();
  2130.         }
  2131.  
  2132.     }
  2133.  
  2134.     private void selfheal()
  2135.     {
  2136.  
  2137.         if (ObjectManager.Me.HealthPercent < 80 &&
  2138.             Lifeblood.KnownSpell && Lifeblood.IsSpellUsable)
  2139.         {
  2140.             Lifeblood.Launch();
  2141.         }
  2142.  
  2143.         if (ObjectManager.Me.HealthPercent < 80 &&
  2144.             Gift_of_the_Naaru.KnownSpell && Gift_of_the_Naaru.IsSpellUsable)
  2145.         {
  2146.             Gift_of_the_Naaru.Launch();
  2147.         }
  2148.  
  2149.         if (Disengage.KnownSpell && Disengage.IsSpellUsable && Disengage.IsDistanceGood &&
  2150.             ObjectManager.Target.HealthPercent > 30 && ObjectManager.Target.GetDistance < 5)
  2151.         {
  2152.             disengagetimer = new Timer(2000);
  2153.             while (ObjectManager.Target.GetDistance < 5 && !disengagetimer.IsReady)
  2154.                 if (Wing_Clip.KnownSpell && Wing_Clip.IsSpellUsable && Wing_Clip.IsDistanceGood && !Wing_Clip.TargetHaveBuff)
  2155.                 {
  2156.                     SpellManager.CastSpellByIdLUA(2974);
  2157.                     // Wing_Clip.Launch();
  2158.                 }
  2159.             SpellManager.CastSpellByIdLUA(781);
  2160.             // Disengage.Launch();
  2161.             if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood)
  2162.             {
  2163.                 SpellManager.CastSpellByIdLUA(5116);
  2164.                 // Concussive_Shot.Launch();
  2165.             }
  2166.             return;
  2167.         }
  2168.  
  2169.         if (ObjectManager.Target.GetDistance < 10 && ((Disengage.KnownSpell && !Disengage.IsSpellUsable) || !Disengage.KnownSpell))
  2170.         {
  2171.             disengagetimer = new Timer(5000);
  2172.             while (ObjectManager.Target.GetDistance < 10 || !disengagetimer.IsReady)
  2173.             {
  2174.                 if (!Fight.InFight) return;
  2175.                 Keyboard.DownKey(nManager.Wow.Memory.WowProcess.MainWindowHandle, "S");
  2176.                 Thread.Sleep(100);
  2177.  
  2178.                 if (Mend_Pet.KnownSpell && Mend_Pet.IsSpellUsable && petheal.IsReady &&
  2179.                     ObjectManager.Pet.Health > 0 && ObjectManager.Pet.HealthPercent < 70)
  2180.                 {
  2181.                     petheal = new Timer(9000);
  2182.                     Mend_Pet.Launch();
  2183.                 }
  2184.  
  2185.                 if (Wing_Clip.KnownSpell && Wing_Clip.IsSpellUsable && Wing_Clip.IsDistanceGood && !Wing_Clip.TargetHaveBuff)
  2186.                 {
  2187.                     SpellManager.CastSpellByIdLUA(2974);
  2188.                     // Wing_Clip.Launch();
  2189.                 }
  2190.  
  2191.                 if (ObjectManager.Me.HaveBuff(82926) && Aimed_Shot.IsSpellUsable && Aimed_Shot.IsDistanceGood)
  2192.                 {
  2193.                     SpellManager.CastSpellByIdLUA(19434);
  2194.                     // Aimed_Shot.Launch();
  2195.                 }
  2196.  
  2197.                 if (Raptor_Strike.KnownSpell && Raptor_Strike.IsSpellUsable && Raptor_Strike.IsDistanceGood)
  2198.                 {
  2199.                     SpellManager.CastSpellByIdLUA(2973);
  2200.                     // Raptor_Strike.Launch();
  2201.                 }
  2202.  
  2203.                 if (Kill_Command.KnownSpell && Kill_Command.IsSpellUsable && Kill_Command.IsDistanceGood)
  2204.                 {
  2205.                     SpellManager.CastSpellByIdLUA(34026);
  2206.                     // Kill_Command.Launch();
  2207.                 }
  2208.  
  2209.                 if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  2210.                 {
  2211.                     SpellManager.CastSpellByIdLUA(53351);
  2212.                     // Kill_Shot.Launch();
  2213.                 }
  2214.  
  2215.                 if (Chimera_Shot.KnownSpell && Chimera_Shot.IsSpellUsable && Chimera_Shot.IsDistanceGood && ObjectManager.Me.BarTwoPercentage > 70)
  2216.                 {
  2217.                     SpellManager.CastSpellByIdLUA(53209);
  2218.                     // Chimera_Shot.Launch();
  2219.                 }
  2220.  
  2221.                 if (Arcane_Shot.KnownSpell && Arcane_Shot.IsSpellUsable && Arcane_Shot.IsDistanceGood && !Chimera_Shot.IsSpellUsable && ObjectManager.Me.BarTwoPercentage > 70)
  2222.                 {
  2223.                     SpellManager.CastSpellByIdLUA(3044);
  2224.                     // Arcane_Shot.Launch();
  2225.                 }
  2226.  
  2227.                 if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable)
  2228.                 {
  2229.                     Feign_Death.Launch();
  2230.                     Thread.Sleep(3000);
  2231.                 }
  2232.  
  2233.                 if (Freezing_Trap.KnownSpell && Freezing_Trap.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  2234.                 {
  2235.                     SpellManager.CastSpellByIdLUA(1499);
  2236.                     // Freezing_Trap.Launch();
  2237.                 }
  2238.  
  2239.                 if (Scatter_Shot.KnownSpell && Scatter_Shot.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  2240.                 {
  2241.                     Scatter_Shot.Launch();
  2242.                 }
  2243.  
  2244.                 if (ObjectManager.Me.HealthPercent < 30 && ObjectManager.Target.IsTargetingMe)
  2245.                 {
  2246.                     if (!Feign_Death.IsSpellUsable && !Scatter_Shot.IsSpellUsable && Deterrence.KnownSpell && Deterrence.KnownSpell)
  2247.                     {
  2248.                         Deterrence.Launch();
  2249.                     }
  2250.                 }
  2251.  
  2252.                 Keyboard.DownKey(nManager.Wow.Memory.WowProcess.MainWindowHandle, "{SPACE}");
  2253.             }
  2254.         }
  2255.  
  2256.         if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable && ObjectManager.Me.HealthPercent < 30 && ObjectManager.Pet.Health > 10)
  2257.         {
  2258.             Feign_Death.Launch();
  2259.             Thread.Sleep(2500);
  2260.         }
  2261.  
  2262.         if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable && ObjectManager.Me.HealthPercent < 15 && (ObjectManager.Pet.Health == 0 || ObjectManager.Pet.Guid == 0))
  2263.         {
  2264.             Feign_Death.Launch();
  2265.             Lua.RunMacroText("/cleartarget");
  2266.             Thread.Sleep(30000);
  2267.         }
  2268.  
  2269.     }
  2270.  
  2271.     public bool hardmob()
  2272.     {
  2273.         if (((ObjectManager.Target.MaxHealth * 100) / ObjectManager.Me.MaxHealth) > 110)
  2274.         {
  2275.             return true;
  2276.         }
  2277.         return false;
  2278.     }
  2279. }
  2280. public class BeastMaster
  2281. {
  2282.     #region InitializeSpell
  2283.  
  2284.     // Beast Mastery only
  2285.     Spell Beastial_Wrath = new Spell("Beastial Wrath");
  2286.     Spell Focus_Fire = new Spell("Focus Fire");
  2287.     Spell Intimidation = new Spell("Intimidation");
  2288.     // Beast master with a Spirit Beast only
  2289.     Spell Spirit_Mend = new Spell("Spirit Mend");
  2290.  
  2291.     // DPS
  2292.     Spell Raptor_Strike = new Spell("Raptor Strike");
  2293.     Spell Arcane_Shot = new Spell("Arcane Shot");
  2294.     Spell Steady_Shot = new Spell("Steady Shot");
  2295.     Spell Serpent_Sting = new Spell("Serpent Sting");
  2296.     Spell Multi_Shot = new Spell("Multi-Shot");
  2297.     Spell Kill_Shot = new Spell("Kill Shot");
  2298.     Spell Explosive_Trap = new Spell("Explosive Trap");
  2299.     Spell Cobra_Shot = new Spell("Cobra Shot");
  2300.     Spell Immolation_Trap = new Spell("Immolation Trap");
  2301.  
  2302.     // BUFF & HELPING
  2303.     Spell Concussive_Shot = new Spell("Concussive Shot");
  2304.     Spell Aspect_of_the_Hawk = new Spell("Aspect of the Hawk");
  2305.     Spell Disengage = new Spell("Disengage");
  2306.     Spell Hunters_Mark = new Spell("Hunter's Mark");
  2307.     Spell Scatter_Shot = new Spell("Scatter Shot"); // 19503
  2308.     Spell Feign_Death = new Spell("Feign Death");   //  5384
  2309.     Spell Snake_Trap = new Spell("Snake Trap");
  2310.     Spell Ice_Trap = new Spell("Ice Trap");
  2311.     Spell Freezing_Trap = new Spell("Freezing Trap");
  2312.     Spell Trap_Launcher = new Spell("Trap Launcher");   //  77769
  2313.     Spell Rapid_Fire = new Spell("Rapid Fire"); //  3045
  2314.     Spell Misdirection = new Spell("Misdirection");
  2315.     Spell Deterrence = new Spell("Deterrence"); //  19263
  2316.     Spell Wing_Clip = new Spell("Wing Clip");
  2317.  
  2318.     // PET
  2319.     Spell Kill_Command = new Spell("Kill Command");
  2320.     Spell Mend_Pet = new Spell("Mend Pet"); //  136
  2321.     Spell Revive_Pet = new Spell("Revive Pet"); //  982
  2322.     Spell Call_Pet = new Spell("Call Pet 1");   //  883
  2323.  
  2324.     // TIMER
  2325.     Timer look = new Timer(0);
  2326.     Timer fighttimer = new Timer(0);
  2327.     Timer petheal = new Timer(0);
  2328.     Timer traplaunchertimer = new Timer(0);
  2329.     Timer disengagetimer = new Timer(0);
  2330.     Timer Serpent_Sting_debuff = new Timer(0);
  2331.     Timer mountchill = new Timer(0);
  2332.  
  2333.     // Profession & Racials
  2334.     Spell Arcane_Torrent = new Spell("Arcane Torrent");
  2335.     Spell Lifeblood = new Spell("Lifeblood");
  2336.     Spell Stoneform = new Spell("Stoneform");
  2337.     Spell Tailoring = new Spell("Tailoring");
  2338.     Spell Leatherworking = new Spell("Leatherworking");
  2339.     Spell Gift_of_the_Naaru = new Spell("Gift of the Naaru");
  2340.     Spell War_Stomp = new Spell("War Stomp");
  2341.     Spell Berserking = new Spell("Berserking");
  2342.  
  2343.     #endregion InitializeSpell
  2344.  
  2345.     public BeastMaster()
  2346.     {
  2347.         Main.range = 30.0f;
  2348.         UInt64 lastTarget = 0;
  2349.  
  2350.         while (Main.loop)
  2351.         {
  2352.  
  2353.             if (!ObjectManager.Me.IsMounted)
  2354.             {
  2355.                 buffoutfight();
  2356.  
  2357.                 if (!Fight.InFight && look.IsReady)
  2358.                 {
  2359.                     look = new Timer(5000);
  2360.                     Lua.RunMacroText("/targetfriendplayer");
  2361.                 }
  2362.  
  2363.                 if (Fight.InFight && ObjectManager.Me.Target > 0 && ObjectManager.Target.GetDistance > Main.range)
  2364.                 {
  2365.                     fighttimer = new Timer(60000);
  2366.                 }
  2367.  
  2368.                 if (Fight.InFight && ObjectManager.Me.Target > 0)
  2369.                 {
  2370.                     if (ObjectManager.Me.Target != lastTarget && ObjectManager.Target.GetDistance <= Main.range)
  2371.                     {
  2372.                         pull();
  2373.                         lastTarget = ObjectManager.Me.Target;
  2374.                     }
  2375.                     fight();
  2376.                     if (!Fight.InFight)
  2377.                     {
  2378.                         Logging.WriteFight(" - Target Down - ");
  2379.                         look = new Timer(5000);
  2380.                     }
  2381.  
  2382.                     if (fighttimer.IsReady && ObjectManager.Target.HealthPercent > 90 && ObjectManager.Me.Target > 0 && ObjectManager.GetNumberAttackPlayer() < 2)
  2383.                     {
  2384.                         Logging.WriteFight(" - Target Evading - ");
  2385.                         break;
  2386.                     }
  2387.                 }
  2388.             }
  2389.             if (ObjectManager.Me.IsMounted) mountchill = new Timer(2000);
  2390.             Thread.Sleep(350);
  2391.         }
  2392.     }
  2393.  
  2394.     public void pull()
  2395.     {
  2396.  
  2397.         if (hardmob())
  2398.             Logging.WriteFight(" -  Pull Hard Mob - ");
  2399.         else
  2400.             Logging.WriteFight(" -  Pull Easy Mob - ");
  2401.         fighttimer = new Timer(60000);
  2402.  
  2403.         if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood)
  2404.         {
  2405.             SpellManager.CastSpellByIdLUA(5116);
  2406.             // Concussive_Shot.Launch();
  2407.         }
  2408.     }
  2409.  
  2410.     public void buffoutfight()
  2411.     {
  2412.  
  2413.         if (Fight.InFight || ObjectManager.Me.IsDeadMe) return;
  2414.  
  2415.         pet();
  2416.  
  2417.         if (!ObjectManager.Me.HaveBuff(79640) &&
  2418.             ItemsManager.GetItemCountByIdLUA(58149) == 1)
  2419.         {
  2420.             Logging.WriteFight("Use Alchi Flask");
  2421.             Lua.RunMacroText("/use item:58149");
  2422.         }
  2423.  
  2424.         if (Aspect_of_the_Hawk.KnownSpell && Aspect_of_the_Hawk.IsSpellUsable &&
  2425.             !Aspect_of_the_Hawk.HaveBuff)
  2426.         {
  2427.             SpellManager.CastSpellByIdLUA(13165);
  2428.             // Aspect_of_the_Hawk.Launch();
  2429.         }
  2430.  
  2431.     }
  2432.  
  2433.     public void fight()
  2434.     {
  2435.         pet();
  2436.         selfheal();
  2437.         buffinfight();
  2438.         if (ObjectManager.GetNumberAttackPlayer() > 1) fighttimer = new Timer(60000);
  2439.  
  2440.         if (ObjectManager.GetNumberAttackPlayer() > 2 && Explosive_Trap.IsSpellUsable && Trap_Launcher.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  2441.         {
  2442.             traplaunchertimer = new Timer(1100);
  2443.             Trap_Launcher.Launch();
  2444.             while (!traplaunchertimer.IsReady)
  2445.             {
  2446.                 if (Explosive_Trap.KnownSpell && Explosive_Trap.IsSpellUsable)
  2447.                 {
  2448.                     SpellManager.CastSpellByIDAndPosition(13813, ObjectManager.Target.Position);
  2449.                 }
  2450.             }
  2451.         }
  2452.  
  2453.         if (ObjectManager.GetNumberAttackPlayer() < 2 && Immolation_Trap.IsSpellUsable && Trap_Launcher.IsSpellUsable && Arcane_Shot.IsDistanceGood &&
  2454.             !ObjectManager.Target.IsTargetingMe && ObjectManager.Target.HealthPercent > 70)
  2455.         {
  2456.             traplaunchertimer = new Timer(1100);
  2457.             Trap_Launcher.Launch();
  2458.             while (!traplaunchertimer.IsReady)
  2459.             {
  2460.                 if (Immolation_Trap.KnownSpell && Immolation_Trap.IsSpellUsable)
  2461.                 {
  2462.                     SpellManager.CastSpellByIDAndPosition(13795, ObjectManager.Target.Position);
  2463.                 }
  2464.             }
  2465.         }
  2466.  
  2467.         if (ObjectManager.GetNumberAttackPlayer() < 2 && Immolation_Trap.IsSpellUsable && !Trap_Launcher.KnownSpell && Arcane_Shot.IsDistanceGood)
  2468.         {
  2469.             Immolation_Trap.Launch();
  2470.         }
  2471.  
  2472.         if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  2473.         {
  2474.             SpellManager.CastSpellByIdLUA(53351);
  2475.             // Kill_Shot.Launch();
  2476.         }
  2477.  
  2478.         if (Hunters_Mark.KnownSpell && Hunters_Mark.IsSpellUsable && Hunters_Mark.IsDistanceGood && !Hunters_Mark.TargetHaveBuff)
  2479.         {
  2480.             SpellManager.CastSpellByIdLUA(1130);
  2481.             // Hunters_Mark.Launch();
  2482.         }
  2483.  
  2484.         if ((ObjectManager.GetNumberAttackPlayer() > 2 || hardmob()) && Misdirection.KnownSpell && Misdirection.IsSpellUsable)
  2485.         {
  2486.             Lua.RunMacroText("/cast [@pet] Misdirection");
  2487.             Lua.RunMacroText("/cast [@pet] Irreführung");
  2488.             Lua.RunMacroText("/cast [@pet] Détournement");
  2489.             Lua.RunMacroText("/cast [@pet] ???????????????");
  2490.             Lua.RunMacroText("/cast [@pet] Redirección");
  2491.             Lua.RunMacroText("/cast [@pet] Redirecionar");
  2492.         }
  2493.  
  2494.         if (Focus_Fire.KnownSpell && Focus_Fire.IsSpellUsable && ObjectManager.Pet.BuffStack(19615) == 5) // Frenzy Effect
  2495.         {
  2496.             SpellManager.CastSpellByIdLUA(82692);
  2497.             // Focus_Fire.Launch();
  2498.         }
  2499.  
  2500.         if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood && !ObjectManager.Target.HaveBuff(1978))
  2501.         {
  2502.             SpellManager.CastSpellByIdLUA(5116);
  2503.             // Concussive_Shot.Launch();
  2504.         }
  2505.  
  2506.         if (!ObjectManager.Target.HaveBuff(1978) && Serpent_Sting_debuff.IsReady && Arcane_Shot.IsDistanceGood)
  2507.         {
  2508.             Serpent_Sting_debuff = new Timer(2500);
  2509.             Serpent_Sting.Launch();
  2510.         }
  2511.  
  2512.         if (!ObjectManager.Target.HaveBuff(1978) && !Serpent_Sting_debuff.IsReady)
  2513.         {
  2514.             if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  2515.             {
  2516.                 Kill_Shot.Launch();
  2517.             }
  2518.         }
  2519.  
  2520.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) && Snake_Trap.IsSpellUsable && Arcane_Shot.IsDistanceGood && !ObjectManager.Target.GetMove && Trap_Launcher.KnownSpell)
  2521.         {
  2522.             traplaunchertimer = new Timer(1100);
  2523.             Trap_Launcher.Launch();
  2524.             while (!traplaunchertimer.IsReady)
  2525.             {
  2526.                 if (Snake_Trap.KnownSpell && Snake_Trap.IsSpellUsable && Trap_Launcher.HaveBuff)
  2527.                 {
  2528.                     SpellManager.CastSpellByIDAndPosition(34600, ObjectManager.Target.Position);
  2529.                 }
  2530.             }
  2531.         }
  2532.  
  2533.         if (Freezing_Trap.KnownSpell && Freezing_Trap.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  2534.         {
  2535.             SpellManager.CastSpellByIdLUA(1499);
  2536.             // Freezing_Trap.Launch();
  2537.         }
  2538.  
  2539.         if (ObjectManager.Target.HaveBuff(1978))
  2540.         {
  2541.             if (Multi_Shot.KnownSpell && Multi_Shot.IsSpellUsable && Multi_Shot.IsDistanceGood && ObjectManager.GetNumberAttackPlayer() > 1)
  2542.             {
  2543.                 SpellManager.CastSpellByIdLUA(2643);
  2544.                 // Multi_Shot.Launch();
  2545.             }
  2546.  
  2547.             if (Kill_Command.KnownSpell && Kill_Command.IsSpellUsable)
  2548.             {
  2549.                 SpellManager.CastSpellByIdLUA(34026);
  2550.                 // Kill_Command.Launch();
  2551.             }
  2552.  
  2553.             if (Arcane_Shot.KnownSpell && Arcane_Shot.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  2554.             {
  2555.                 SpellManager.CastSpellByIdLUA(3044);
  2556.                 // Arcane_Shot.Launch();
  2557.             }
  2558.         }
  2559.  
  2560.         if (ObjectManager.Me.BarTwoPercentage < 70 && ObjectManager.Target.HaveBuff(1978))
  2561.         {
  2562.             if (Steady_Shot.KnownSpell && Steady_Shot.IsSpellUsable && Steady_Shot.IsDistanceGood && !Cobra_Shot.KnownSpell)
  2563.             {
  2564.                 SpellManager.CastSpellByIdLUA(56641);
  2565.                 // Steady_Shot.Launch();
  2566.             }
  2567.             else if (Cobra_Shot.KnownSpell && Cobra_Shot.IsSpellUsable && Cobra_Shot.IsDistanceGood && ObjectManager.Target.HaveBuff(1978))
  2568.             {
  2569.                 SpellManager.CastSpellByIdLUA(77767);
  2570.                 // Cobra_Shot.Launch();
  2571.             }
  2572.         }
  2573.  
  2574.         if (Arcane_Torrent.KnownSpell && Arcane_Torrent.IsSpellUsable &&
  2575.             ObjectManager.Target.IsCast && ObjectManager.Target.GetDistance < 8)
  2576.         {
  2577.             Arcane_Torrent.Launch();
  2578.         }
  2579.  
  2580.     }
  2581.  
  2582.     private void pet()
  2583.     {
  2584.  
  2585.         if (ObjectManager.Me.IsMounted || !mountchill.IsReady) return;
  2586.  
  2587.         if ((ObjectManager.Pet.Health == 0 || ObjectManager.Pet.Guid == 0) &&
  2588.             !ObjectManager.Me.IsMounted && !ObjectManager.Me.IsDeadMe)
  2589.         {
  2590.             Call_Pet.Launch();
  2591.             Thread.Sleep(1000);
  2592.             if (!ObjectManager.Pet.IsAlive)
  2593.             {
  2594.                 Revive_Pet.Launch();
  2595.                 Thread.Sleep(1000);
  2596.             }
  2597.         }
  2598.  
  2599.         if (Mend_Pet.KnownSpell && Mend_Pet.IsSpellUsable && petheal.IsReady &&
  2600.             ObjectManager.Pet.Health > 0 && ObjectManager.Pet.HealthPercent < 70)
  2601.         {
  2602.             petheal = new Timer(9000);
  2603.             Mend_Pet.Launch();
  2604.         }
  2605.  
  2606.         if (Fight.InFight) Lua.RunMacroText("/petattack");
  2607.  
  2608.     }
  2609.  
  2610.     private void buffinfight()
  2611.     {
  2612.  
  2613.         if (!Fight.InFight) return;
  2614.  
  2615.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) &&
  2616.             ObjectManager.Me.HealthPercent < 65 &&
  2617.             ObjectManager.Target.GetDistance < 5 &&
  2618.             Intimidation.KnownSpell && Intimidation.IsSpellUsable)
  2619.         {
  2620.             SpellManager.CastSpellByIdLUA(19577);
  2621.             // Intimidation.Launch();
  2622.         }
  2623.  
  2624.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) &&
  2625.             ObjectManager.Me.HealthPercent < 65 &&
  2626.             ObjectManager.Target.GetDistance < 5 &&
  2627.             Stoneform.KnownSpell && Stoneform.IsSpellUsable)
  2628.         {
  2629.             SpellManager.CastSpellByIdLUA(20594);
  2630.             // Stoneform.Launch();
  2631.         }
  2632.  
  2633.         if ((ObjectManager.GetNumberAttackPlayer() > 1 || hardmob()) &&
  2634.             ObjectManager.Me.HealthPercent < 65 &&
  2635.             ObjectManager.Target.GetDistance < 5 &&
  2636.             War_Stomp.KnownSpell && War_Stomp.IsSpellUsable)
  2637.         {
  2638.             SpellManager.CastSpellByIdLUA(20549);
  2639.             // War_Stomp.Launch();
  2640.         }
  2641.  
  2642.         if (Berserking.KnownSpell && Berserking.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  2643.         {
  2644.             SpellManager.CastSpellByIdLUA(1454);
  2645.             // Berserking.Launch();
  2646.         }
  2647.  
  2648.         if (Rapid_Fire.KnownSpell && Rapid_Fire.IsSpellUsable && (hardmob() || ObjectManager.GetNumberAttackPlayer() > 2) && Arcane_Shot.IsDistanceGood)
  2649.         {
  2650.             Rapid_Fire.Launch();
  2651.         }
  2652.  
  2653.     }
  2654.  
  2655.     private void selfheal()
  2656.     {
  2657.  
  2658.         if (ObjectManager.Me.HealthPercent < 80 &&
  2659.             Lifeblood.KnownSpell && Lifeblood.IsSpellUsable)
  2660.         {
  2661.             Lifeblood.Launch();
  2662.         }
  2663.  
  2664.         if (ObjectManager.Me.HealthPercent < 80 &&
  2665.             Gift_of_the_Naaru.KnownSpell && Gift_of_the_Naaru.IsSpellUsable)
  2666.         {
  2667.             Gift_of_the_Naaru.Launch();
  2668.         }
  2669.  
  2670.         if (ObjectManager.Me.HealthPercent < 80 &&
  2671.             Spirit_Mend.KnownSpell && Spirit_Mend.IsSpellUsable)
  2672.         {
  2673.             Lua.RunMacroText("/target " + ObjectManager.Me.Name);
  2674.             SpellManager.CastSpellByIdLUA(90361);
  2675.             Lua.RunMacroText("/targetlasttarget");
  2676.         }
  2677.  
  2678.         if (Disengage.KnownSpell && Disengage.IsSpellUsable && Disengage.IsDistanceGood &&
  2679.             ObjectManager.Target.HealthPercent > 30 && ObjectManager.Target.GetDistance < 5)
  2680.         {
  2681.             disengagetimer = new Timer(2000);
  2682.             while (ObjectManager.Target.GetDistance < 5 && !disengagetimer.IsReady)
  2683.                 if (Wing_Clip.KnownSpell && Wing_Clip.IsSpellUsable && Wing_Clip.IsDistanceGood && !Wing_Clip.TargetHaveBuff)
  2684.                 {
  2685.                     SpellManager.CastSpellByIdLUA(2974);
  2686.                     // Wing_Clip.Launch();
  2687.                 }
  2688.             SpellManager.CastSpellByIdLUA(781);
  2689.             // Disengage.Launch();
  2690.             if (Concussive_Shot.KnownSpell && Concussive_Shot.IsSpellUsable && Concussive_Shot.IsDistanceGood)
  2691.             {
  2692.                 SpellManager.CastSpellByIdLUA(5116);
  2693.                 // Concussive_Shot.Launch();
  2694.             }
  2695.             return;
  2696.         }
  2697.  
  2698.         if (ObjectManager.Target.GetDistance < 10 && ((Disengage.KnownSpell && !Disengage.IsSpellUsable) || !Disengage.KnownSpell))
  2699.         {
  2700.             disengagetimer = new Timer(5000);
  2701.             while (ObjectManager.Target.GetDistance < 10 || !disengagetimer.IsReady)
  2702.             {
  2703.                 if (!Fight.InFight) return;
  2704.                 Keyboard.DownKey(nManager.Wow.Memory.WowProcess.MainWindowHandle, "S");
  2705.                 Thread.Sleep(100);
  2706.  
  2707.                 if (Mend_Pet.KnownSpell && Mend_Pet.IsSpellUsable && petheal.IsReady &&
  2708.                     ObjectManager.Pet.Health > 0 && ObjectManager.Pet.HealthPercent < 70)
  2709.                 {
  2710.                     petheal = new Timer(9000);
  2711.                     Mend_Pet.Launch();
  2712.                 }
  2713.  
  2714.                 if (Kill_Command.KnownSpell && Kill_Command.IsSpellUsable && Kill_Command.IsDistanceGood)
  2715.                 {
  2716.                     SpellManager.CastSpellByIdLUA(34026);
  2717.                     // Kill_Command.Launch();
  2718.                 }
  2719.  
  2720.                 if (Wing_Clip.KnownSpell && Wing_Clip.IsSpellUsable && Wing_Clip.IsDistanceGood && !Wing_Clip.TargetHaveBuff)
  2721.                 {
  2722.                     SpellManager.CastSpellByIdLUA(2974);
  2723.                     // Wing_Clip.Launch();
  2724.                 }
  2725.  
  2726.                 if (Raptor_Strike.KnownSpell && Raptor_Strike.IsSpellUsable && Raptor_Strike.IsDistanceGood)
  2727.                 {
  2728.                     SpellManager.CastSpellByIdLUA(2973);
  2729.                     // Raptor_Strike.Launch();
  2730.                 }
  2731.  
  2732.                 if (Kill_Shot.KnownSpell && Kill_Shot.IsSpellUsable && Kill_Shot.IsDistanceGood)
  2733.                 {
  2734.                     SpellManager.CastSpellByIdLUA(53351);
  2735.                     // Kill_Shot.Launch();
  2736.                 }
  2737.  
  2738.                 if (Arcane_Shot.KnownSpell && Arcane_Shot.IsSpellUsable && Arcane_Shot.IsDistanceGood)
  2739.                 {
  2740.                     SpellManager.CastSpellByIdLUA(3044);
  2741.                     // Arcane_Shot.Launch();
  2742.                 }
  2743.  
  2744.                 if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable)
  2745.                 {
  2746.                     Feign_Death.Launch();
  2747.                     Thread.Sleep(3000);
  2748.                 }
  2749.  
  2750.                 if (Freezing_Trap.KnownSpell && Freezing_Trap.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  2751.                 {
  2752.                     SpellManager.CastSpellByIdLUA(1499);
  2753.                     // Freezing_Trap.Launch();
  2754.                 }
  2755.  
  2756.                 if (Scatter_Shot.KnownSpell && Scatter_Shot.IsSpellUsable && ObjectManager.GetNumberAttackPlayer() > 1)
  2757.                 {
  2758.                     Scatter_Shot.Launch();
  2759.                 }
  2760.  
  2761.                 if (ObjectManager.Me.HealthPercent < 30 && ObjectManager.Target.IsTargetingMe)
  2762.                 {
  2763.                     if (!Feign_Death.IsSpellUsable && !Scatter_Shot.IsSpellUsable && Deterrence.KnownSpell && Deterrence.KnownSpell)
  2764.                     {
  2765.                         Deterrence.Launch();
  2766.                     }
  2767.                 }
  2768.  
  2769.                 Keyboard.DownKey(nManager.Wow.Memory.WowProcess.MainWindowHandle, "{SPACE}");
  2770.             }
  2771.         }
  2772.  
  2773.         if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable && ObjectManager.Me.HealthPercent < 15 && ObjectManager.Pet.Health > 10)
  2774.         {
  2775.             Feign_Death.Launch();
  2776.             Thread.Sleep(3000);
  2777.         }
  2778.  
  2779.         if (Feign_Death.KnownSpell && Feign_Death.IsSpellUsable && ObjectManager.Me.HealthPercent < 15 && (ObjectManager.Pet.Health == 0 || ObjectManager.Pet.Guid == 0))
  2780.         {
  2781.             Feign_Death.Launch();
  2782.             Lua.RunMacroText("/cleartarget");
  2783.             Thread.Sleep(30000);
  2784.         }
  2785.  
  2786.     }
  2787.  
  2788.     public bool hardmob()
  2789.     {
  2790.         if (((ObjectManager.Target.MaxHealth * 100) / ObjectManager.Me.MaxHealth) > 130)
  2791.         {
  2792.             return true;
  2793.         }
  2794.         return false;
  2795.     }
  2796. }
  2797. #endregion
Add Comment
Please, Sign In to add comment