static public bool Cast() { bool casted = false; if (!IsActive) { if (_recastSW.IsRunning && _recastSW.ElapsedMilliseconds < 5000) { return(false); } _recastSW.Reset(); _recastSW.Start(); int waterwalkingSpellID = 0; switch (ObjectManager.Me.Class) { case Styx.Combat.CombatRoutine.WoWClass.Priest: waterwalkingSpellID = 1706; break; case Styx.Combat.CombatRoutine.WoWClass.Shaman: waterwalkingSpellID = 546; break; case Styx.Combat.CombatRoutine.WoWClass.DeathKnight: waterwalkingSpellID = 3714; break; } if (SpellManager.CanCast(waterwalkingSpellID)) { SpellManager.Cast(waterwalkingSpellID); casted = true; } WoWItem waterPot = Util.GetIteminBag(8827); if (waterPot != null && waterPot.Use()) { casted = true; } } if (ObjectManager.Me.IsSwimming) { using (new FrameLock()) { KeyboardManager.AntiAfk(); WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend); } } return(casted); }
public override void Initialize() { try { BotEvents.OnBotStart += BotEvents_OnBotStart; BotEvents.OnBotStop += BotEvents_OnBotStop; WoWItem mainhand = MySettings.MainHand != 0 ? Util.GetIteminBag(MySettings.MainHand) : null; if (mainhand == null) { mainhand = FindMainHand(); } WoWItem offhand = MySettings.OffHand != 0 ? Util.GetIteminBag(MySettings.OffHand) : null; if (((mainhand != null && mainhand.ItemInfo.InventoryType != InventoryType.TwoHandWeapon) || mainhand == null) && offhand == null) { offhand = FindOffhand(); } if (mainhand != null) { Log("Using {0} for mainhand weapon", mainhand.Name); } if (offhand != null) { Log("Using {0} for offhand weapon", offhand.Name); } if (!MySettings.Poolfishing) { if (!string.IsNullOrEmpty(ProfileManager.XmlLocation)) { MySettings.LastLoadedProfile = ProfileManager.XmlLocation; MySettings.Save(); } ProfileManager.LoadEmpty(); } else if (ProfileManager.CurrentProfile == null && !string.IsNullOrEmpty(MySettings.LastLoadedProfile) && File.Exists(MySettings.LastLoadedProfile)) { ProfileManager.LoadNew(MySettings.LastLoadedProfile); } } catch (Exception ex) { Logging.WriteException(ex); } }