Advertisement
Guest User

Untitled

a guest
Oct 8th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.04 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.         public static bool CanCast
  18.         {
  19.             get
  20.             {
  21.                 return AutoAngler.Instance.MySettings.UseWaterWalking &&
  22.                        (SpellManager.HasSpell(1706) || // priest levitate
  23.                         SpellManager.HasSpell(546) || // shaman water walking
  24.                         SpellManager.HasSpell(3714) || // Dk Path of frost
  25.                         Utils.IsItemInBag(8827) || // Elixir of Water Walking
  26.                         Utils.IsItemInBag(85500)); // Anglers Raft
  27.             }
  28.         }
  29.  
  30.         public static bool IsActive
  31.         {
  32.             get
  33.             {
  34.                 // DKs have 2 Path of Frost auras. only one can be stored in WoWAuras at any time.
  35.                 return StyxWoW.Me.Auras.Values.
  36.                            Count(a => (a.SpellId == 11319 || a.SpellId == 1706 || a.SpellId == 546 || a.SpellId == 124036) &&
  37.                                       a.TimeLeft >= new TimeSpan(0, 0, 20)) > 0 ||
  38.                        StyxWoW.Me.HasAura("Path of Frost");
  39.             }
  40.         }
  41.  
  42.         public static bool Cast()
  43.         {
  44.             bool casted = false;
  45.             if (!IsActive)
  46.             {
  47.                 if (_recastSW.IsRunning && _recastSW.ElapsedMilliseconds < 5000)
  48.                     return false;
  49.                 _recastSW.Reset();
  50.                 _recastSW.Start();
  51.                 int waterwalkingSpellID = 0;
  52.                 switch (StyxWoW.Me.Class)
  53.                 {
  54.                     case WoWClass.Priest:
  55.                         waterwalkingSpellID = 1706;
  56.                         break;
  57.                     case WoWClass.Shaman:
  58.                         waterwalkingSpellID = 546;
  59.                         break;
  60.                     case WoWClass.DeathKnight:
  61.                         waterwalkingSpellID = 3714;
  62.                         break;
  63.                 }
  64.                 if (SpellManager.CanCast(waterwalkingSpellID))
  65.                 {
  66.                     SpellManager.Cast(waterwalkingSpellID);
  67.                     casted = true;
  68.                 }
  69.                 WoWItem waterPot = Utils.GetIteminBag(8827);
  70.                 if (waterPot != null && waterPot.Use())
  71.                 {
  72.                     casted = true;
  73.                 }
  74.                 WoWItem raft = Utils.GetIteminBag(85500);
  75.                 if (raft != null && raft.Use())
  76.                 {
  77.                     casted = true;
  78.                 }
  79.             }
  80.             if (StyxWoW.Me.IsSwimming)
  81.             {
  82.                 using (StyxWoW.Memory.AcquireFrame())
  83.                 {
  84.                     KeyboardManager.AntiAfk();
  85.                     WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend);
  86.                 }
  87.             }
  88.             return casted;
  89.         }
  90.     }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement