Advertisement
Guest User

Water Walking

a guest
Oct 27th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.54 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3. using System.Linq;
  4. using Styx;
  5. using Styx.CommonBot.Routines;
  6. using Styx.CommonBot;
  7. using Styx.Helpers;
  8. using Styx.WoWInternals;
  9. using Styx.WoWInternals.WoWObjects;
  10.  
  11. namespace HighVoltz
  12. {
  13.     public class WaterWalking
  14.     {
  15.         private static readonly Stopwatch _recastSW = new Stopwatch();
  16.  
  17.         private static string[] _waterWalkingAbilities = {"Levitate", "Water Walking", "Path of Frost"};
  18.  
  19.         public static bool CanCast
  20.         {
  21.             get
  22.             {
  23.                 return AutoAngler.Instance.MySettings.UseWaterWalking &&
  24.                        (SpellManager.HasSpell("Levitate") || // priest levitate
  25.                         SpellManager.HasSpell("Water Walking") || // shaman water walking
  26.                         SpellManager.HasSpell("Path of Frost") || // Dk Path of frost
  27.                         SpellManager.HasSpell("Unending Breath") || // Warlock
  28.                         Utils.IsItemInBag(8827) || //isItemInBag(8827);
  29.                         Utils.IsItemInBag(85500)); //FishingRaft
  30.             }
  31.         }
  32.  
  33.  
  34.         public static bool IsActive
  35.         {
  36.             get
  37.             {
  38.                 // DKs have 2 Path of Frost auras. only one can be stored in WoWAuras at any time.
  39.  
  40.                 return StyxWoW.Me.Auras.Values.Any(a => (StyxWoW.Me.HasAura("Levitate") || StyxWoW.Me.HasAura("Water Walking") || StyxWoW.Me.HasAura("Anglers Fishing Raft") || StyxWoW.Me.HasAura("Unending Breath")) && a.TimeLeft >= new TimeSpan(0, 0, 20)) ||
  41.                        StyxWoW.Me.HasAura("Path of Frost");
  42.             }
  43.         }
  44.  
  45.         public static bool Cast()
  46.         {
  47.             bool casted = false;
  48.             if (!IsActive)
  49.             {
  50.                 if (_recastSW.IsRunning && _recastSW.ElapsedMilliseconds < 5000)
  51.                     return false;
  52.                 _recastSW.Reset();
  53.                 _recastSW.Start();
  54.                 int waterwalkingSpellID = 0;
  55.                 switch (StyxWoW.Me.Class)
  56.                 {
  57.                     case WoWClass.Priest:
  58.                         waterwalkingSpellID = 1706;
  59.                         break;
  60.                     case WoWClass.Shaman:
  61.                         waterwalkingSpellID = 546;
  62.                         break;
  63.                     case WoWClass.DeathKnight:
  64.                         waterwalkingSpellID = 3714;
  65.                         break;
  66.                     case WoWClass.Warlock:
  67.                         waterwalkingSpellID = 5697; // unending breath
  68.                         break;
  69.                 }
  70.                 if (SpellManager.CanCast(waterwalkingSpellID))
  71.                 {
  72.                     // if a warlock cast soulburn, then unending breath
  73.                     if (StyxWoW.Me.Class == WoWClass.Warlock)
  74.                     {
  75.                         SpellManager.Cast(74434);
  76.                     }
  77.                     SpellManager.Cast(waterwalkingSpellID);
  78.                     casted = true;
  79.                 }
  80.                 WoWItem waterPot = Utils.GetIteminBag(8827);
  81.                 WoWItem fishingRaft = Utils.GetIteminBag(85500);
  82.                 if (fishingRaft != null && fishingRaft.Use())
  83.                 {
  84.                     casted = true;
  85.                 }
  86.                 if (waterPot != null && waterPot.Use())
  87.                 {
  88.                     casted = true;
  89.                 }
  90.             }
  91.             if (StyxWoW.Me.IsSwimming)
  92.             {
  93.                 using (StyxWoW.Memory.AcquireFrame())
  94.                 {
  95.                     KeyboardManager.AntiAfk();
  96.                     WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend);
  97.                 }
  98.             }
  99.             return casted;
  100.         }
  101.     }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement