Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2012
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 12.32 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3. using System.Windows.Forms;
  4. using nManager.Helpful;
  5. using nManager.Wow.Class;
  6. using nManager.Wow.Enums;
  7. using nManager.Wow.Helpers;
  8. using nManager.Wow.ObjectManager;
  9. using Keybindings = nManager.Wow.Enums.Keybindings;
  10. using Timer = nManager.Helpful.Timer;
  11.  
  12. public class Main : ICustomClass
  13. {
  14.     #region Initialize_CustomClass
  15.  
  16.     internal static float range = 3.5f;
  17.     public static bool loop = true;
  18.  
  19.     public float Range
  20.     {
  21.         get { return range; }
  22.     }
  23.  
  24.     public void ShowConfiguration()
  25.     {
  26.         MessageBox.Show("No setting for this custom class.");
  27.     }
  28.  
  29.     public void Initialize()
  30.     {
  31.         Logging.WriteFight("Loading WoW-RoboT CC");
  32.  
  33.         switch (ObjectManager.Me.WowClass)
  34.         {
  35.             case WoWClass.Monk:
  36.  
  37.                 Spell Jab = new Spell("Jab");
  38.  
  39.                 if (Jab.KnownSpell)
  40.                 {
  41.                     MonkWW ccMWW = new MonkWW();
  42.                 }
  43.  
  44.                                 break;
  45.  
  46.             default:
  47.                 Dispose();
  48.                 break;
  49.         }
  50.         Logging.WriteFight("WoWRoboT CC closed.");
  51.     }
  52.  
  53.     #endregion Initialize_CustomClass
  54.  
  55.     #region Dispose_CustomClass
  56.  
  57.     public void Dispose()
  58.     {
  59.         Logging.WriteFight("Closing WoW-RoboT CC");
  60.         loop = false;
  61.     }
  62.  
  63.     #endregion Dispose_CustomClass
  64. }
  65.  
  66. #region CustomClass
  67.  
  68. public class MonkWW
  69. {
  70.     #region InitializeSpell
  71.  
  72.  
  73.     Spell Stance_of_the_Fierce_Tiger = new Spell("Stance of the Fierce Tiger");
  74.  
  75.     Spell Jab = new Spell("Jab");
  76.     Spell Tiger_Palm = new Spell("Tiger Palm");
  77.     Spell Roll = new Spell("Roll");
  78.     Spell Blackout_Kick = new Spell("Blackout Kick");
  79.     Spell Provoke = new Spell("Provoke");
  80.     Spell Clash = new Spell("Clash");
  81.     Spell Detox = new Spell("Detox");
  82.     Spell Legacy_of_the_Emperor = new Spell("Legacy of the Emperor");
  83.     Spell Touch_Of_Death = new Spell("Touch Of Death");
  84.     Spell Fortifying_Brew = new Spell("Fortifying Brew");
  85.     Spell Expel_Harm = new Spell("Expel Harm");
  86.     Spell Disable = new Spell("Disable");
  87.     Spell Spear_Hand_Strike = new Spell("Spear Hand Strike");
  88.     Spell Paralysis = new Spell("Paralysis");
  89.     Spell Spinning_Crane_Kick = new Spell("Spinning Crane Kick");
  90.     Spell Crackling_Jade_Lightning = new Spell("Crackling Jade Lightning");
  91.     Spell Path_of_Blossoms = new Spell("Path of Blossoms");
  92.     Spell Grapple_Weapon = new Spell("Grapple Weapon");
  93.     Spell Zen_Meditation = new Spell("Zen Meditation");
  94.  
  95.     Spell Fists_of_Fury = new Spell("Fists of Fury");
  96.     Spell Flying_Serpent_Kick = new Spell("Flying Serpent Kick");
  97.     Spell Touch_of_Karma = new Spell("Touch of Karma");
  98.     Spell Energizing_Brew = new Spell("Energizing Brew");
  99.     Spell Spinning_Fire_Blossom = new Spell("Spinning Fire Blossom");
  100.     Spell Rising_Sun_Kick = new Spell("Rising Sun Kick");
  101.     Spell Tigereye_Brew = new Spell("Tigereye Brew");
  102.     Spell Elusive_Brew = new Spell("Elusive Brew");
  103.     Spell Legacy_of_the_White_Tiger = new Spell("Legacy of the White Tiger");
  104.  
  105.     Spell Tigers_Lust = new Spell("Tiger's Lust");
  106.     Spell Momentum = new Spell("Momentum");
  107.  
  108.     Spell Chi_Wave = new Spell("Chi Wave");
  109.     Spell Zen_Sphere = new Spell("Zen Sphere");
  110.     Spell Chi_Burst = new Spell("Chi Burst");
  111.  
  112.     Spell Chi_Brew = new Spell("Chi Brew");
  113.  
  114.     Spell Charging_Ox_Wave = new Spell("Charging Ox Wave");
  115.     Spell Leg_Sweep = new Spell("Leg Sweep");
  116.  
  117.     Spell Dampen_Harm = new Spell("Dampen Harm");
  118.     Spell Diffuse_Magic = new Spell("Diffuse Magic");
  119.  
  120.     Spell Rushing_Jade_Wind = new Spell("Rushing Jade Wind");
  121.     Spell Invoke_Xuen_the_White_Tiger = new Spell("Invoke Xuen, the White Tiger");
  122.     Spell Chi_Torpedo = new Spell("Chi Torpedo");
  123.  
  124.     Spell Keg_Smash = new Spell("Keg Smash");
  125.     Spell Breath_of_Fire = new Spell("Breath of Fire");
  126.     Spell Guard = new Spell("Guard");
  127.  
  128.     #endregion InitializeSpell
  129.  
  130.     public MonkWW()
  131.     {
  132.         Main.range = 3.6f; // Range
  133.  
  134.         UInt64 lastTarget = 0;
  135.  
  136.         while (Main.loop)
  137.         {
  138.             if (!ObjectManager.Me.IsMounted)
  139.             {
  140.                 Patrolling();
  141.  
  142.                 if (Fight.InFight && ObjectManager.Me.Target > 0)
  143.                 {
  144.                     if (ObjectManager.Me.Target != lastTarget && Provoke.IsDistanceGood)
  145.                     {
  146.                         Pull();
  147.                         lastTarget = ObjectManager.Me.Target;
  148.                     }
  149.  
  150.                     Combat();
  151.                 }
  152.             }
  153.             Thread.Sleep(20);
  154.         }
  155.     }
  156.  
  157.     public void Patrolling()
  158.     {
  159.         if (!ObjectManager.Me.IsMounted)
  160.         {
  161.             Buff();
  162.             Heal();
  163.         }
  164.     }
  165.  
  166.     public void Pull()
  167.     {
  168.         Charges();
  169.     }
  170.  
  171.     public void Combat()
  172.     {
  173.         Charges();
  174.         BuffCombat();
  175.         AvoidMelee();
  176.         Shield();
  177.         Heal();
  178.         TargetMoving();
  179.         Decast();
  180.  
  181.         if (Touch_Of_Death.KnownSpell &&
  182.             Touch_Of_Death.IsSpellUsable &&
  183.             Touch_Of_Death.IsDistanceGood)
  184.         {
  185.             Touch_Of_Death.Launch();
  186.             return;            
  187.         }
  188.  
  189.         //if (Jab.KnownSpell &&
  190.         //    Jab.IsSpellUsable &&
  191.         //    Jab.IsDistanceGood)
  192.         //{
  193.         //    Jab.Launch();
  194.         //    return;
  195.         //}
  196.  
  197.         if (Keg_Smash.KnownSpell &&
  198.             Keg_Smash.IsSpellUsable &&
  199.             Keg_Smash.IsDistanceGood)
  200.         {
  201.             Keg_Smash.Launch();
  202.             return;
  203.         }
  204.         else if (Jab.KnownSpell &&
  205.             Jab.IsSpellUsable &&
  206.             Jab.IsDistanceGood)
  207.         {
  208.             Jab.Launch();
  209.             return;
  210.         }
  211.  
  212.         if (Breath_of_Fire.KnownSpell &&
  213.             Breath_of_Fire.IsSpellUsable &&
  214.             Breath_of_Fire.IsDistanceGood)
  215.         {
  216.             Breath_of_Fire.Launch();
  217.             return;
  218.         }
  219.  
  220.         //if (ObjectManager.GetNumberAttackPlayer() > 2 &&
  221.         //    Leg_Sweep.KnownSpell &&
  222.         //   Leg_Sweep.IsSpellUsable &&
  223.         //    Leg_Sweep.IsDistanceGood)
  224.         //{
  225.         //    Leg_Sweep.Launch();
  226.         //    return;
  227.         //}
  228.  
  229.         if (ObjectManager.GetNumberAttackPlayer() > 2 &&
  230.             Spinning_Crane_Kick.KnownSpell &&
  231.             Spinning_Crane_Kick.IsSpellUsable &&
  232.             Spinning_Crane_Kick.IsDistanceGood)
  233.         {
  234.             Spinning_Crane_Kick.Launch();
  235.             return;
  236.         }
  237.  
  238.         //if (Rising_Sun_Kick.KnownSpell &&
  239.         //    Rising_Sun_Kick.IsSpellUsable &&
  240.         //    Rising_Sun_Kick.IsDistanceGood)
  241.         //{
  242.         //    Rising_Sun_Kick.Launch();
  243.         //    return;
  244.  
  245.         //}
  246.  
  247.         if (Chi_Wave.KnownSpell &&
  248.             Chi_Wave.IsSpellUsable &&
  249.             Chi_Wave.IsDistanceGood)
  250.         {
  251.             Chi_Wave.Launch();
  252.             return;
  253.  
  254.         }
  255.  
  256.         if (Keg_Smash.KnownSpell &&
  257.             Keg_Smash.IsSpellUsable &&
  258.             Keg_Smash.IsDistanceGood)
  259.         {
  260.             Keg_Smash.Launch();
  261.             return;
  262.         }
  263.         else if (Jab.KnownSpell &&
  264.             Jab.IsSpellUsable &&
  265.             Jab.IsDistanceGood)
  266.         {
  267.             Jab.Launch();
  268.             return;
  269.         }
  270.  
  271.         //if (Keg_Smash.KnownSpell &&
  272.         //    Keg_Smash.IsSpellUsable &&
  273.         //    Keg_Smash.IsDistanceGood)
  274.         //{
  275.         //    Keg_Smash.Launch();
  276.         //    return;
  277.         //}
  278.  
  279.         if (Guard.KnownSpell &&
  280.             Guard.IsSpellUsable &&
  281.             Guard.IsDistanceGood)
  282.         {
  283.             Guard.Launch();
  284.             return;
  285.         }
  286.  
  287.         if (Keg_Smash.KnownSpell &&
  288.             Keg_Smash.IsSpellUsable &&
  289.             Keg_Smash.IsDistanceGood)
  290.         {
  291.             Keg_Smash.Launch();
  292.             return;
  293.         }
  294.         else if (Jab.KnownSpell &&
  295.             Jab.IsSpellUsable &&
  296.             Jab.IsDistanceGood)
  297.         {
  298.             Jab.Launch();
  299.             return;
  300.         }
  301.  
  302.         if (Blackout_Kick.KnownSpell &&
  303.             Blackout_Kick.IsSpellUsable &&
  304.             Blackout_Kick.IsDistanceGood)
  305.         {
  306.             Blackout_Kick.Launch();
  307.             return;
  308.  
  309.         }
  310.  
  311.         if (Tiger_Palm.KnownSpell &&
  312.             Tiger_Palm.IsSpellUsable &&
  313.             Tiger_Palm.IsDistanceGood)
  314.         {
  315.             Tiger_Palm.Launch();
  316.             return;
  317.  
  318.         }
  319.  
  320.         if (Keg_Smash.KnownSpell &&
  321.             Keg_Smash.IsSpellUsable &&
  322.             Keg_Smash.IsDistanceGood)
  323.         {
  324.             Keg_Smash.Launch();
  325.             return;
  326.         }
  327.         else if (Jab.KnownSpell &&
  328.             Jab.IsSpellUsable &&
  329.             Jab.IsDistanceGood)
  330.         {
  331.             Jab.Launch();
  332.             return;
  333.         }
  334.  
  335.         //if (Path_of_Blossoms.KnownSpell &&
  336.         //    Path_of_Blossoms.IsSpellUsable &&
  337.         //    Path_of_Blossoms.IsDistanceGood)
  338.         //{
  339.         //    Path_of_Blossoms.Launch();
  340.         //    return;
  341.         //}
  342.  
  343.     }
  344.  
  345.     private void Charges()
  346.     {
  347.         if (Clash.KnownSpell &&
  348.             Clash.IsSpellUsable &&
  349.             Clash.IsDistanceGood)
  350.         {
  351.             Clash.Launch();
  352.             return;
  353.         }
  354.  
  355.         if (Provoke.KnownSpell &&
  356.             Provoke.IsSpellUsable &&
  357.             Provoke.IsDistanceGood)
  358.         {
  359.             Provoke.Launch();
  360.             return;
  361.         }
  362.     }
  363.  
  364.     private void BuffCombat()
  365.     {
  366.         if (Elusive_Brew.KnownSpell && Elusive_Brew.IsSpellUsable)
  367.             Elusive_Brew.Launch();
  368.     }
  369.  
  370.  
  371.     private void Buff()
  372.     {
  373.         if (ObjectManager.Me.IsMounted)
  374.             return;
  375.  
  376.         if (Legacy_of_the_Emperor.KnownSpell && !Legacy_of_the_Emperor.HaveBuff && Legacy_of_the_Emperor.IsSpellUsable)
  377.             Legacy_of_the_Emperor.Launch();
  378.  
  379.     }
  380.  
  381.  
  382.     private void Shield()
  383.     {
  384.         if (ObjectManager.GetNumberAttackPlayer() > 2 && Touch_of_Karma.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent < 50 && Touch_of_Karma.IsSpellUsable)
  385.             Touch_of_Karma.Launch();
  386.  
  387.         if (ObjectManager.GetNumberAttackPlayer() > 2 &&
  388.             Touch_Of_Death.KnownSpell &&
  389.             Touch_Of_Death.IsSpellUsable &&
  390.             Touch_Of_Death.IsDistanceGood)
  391.             Touch_Of_Death.Launch();
  392.  
  393.     }
  394.  
  395.  
  396.     private void Heal()
  397.     {
  398.         if (ObjectManager.Me.IsMounted)
  399.             return;
  400.  
  401.         if (Chi_Wave.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent < 50 && Chi_Wave.IsSpellUsable)
  402.             Chi_Wave.Launch();
  403.  
  404.         if (Expel_Harm.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent < 50 && Expel_Harm.IsSpellUsable)
  405.             Expel_Harm.Launch();
  406.  
  407.         if (Fortifying_Brew.KnownSpell && ObjectManager.Me.HealthPercent > 0 && ObjectManager.Me.HealthPercent < 30 && Fortifying_Brew.IsSpellUsable)
  408.             Fortifying_Brew.Launch();
  409.     }
  410.  
  411.     private void TargetMoving()
  412.     {
  413.  
  414.         if (ObjectManager.Target.GetMove &&
  415.             !Disable.TargetHaveBuff &&
  416.             Disable.KnownSpell &&
  417.             Disable.IsDistanceGood &&
  418.             Disable.IsSpellUsable)
  419.         {
  420.             Disable.Launch();
  421.  
  422.             if (Clash.KnownSpell &&
  423.                 Clash.IsSpellUsable &&
  424.                 Clash.IsDistanceGood)
  425.             {
  426.                 Clash.Launch();
  427.                 return;
  428.             }
  429.  
  430.             else
  431.             {
  432.                 return;
  433.             }
  434.  
  435.         }
  436.  
  437.     }
  438.  
  439.     private void Decast()
  440.     {
  441.          if (ObjectManager.Target.IsCast &&
  442.             Spear_Hand_Strike.KnownSpell &&
  443.             Spear_Hand_Strike.IsDistanceGood &&
  444.             Spear_Hand_Strike.IsSpellUsable)
  445.         {
  446.             Spear_Hand_Strike.Launch();
  447.  
  448.             if (Zen_Meditation.KnownSpell &&
  449.                 Zen_Meditation.IsSpellUsable &&
  450.                 Zen_Meditation.IsDistanceGood)
  451.             {
  452.                 Zen_Meditation.Launch();
  453.                 return;
  454.             }
  455.  
  456.             else
  457.             {
  458.                 return;
  459.             }
  460.  
  461.         }
  462.  
  463.     }
  464.     private void AvoidMelee()
  465.     {
  466.         if (ObjectManager.Target.GetDistance < 1)
  467.             Keyboard.DownKey(nManager.Wow.Memory.WowProcess.MainWindowHandle, "{DOWN}");
  468.     }
  469. }
  470.  
  471. #endregion CustomClass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement