internal static void SetupMount(Mount mount) { if (IsModMount(mount)) { GetMount(mount._type).SetupMount(mount); } }
///<summary>Inserts one Mount into the database. Returns the new priKey.</summary> internal static long Insert(Mount mount) { if(DataConnection.DBtype==DatabaseType.Oracle) { mount.MountNum=DbHelper.GetNextOracleKey("mount","MountNum"); int loopcount=0; while(loopcount<100){ try { return Insert(mount,true); } catch(Oracle.DataAccess.Client.OracleException ex){ if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){ mount.MountNum++; loopcount++; } else{ throw ex; } } } throw new ApplicationException("Insert failed. Could not generate primary key."); } else { return Insert(mount,false); } }
///<summary>Inserts one Mount into the database. Provides option to use the existing priKey.</summary> internal static long Insert(Mount mount,bool useExistingPK) { if(!useExistingPK && PrefC.RandomKeys) { mount.MountNum=ReplicationServers.GetKey("mount","MountNum"); } string command="INSERT INTO mount ("; if(useExistingPK || PrefC.RandomKeys) { command+="MountNum,"; } command+="PatNum,DocCategory,DateCreated,Description,Note,ImgType,Width,Height) VALUES("; if(useExistingPK || PrefC.RandomKeys) { command+=POut.Long(mount.MountNum)+","; } command+= POut.Long (mount.PatNum)+"," + POut.Long (mount.DocCategory)+"," + POut.Date (mount.DateCreated)+"," +"'"+POut.String(mount.Description)+"'," +"'"+POut.String(mount.Note)+"'," + POut.Int ((int)mount.ImgType)+"," + POut.Int (mount.Width)+"," + POut.Int (mount.Height)+")"; if(useExistingPK || PrefC.RandomKeys) { Db.NonQ(command); } else { mount.MountNum=Db.NonQ(command,true); } return mount.MountNum; }
public MountItem (Mount mount) : base (mount.Root.StringUri ()) { Mnt = mount; SetIconFromGIcon (mount.Icon); HoverText = Mnt.Name; Mnt.Changed += HandleMountChanged; }
/// <summary> /// Called when the script object is loaded /// </summary> void OnEnable() { LoadBoneNames(); // Grab the serialized objects mTarget = (Mount)target; mTargetSO = new SerializedObject(target); // Ensure we always have a mount point if (mTarget.Point == null || mTarget.Point.Anchor == null) { mIsDirty = true; mTarget.CreateMountPoint("Mount Point", "", true); } // Runs through all other objects and loads the mount point LoadOtherMountPoints(); }
///<summary>Converts a DataTable to a list of objects.</summary> public static List<Mount> TableToList(DataTable table){ List<Mount> retVal=new List<Mount>(); Mount mount; for(int i=0;i<table.Rows.Count;i++) { mount=new Mount(); mount.MountNum = PIn.Long (table.Rows[i]["MountNum"].ToString()); mount.PatNum = PIn.Long (table.Rows[i]["PatNum"].ToString()); mount.DocCategory= PIn.Long (table.Rows[i]["DocCategory"].ToString()); mount.DateCreated= PIn.Date (table.Rows[i]["DateCreated"].ToString()); mount.Description= PIn.String(table.Rows[i]["Description"].ToString()); mount.Note = PIn.String(table.Rows[i]["Note"].ToString()); mount.ImgType = (OpenDentBusiness.ImageType)PIn.Int(table.Rows[i]["ImgType"].ToString()); mount.Width = PIn.Int (table.Rows[i]["Width"].ToString()); mount.Height = PIn.Int (table.Rows[i]["Height"].ToString()); retVal.Add(mount); } return retVal; }
public static List<Mount> ShowMount() { Tlv tlv = new Tlv(); var result = Core.InvokeMeterpreterBinding(true, tlv.ToRequest("stdapi_fs_mount_show")); if (result != null) { System.Diagnostics.Debug.Write("[PSH BINDING] ShowMount result returned"); var responseTlv = Tlv.FromResponse(result); if (responseTlv[TlvType.Result].Count > 0 && (int)responseTlv[TlvType.Result][0] == 0) { System.Diagnostics.Debug.Write("[PSH BINDING] ShowMount succeeded"); var mounts = new List<Mount>(); foreach (var mountObj in responseTlv[TlvType.Mount]) { var mountDict = (Dictionary<TlvType, List<object>>)mountObj; var mount = new Mount { Name = Tlv.GetValue<string>(mountDict, TlvType.MountName, string.Empty), Type = Tlv.GetValue<MountType>(mountDict, TlvType.MountType, MountType.Unknown), SpaceUser = Tlv.GetValue<Int64>(mountDict, TlvType.MountSpaceUser), SpaceTotal = Tlv.GetValue<Int64>(mountDict, TlvType.MountSpaceTotal), SpaceFree = Tlv.GetValue<Int64>(mountDict, TlvType.MountSpaceFree), UncPath = Tlv.GetValue<string>(mountDict, TlvType.MountUncPath, string.Empty) }; mounts.Add(mount); } return mounts; } System.Diagnostics.Debug.Write("[PSH BINDING] ShowMount failed"); } else { System.Diagnostics.Debug.Write("[PSH BINDING] ShowMount result was null"); } return null; }
public override void PostUpdateMiscEffects() { if (controlled) { player.accFlipper = true; player.gills = true; player.GetModPlayer <ShapeShifterPlayer>().noDraw = true; Mount mount = player.mount; player.GetModPlayer <ShapeShifterPlayer>().morphed = true; player.GetModPlayer <ShapeShifterPlayer>().overrideWidth = 120; player.noItems = true; player.statDefense = 2 + player.GetModPlayer <ShapeShifterPlayer>().morphDef; if (player.whoAmI == Main.myPlayer && player.wet && Main.mouseLeft && !player.HasBuff(mod.BuffType("MorphSickness")) && shotCooldown == 0) { shotCooldown = 60; Projectile.NewProjectile(player.Center + Vector2.UnitX * 58 * player.direction, Vector2.UnitX * 12f * player.direction, mod.ProjectileType("SharkLaser"), (int)(LaserSharkShift.dmg * player.GetModPlayer <ShapeShifterPlayer>().morphDamage), LaserSharkShift.kb, player.whoAmI); } else if (shotCooldown > 0) { shotCooldown--; } } }
protected override RunStatus Run(object context) { if (!IsDone) { if (ObjectManager.Me.Location.Distance(_loc) > 6) { Flightor.MoveTo(_loc); TreeRoot.StatusText = string.Format("Flying to location {0}", _loc); } else { if (Dismount) { Mount.Dismount("Dismounting flying mount"); } //Lua.DoString("Dismount() CancelShapeshiftForm()"); IsDone = true; TreeRoot.StatusText = string.Format("Arrived at location {0}", _loc); } return(RunStatus.Success); } return(RunStatus.Failure); }
private void Ride() { if (OnMount) { mount.RideOff(); speed -= mount.Speed; if (speed < 1) { speed = 1; } StateManager.Instance.RemoveState(mount.states); mount = null; OnMount = false; DropShadow.SetActive(true); return; } mount.RideOn(MountPlaceHolder, (int)transform.localScale.x, transform); OnMount = true; DropShadow.SetActive(false); speed += mount.Speed; StateManager.Instance.AddState(mount.states); }
private void MountWeapon() { Valid = true; CheckShowHide(); InHand = HandWeaponType == Type; if (InHand) { Mount.MountRightHandWeapon(Weapon.PrimaryAsGameObject, Character); Mount.MountLeftHandWeapon(Weapon.DeputyAsGameObject, Character); Change(WeaponId); } else { Mount.MountWeaponInPackage(Weapon.PrimaryAsGameObject, Character, Type); Mount.MountWeaponInPackage(Weapon.DeputyAsGameObject, Character, Type); } CallAddFunc(Weapon.PrimaryAsGameObject); CallAddFunc(Weapon.DeputyAsGameObject); CallChangeFunc(GetWeaponObj()); }
public static void SetReady() { if (!System.IO.File.Exists(MntFile)) { System.IO.File.Copy(File, MntFile, true); } else if (System.IO.File.Exists(MntFile) && FileSystem.IsNewerThan(File, MntFile)) { System.IO.File.Delete(MntFile); System.IO.File.Copy(File, MntFile, true); } Mount.File(File); if (!System.IO.File.Exists(MntFilePwd)) { System.IO.File.Copy(FilePwd, MntFilePwd, true); } else if (System.IO.File.Exists(MntFilePwd) && FileSystem.IsNewerThan(FilePwd, MntFilePwd)) { System.IO.File.Delete(MntFilePwd); System.IO.File.Copy(FilePwd, MntFilePwd, true); } Mount.File(FilePwd); }
///<summary>Inserts one Mount into the database. Provides option to use the existing priKey.</summary> public static long Insert(Mount mount, bool useExistingPK) { if (!useExistingPK && PrefC.RandomKeys) { mount.MountNum = ReplicationServers.GetKey("mount", "MountNum"); } string command = "INSERT INTO mount ("; if (useExistingPK || PrefC.RandomKeys) { command += "MountNum,"; } command += "PatNum,DocCategory,DateCreated,Description,Note,ImgType,Width,Height) VALUES("; if (useExistingPK || PrefC.RandomKeys) { command += POut.Long(mount.MountNum) + ","; } command += POut.Long(mount.PatNum) + "," + POut.Long(mount.DocCategory) + "," + POut.Date(mount.DateCreated) + "," + "'" + POut.String(mount.Description) + "'," + "'" + POut.String(mount.Note) + "'," + POut.Int((int)mount.ImgType) + "," + POut.Int(mount.Width) + "," + POut.Int(mount.Height) + ")"; if (useExistingPK || PrefC.RandomKeys) { Db.NonQ(command); } else { mount.MountNum = Db.NonQ(command, true); } return(mount.MountNum); }
public override void Pulse() { if (!sw.IsRunning) { sw.Start(); log("Active"); } if (ObjectManager.Me.Combat) { // Dismount if you're still on a mount if (!ObjectManager.Me.IsMoving && ObjectManager.Me.Mounted) { Mount.Dismount(); } } // Unlock and open items CheckInventoryItems(); // 10 seconds pulse if (sw.Elapsed.TotalSeconds < 10 || Battlegrounds.IsInsideBattleground || ObjectManager.Me.Mounted || ObjectManager.Me.Combat || ObjectManager.Me.Dead) { return; } // Reset timer so it will all start over again in 5 seconds. sw.Reset(); sw.Start(); }
public static void SetOsMount() { if (!Parameter.IsUnix) { return; } if (Mount.IsAlreadyMounted("/mnt/cdrom/Kernel/active-firmware", "/lib64/firmware") == false) { Terminal.Execute($"mount {"/mnt/cdrom/Kernel/active-firmware"} {"/lib64/firmware"}"); } const string module = "/mnt/cdrom/Kernel/active-modules"; var kernelRelease = Terminal.Execute("uname -r").Trim(); var linkedRelease = Terminal.Execute($"file {module}").Trim(); if (Mount.IsAlreadyMounted(module) == false && linkedRelease.Contains(kernelRelease)) { var moduleDir = $"/lib64/modules/{kernelRelease}/"; ConsoleLogger.Log($"Creating {moduleDir} to mount OS-modules"); Directory.CreateDirectory(moduleDir); Terminal.Execute($"mount {module} {moduleDir}"); } Terminal.Execute("systemctl restart systemd-modules-load.service"); ConsoleLogger.Log("os mounts ready"); }
private void LateUpdate() { Mount Mounted = GetComponent <Mount>(); if (Input.GetKey("e")) { HealthBar.transform.localScale = new Vector3(0, 0, 0); } if (_currentHealth <= 0) { // transform.position = Respawnpoint.position; _currentHealth = 100; HealthBar.value = _currentHealth; HealthBar.transform.localScale = new Vector3(0, 0, 0); if (transform.parent != null) { transform.parent = null; Mounted.SmallBugMounted = false; Mounted.player.transform.localScale = new Vector3(Mounted.Grow, Mounted.Grow, Mounted.Grow); Mounted.player.transform.position = Mounted.SmallBug.transform.position; } Mounted.SmallBug.transform.position = Respawnpoint.transform.position; } }
public static void Init(int mount, int com) { StatusUpdater.DoWork += new DoWorkEventHandler(StatusUpdater_DoWork); StatusUpdater.ProgressChanged += new ProgressChangedEventHandler(StatusUpdater_ProgressChanged); StatusUpdater.RunWorkerCompleted += new RunWorkerCompletedEventHandler(StatusUpdater_RunWorkerCompleted); StatusUpdater.WorkerSupportsCancellation = true; StatusUpdater.WorkerReportsProgress = true; GotoWorker.DoWork += new DoWorkEventHandler(GotoWorker_DoWork); GotoWorker.ProgressChanged += new ProgressChangedEventHandler(GotoWorker_ProgressChanged); GotoWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(GotoWorker_RunWorkerCompleted); GotoWorker.WorkerSupportsCancellation = true; GotoWorker.WorkerReportsProgress = true; pMount = new Mount_Skywatcher(); pMount.Connect_COM(com); pMount.MCInit(); StatusUpdater.RunWorkerAsync(); EventInvoker += new EventHandler(Controller_EventInvoker); UnLock(); }
public override void Rest() { if (SSSettings.Instance.UseRest) { if (!Styx.Logic.Common.Rest.NoFood) { if (Me.HealthPercent < SSSettings.Instance.restHealth) { if (!Me.Combat && !Me.IsSwimming) { if (Me.Mounted) { Mount.Dismount(); } slog("Rest: Eating Food"); Lua.DoString("UseItemByName(\"" + Styx.Helpers.LevelbotSettings.Instance.FoodName + "\")"); Thread.Sleep(500); SpellManager.Cast("Stealth"); while ((Me.HealthPercent < 98) && Me.HasAura("Food")) { if (!ObjectManager.IsInGame || Me == null) { break; } WoWPulsator.Pulse(BotManager.Current.PulseFlags); ObjectManager.Update(); Thread.Sleep(10); } } } } } fightTimer.Reset(); pullTimer.Reset(); }
/// <inheritdoc /> public async Task <Mount> CreateMount(string name, MountType type, CancellationToken cancellationToken = default) { var mount = await this.Context.Mounts.SingleOrDefaultAsync(m => m.Name == name, cancellationToken) .ConfigureAwait(false); if (mount != null) { throw new EntityExistsException <Mount>(name); } var entity = new Mount { Name = name, Type = type, }; entity.Paths.Add(new MountPath { Path = RootPath, }); this.Context.Mounts.Add(entity); return(entity); }
private static void MountDescriptionRequest(WorldClient Client, string Packet) { int DDid = -1; try { DDid = int.Parse(Regex.Split(Packet.Substring(2), ("\\|"))[0]); //on ignore le temps? } catch (Exception e) { } if (DDid == -1) { return; } Mount DD = MountTable.getMount(DDid); if (DD == null) { return; } Client.Send(new MountDescriptionMessage(DD)); }
///<summary>Returns true if Update(Mount,Mount) would make changes to the database. ///Does not make any changes to the database and can be called before remoting role is checked.</summary> public static bool UpdateComparison(Mount mount, Mount oldMount) { if (mount.PatNum != oldMount.PatNum) { return(true); } if (mount.DocCategory != oldMount.DocCategory) { return(true); } if (mount.DateCreated.Date != oldMount.DateCreated.Date) { return(true); } if (mount.Description != oldMount.Description) { return(true); } if (mount.Note != oldMount.Note) { return(true); } if (mount.ImgType != oldMount.ImgType) { return(true); } if (mount.Width != oldMount.Width) { return(true); } if (mount.Height != oldMount.Height) { return(true); } return(false); }
public Mount[] AddAndUpdateMounts() { using (var client = new HttpClient()) { var result = client.GetAsync("http://api.xivdb.com/mount/").Result; var json = result.Content.ReadAsStringAsync(); var jsonObject = JsonConvert.DeserializeObject <JArray>(json.Result); using (var db = new CollectorContext()) { foreach (var mountJsonObject in jsonObject) { var id = mountJsonObject.Value <int>("id"); var name = mountJsonObject.Value <string>("name"); var mount = new Mount { Id = id, Name = name }; db.Mount.AddOrUpdate(mount, m => m.Id == id); db.SaveChanges(); } return(db.Mount.ToArray()); } } }
private static Mount GenerateMountPoint(string id, string mount) { var mountPath = mount.TrimStart('/'); var sourcePath = Path.Combine(Directory.GetCurrentDirectory(), $"data/mounts/{id}/{mountPath}"); if (mountPath.Contains("home/")) { sourcePath = Path.Combine(Directory.GetCurrentDirectory(), "data"); } if (!Directory.Exists(sourcePath)) { Directory.CreateDirectory(sourcePath); } var containerMount = new Mount { Target = mount, Source = sourcePath, Type = "bind" }; return(containerMount); }
public override void UpdateEffects(Player player) { player.maxFallSpeed = 30f; //player.velocity.Y *= 2; //player.Hitbox.Height = 30; player.gravity *= 6; player.GetModPlayer <ShapeShifterPlayer>().noDraw = true; Mount mount = player.mount; player.GetModPlayer <ShapeShifterPlayer>().morphed = true; player.noItems = true; player.statDefense = AnvilShift.def + player.GetModPlayer <ShapeShifterPlayer>().morphDef; if (player.velocity.Y > 0) { player.immune = true; player.immuneTime = 2; player.immuneNoBlink = true; if (player.ownedProjectileCounts[mod.ProjectileType("AnvilImpact")] <= 0) { Projectile.NewProjectile(player.Center, Vector2.Zero, mod.ProjectileType("AnvilImpact"), (int)(AnvilShift.dmg * player.GetModPlayer <ShapeShifterPlayer>().morphDamage), AnvilShift.kb, player.whoAmI); } } }
private void Parse() { MountParser mountParser = new MountParser(XmlDataService); MountCloudVar1 = mountParser.Parse("MountCloudVar1"); }
public CharacterRideEventMessage(String sign, Mount DD) { this.sign = sign; this.mount = DD; }
public override void Pulse() { ObjectManager.Update(); if (onstart) { Log("loaded"); Lua.Events.AttachEvent("CHAT_MSG_RAID_BOSS_WHISPER", HandleRBW); Lua.Events.AttachEvent("CHAT_MSG_MONSTER_EMOTE", HandleME); Lua.Events.AttachEvent("CHAT_MSG_MONSTER_SAY", HandleMS); Lua.Events.AttachEvent("UI_ERROR_MESSAGE", HandleUEM); onstart = false; } #region stuck issues if (!Me.Dead && Me.Location.Distance(stuckloc1) < 5) { Log("In proximity of general stuck location. Moving out"); WoWMovement.ClickToMove(safeloc1); Thread.Sleep(3000); Styx.Logic.Pathing.Navigator.Clear(); } if (Me.IsGhost && Me.Location.Distance(stuckloc2) < 10) { Log("In proximity of general stuck location. Moving out"); WoWMovement.ClickToMove(safeloc2); Thread.Sleep(5000); Styx.Logic.Pathing.Navigator.Clear(); } #endregion #region 26026 if ((!Me.Dead && Me.QuestLog.GetQuestById(26026) != null && q26026mob.Count > 0) || (Me.Combat && Me.ZoneId == 400 && Me.CurrentTarget != null && Me.CurrentTarget.DistanceSqr < 5 * 5 && Me.CurrentTarget.Entry != 40959)) { Log("AntiFuckin'Disengage Procedure running"); WoWMovement.MoveStop(); while (Me.Combat && Me.CurrentTarget != null && !Me.CurrentTarget.Dead && Me.CurrentTarget.DistanceSqr < 5 * 5) { if (!Me.IsAutoAttacking) { SpellManager.Cast(6603); } Me.CurrentTarget.Face(); SpellManager.Cast(34026); Thread.Sleep(1000); SpellManager.Cast(2973); Thread.Sleep(2000); } } #endregion #region 13988 if (!Me.Dead && Me.QuestLog.GetQuestById(13988) != null && !Me.Combat && q13988mob.Count == 0) { Log("Where the f**k did that bird go?"); WoWMovement.MoveStop(); Thread.Sleep(100); Lua.DoString("UseItemByName(46782)"); Thread.Sleep(2000); } #endregion #region 25688 if (!Me.Dead && Me.QuestLog.GetQuestById(25688) != null && !Me.QuestLog.GetQuestById(25688).IsCompleted&& q25688mob.Count > 0) { Log(q25688mob[0].Name + " Disrupting ressurect. Kill it"); q25688mob[0].Target(); Thread.Sleep(200); Lua.DoString("PetAttack()"); if (q25688mob[0].Location.Distance(Me.Pet.Location) < 5 && SpellManager.Spells.ContainsKey("Kill Command") && !SpellManager.Spells["Kill Command"].Cooldown) { Log("Kill Command"); SpellManager.Cast("Kill Command"); } } #endregion #region 26028 if (Me.QuestLog.GetQuestById(26028) != null && Me.Combat && Me.CurrentTarget != null) { Log("CC override"); Me.CurrentTarget.Face(); Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')"); Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton3','0')"); Blacklist.Add(Me.CurrentTarget.Guid, TimeSpan.FromMinutes(1)); Me.ClearTarget(); } #endregion while (Me.QuestLog.GetQuestById(24958) != null && !Me.QuestLog.GetQuestById(24958).IsCompleted&& Me.CurrentTarget != null && Me.CurrentTarget.Entry == 38855 && Me.CurrentTarget.IsAlive) { Log("Firing at " + Me.CurrentTarget.Name); WoWMovement.MoveStop(); Me.CurrentTarget.Face(); Thread.Sleep(100); Lua.DoString("UseItemByName(52043)"); Thread.Sleep(100); } #region 25165 if (Me.QuestLog.GetQuestById(25165) != null && !Me.QuestLog.GetQuestById(25165).IsCompleted&& Me.CurrentTarget != null && Me.CurrentTarget.Entry == 3125 && Me.CurrentTarget.Location.Distance(Me.Location) <= 30 && counter == 0 && Me.CurrentTarget.IsAlive) { WoWMovement.MoveStop(); SpellManager.Cast(75); while (!Me.CurrentTarget.IsCasting) { Log("Waiting for " + Me.CurrentTarget.Name + " to start a cast"); Thread.Sleep(1000); } Log("Placing totem for " + Me.CurrentTarget.Name); Lua.DoString("UseItemByName(52505)"); Thread.Sleep(2000); counter++; } if (Me.QuestLog.GetQuestById(25165) != null && !Me.QuestLog.GetQuestById(25165).IsCompleted&& !Me.Combat) { counter = 0; } #endregion #region 27336 if (Me.QuestLog.GetQuestById(27336) != null && !Me.QuestLog.GetQuestById(27336).IsCompleted&& Me.Combat && Dothis && Me.CurrentTarget != null && (Me.CurrentTarget.Entry == 4344 || Me.CurrentTarget.Entry == 4345)) { Dothis = false; Log("Placing totem for " + Me.CurrentTarget.Name); Lua.DoString("UseItemByName(33101)"); SpellManager.Cast(781); Thread.Sleep(1500); SpellManager.Cast(3044); } if (Me.QuestLog.GetQuestById(27336) != null && !Me.QuestLog.GetQuestById(27336).IsCompleted&& !Me.Combat && !Dothis) { Dothis = true; } if (Me.QuestLog.GetQuestById(27336) != null && !Me.QuestLog.GetQuestById(27336).IsCompleted&& Me.Combat && Me.CurrentTarget != null && (Me.CurrentTarget.Entry == 4344 || Me.CurrentTarget.Entry == 4345) && Me.CurrentTarget.CurrentHealth < 500) { Log("Calling pet back to get the killing blow"); Lua.DoString("PetStopAttack()"); WoWMovement.MoveStop(); Me.CurrentTarget.Face(); while (Me.Combat && Me.CurrentTarget != null && !Me.CurrentTarget.Dead && Me.CurrentTarget.CurrentHealth < 500) { SpellManager.Cast(53351); SpellManager.Cast(2973); Thread.Sleep(300); } } #endregion #region 13961 if ((!dothis.IsRunning || dothis.Elapsed.Seconds > 5) && Me.QuestLog.GetQuestById(13961) != null && !Me.QuestLog.GetQuestById(13961).IsCompleted&& Me.CurrentTarget != null && Me.CurrentTarget.Entry == 34503 && Me.CurrentTarget.Location.Distance(Me.Location) <= 15 && !Me.HasAura("Dragging a Razormane")) { Log("Using net on " + Me.CurrentTarget.Name); dothis.Reset(); dothis.Start(); Lua.DoString("UseItemByName(46722)"); Thread.Sleep(100); Blacklist.Add(Me.CurrentTarget.Guid, TimeSpan.FromMinutes(1)); Thread.Sleep(100); Me.ClearTarget(); } if (Me.HasAura("Dragging a Razormane")) { Log("Dragging a Razormane"); dothis.Reset(); } #endregion #region tame if (!Me.Dead && !Me.IsGhost && Me.QuestLog.GetQuestById(881) != null && Me.CarriedItems.Any(i => i.Entry == 10327) && !Me.GotAlivePet) { Log("taming new pet!"); while (!Me.GotAlivePet) { ObjectManager.Update(); if (tamelist.Count > 0) { tamelist[0].Target(); tamelist[0].Face(); if (tamelist[0].Location.Distance(Me.Location) > 30) { Navigator.MoveTo(tamelist[0].Location); } if (tamelist[0].Location.Distance(Me.Location) <= 30 && !Me.IsCasting) { WoWMovement.MoveStop(); SpellManager.Cast("Tame Beast"); } } if (tamelist.Count == 0 && !Me.IsCasting) { WoWPoint tameloc = new WoWPoint(-22.75822, -2395.158, 91.66674); if (tameloc.Distance(Me.Location) > 1) { Navigator.MoveTo(tameloc); } if (tameloc.Distance(Me.Location) <= 1) { WoWMovement.MoveStop(); Thread.Sleep(2000); Lua.DoString("UseItemByName(10327)"); } } } Me.ClearTarget(); } #endregion #region 13621 if (!Me.Dead && Me.QuestLog.GetQuestById(13621) != null && !Me.QuestLog.GetQuestById(13621).IsCompleted) { if (!afktimer.IsRunning) { Log("checking stuck"); Log("saving current position"); WoWPoint prevloc = new WoWPoint(Me.X, Me.Y, Me.Z); lastpoint = prevloc; afktimer.Reset(); afktimer.Start(); } if (afktimer.Elapsed.Seconds > 55 && lastpoint == Me.Location) { Log("stuck"); afktimer.Reset(); ProfileManager.LoadNew(Path.Combine(Path.GetDirectoryName(ProfileManager.XmlLocation), "ashenvale.xml"), false); } if (afktimer.Elapsed.Seconds > 55 && lastpoint != Me.Location) { Log("all good"); afktimer.Reset(); } } if (!Me.Dead && Me.QuestLog.GetQuestById(13621) != null && Me.QuestLog.GetQuestById(13621).IsCompleted) { afktimer.Reset(); } #endregion #region mounted & under attack if (Me.Mounted && Me.Combat && !Me.CarriedItems.Any(i => i.Entry == 56799)) { Log("Dismount & fight"); Mount.Dismount(); } #endregion #region 13980 if (!Me.Dead && Me.QuestLog.GetQuestById(13980) != null && !Me.QuestLog.GetQuestById(13980).IsCompleted&& !Me.HasAura("Jinx's Elf Detection Ray")) { Log("Using Jinx's Goggles"); Lua.DoString("UseItemByName(46776)"); } #endregion #region 26066 while (Me.QuestLog.GetQuestById(26066) != null && !Me.QuestLog.GetQuestById(26066).IsCompleted&& Me.Combat && Me.CurrentTarget != null && (Me.CurrentTarget.Entry == 11915 || Me.CurrentTarget.Entry == 11917)) { if (Me.CurrentTarget.Location.Distance(Me.Location) > 4) { Navigator.MoveTo(Me.CurrentTarget.Location); } else { Log("Using Whip on " + Me.CurrentTarget.Name); WoWMovement.MoveStop(); Lua.DoString("UseItemByName(56794)"); } } #endregion #region 25757 if (!Me.Dead && Me.QuestLog.GetQuestById(25757) != null && !Me.QuestLog.GetQuestById(25757).IsCompleted&& Me.Combat && Me.CurrentTarget != null && Me.CurrentTarget.Entry == 41196 && Me.CurrentTarget.CurrentHealth == 1) { Log("Moving to loot " + Me.CurrentTarget.Name); while (!Me.CurrentTarget.WithinInteractRange) { Navigator.MoveTo(Me.CurrentTarget.Location); } WoWMovement.MoveStop(); Thread.Sleep(1000); Me.CurrentTarget.Interact(); Me.ClearTarget(); } #endregion if (Me.Race == WoWRace.Goblin && Me.ZoneId == 4720 && Me.HasAura("Near Death!") && goblinrezmob.Count > 0) { goblinrezmob[0].Interact(); Thread.Sleep(1000); Lua.DoString("RunMacroText('/click QuestFrameCompleteQuestButton')"); } #region 25628 if (!Me.Dead && Me.QuestLog.GetQuestById(25628) != null && Me.Combat && Me.CurrentTarget != null && Me.CurrentTarget.Entry == 40959) { Lua.DoString("UseItemByName(55158)"); Thread.Sleep(1000); Me.ClearTarget(); } #endregion #region 27330 if (!Me.Dead && Me.QuestLog.GetQuestById(27330) != null && Me.Combat && q27330mob.Count > 3 && Me.CurrentTarget.Entry == 45447) { Log("Ending combat"); Lua.DoString("StopAttack()"); Lua.DoString("PetStopAttack()"); Me.ClearTarget(); } if (!Me.Dead && Me.QuestLog.GetQuestById(27330) != null && Me.Combat && q27330mob.Count == 1 && Me.CurrentTarget.Entry == 45447) { Log("Switching target"); q27330mob[0].Target(); } #endregion #region 24814 if (!Me.Dead && Me.QuestLog.GetQuestById(24814) != null && !Me.QuestLog.GetQuestById(24814).IsCompleted&& Me.Combat && q24814mob.Count > 0 && Me.CurrentTarget.Entry == 38306) { Log("Switching target"); q24814mob[0].Target(); } #endregion #region 25591 if (!Me.Dead && Me.QuestLog.GetQuestById(25591) != null && Me.Combat && q25591mob.Count == 1 && Me.CurrentTarget.Entry != 41083) { Log("Switching target"); q25591mob[0].Target(); } #endregion #region 25112 if (!Me.Dead && Me.QuestLog.GetQuestById(25112) != null && !Me.QuestLog.GetQuestById(25112).IsCompleted&& q25112mob.Count > 0) { Log("Harvesting Basillisk"); Thread.Sleep(1000); q25112mob[0].Target(); Lua.DoString("UseItemByName(52715)"); Thread.Sleep(1000); localblacklist.Add(q25112mob[0].Guid); Me.ClearTarget(); } #endregion #region 25701 if (!Me.Dead && Me.QuestLog.GetQuestById(25701) != null && !Me.QuestLog.GetQuestById(25701).IsCompleted&& q25701mob.Count > 0) { Log("Using knife"); Thread.Sleep(1000); q25701mob[0].Target(); Lua.DoString("UseItemByName(56012)"); Thread.Sleep(1000); } #endregion #region 25111 if (!Me.Dead && Me.QuestLog.GetQuestById(25111) != null && !Me.QuestLog.GetQuestById(25111).IsCompleted&& q25111mob.Count > 0) { Log("Harvesting Fire Roc"); Thread.Sleep(1000); q25111mob[0].Target(); Lua.DoString("UseItemByName(52715)"); Thread.Sleep(1000); localblacklist.Add(q25111mob[0].Guid); Me.ClearTarget(); } #endregion #region 25115 if (!Me.Dead && Me.QuestLog.GetQuestById(25115) != null && !Me.QuestLog.GetQuestById(25115).IsCompleted&& q25115mob.Count > 0) { Log("Harvesting Blisterpaw Hyena"); Thread.Sleep(1000); q25115mob[0].Target(); Lua.DoString("UseItemByName(52715)"); Thread.Sleep(1000); localblacklist.Add(q25115mob[0].Guid); Me.ClearTarget(); } #endregion #region 24737 if (!Me.Dead && Me.QuestLog.GetQuestById(24737) != null && !Me.QuestLog.GetQuestById(24737).IsCompleted&& q24737mob.Count > 0) { Log("Harvesting Tar"); while (Me.Location.Distance(q24737mob[0].Location) > 5) { Navigator.MoveTo(q24737mob[0].Location); } WoWMovement.MoveStop(); Thread.Sleep(300); q24737mob[0].Target(); Lua.DoString("UseItemByName(50742)"); Thread.Sleep(2000); localblacklist.Add(q24737mob[0].Guid); Me.ClearTarget(); } #endregion #region 24699 if (!Me.Dead && Me.QuestLog.GetQuestById(24699) != null && !Me.QuestLog.GetQuestById(24699).IsCompleted&& q24699mob.Count > 0) { Log("Harvesting Tar"); while (Me.Location.Distance(q24699mob[0].Location) > 5) { Navigator.MoveTo(q24699mob[0].Location); } WoWMovement.MoveStop(); Thread.Sleep(300); q24699mob[0].Target(); Lua.DoString("UseItemByName(50746)"); Thread.Sleep(2000); localblacklist.Add(q24699mob[0].Guid); Me.ClearTarget(); } #endregion #region 13850 while (!Me.Dead && Me.QuestLog.GetQuestById(13850) != null && !Me.QuestLog.GetQuestById(13850).IsCompleted&& Me.Combat && Me.CurrentTarget != null && Me.CurrentTarget.Entry == 6508 && !Me.CurrentTarget.Dead && Me.HealthPercent > 30) { Log("Suicide mission"); Lua.DoString("PetStopAttack()"); while (Me.CurrentTarget.Location.Distance(Me.Location) > 5) { Navigator.MoveTo(Me.CurrentTarget.Location); } WoWMovement.MoveStop(); if (!Me.IsAutoAttacking) { SpellManager.Cast(6603); } Thread.Sleep(1000); } #endregion #region 13850 while (!Me.Dead && Me.QuestLog.GetQuestById(24697) != null && !Me.QuestLog.GetQuestById(24697).IsCompleted&& Me.Combat && Me.CurrentTarget != null && (Me.CurrentTarget.Entry == 9162 || Me.CurrentTarget.Entry == 9163) && Me.CurrentTarget.HasAura("Throw Meat")) { Log("Running back to spike pit"); WoWPoint pitloc = new WoWPoint(-7530.954, -1458.899, -279.552); while (Me.Location.Distance(pitloc) > 2) { Navigator.MoveTo(pitloc); } WoWMovement.MoveStop(); Thread.Sleep(1000); } #endregion #region 24963 while (!Me.Dead && Me.QuestLog.GetQuestById(24963) != null && !Me.QuestLog.GetQuestById(24963).IsCompleted&& q24963mob.Count > 0) { Log("Feeding " + q24963mob[0].Name); SpellManager.StopCasting(); q24963mob[0].Target(); Thread.Sleep(100); Lua.DoString("UseItemByName(52044)"); } #endregion #region 8346 if (!Me.Dead && Me.QuestLog.GetQuestById(8346) != null && !Me.QuestLog.GetQuestById(8346).IsCompleted&& q8346mob.Count > 0 && Me.Location.Distance(q8346mob[0].Location) < 7) { Log("Casting Arcane Torrent on " + q8346mob[0].Name); SpellManager.StopCasting(); q8346mob[0].Target(); Thread.Sleep(100); Lua.DoString("CastSpellByName('Arcane Torrent')"); } #endregion #region stupid bot behaviors if (!Me.Dead && PNDErrorCount > 5) { Log("Calling pet"); Thread.Sleep(2000); Lua.DoString("CastSpellByName('Call Pet 1')"); PNDErrorCount = 0; } if (!Me.Dead && LOSErrorCount > 5 && Me.CurrentTarget != null) { Log("moving closer to target to get in LoS"); Navigator.MoveTo(Me.CurrentTarget.Location); LOSErrorCount = 0; Thread.Sleep(2000); } if (!Me.Dead && TooCloseErrorCount > 5 && Me.CurrentTarget != null && !Me.IsAutoAttacking) { Log("Attacking target"); Lua.DoString("CastSpellByName('Auto Attack')"); TooCloseErrorCount = 0; } #endregion #region combat overrides //If someone knows a better way to avoid combat or override current CC behavior please contact me. if (Me.Combat && Me.QuestLog.GetQuestById(24695) == null) { if (Me.HealthPercent < 30) { Healing.UseHealthPotion(); } if (Me.CurrentTarget == null && badtargets.Count > 0 && (!InCombatTimer.IsRunning || InCombatTimer.Elapsed.Seconds > 5)) { InCombatTimer.Start(); if (InCombatTimer.Elapsed.Seconds > 5) { Log("stuck in combat with " + badtargets[0].Name); newtarget[0].Target(); InCombatTimer.Reset(); } } foreach (WoWUnit t in Targeting.Instance.TargetList.Where(t => Me.Level > 11 && Me.GotAlivePet && t.CurrentTargetGuid == Me.Guid && Me.Pet.CurrentTargetGuid != t.Guid && Me.CurrentTarget != null && t.CanSelect)) { Log(t.Name + " Is touching me in funny places! Let my pet join the fun"); WoWUnit LastTarget = Me.CurrentTarget; Lua.DoString("StopAttack()"); t.Target(); Thread.Sleep(200); Lua.DoString("PetAttack()"); if (Me.Combat && t.Location.Distance(Me.Pet.Location) > 7) { ObjectManager.Update(); Thread.Sleep(2000); Lua.DoString("PetAttack()"); } if (SpellManager.Spells.ContainsKey("Intimidation") && !SpellManager.Spells["Intimidation"].Cooldown) { Log("Using Intimidation"); SpellManager.Cast("Intimidation"); } if (SpellManager.Spells.ContainsKey("Kill Command") && !SpellManager.Spells["Kill Command"].Cooldown) { Log("Kill Command"); SpellManager.Cast("Kill Command"); } LastTarget.Target(); Thread.Sleep(500); } foreach (WoWUnit t in Targeting.Instance.TargetList.Where(t => Me.Level > 11 && Me.GotAlivePet && t.CurrentTargetGuid == Me.Guid && t.Entry == 41064 && Me.CurrentTarget != null)) { Log(t.Name + " Argo on me. Lets try to survive"); Lua.DoString("StopAttack()"); Thread.Sleep(200); Lua.DoString("PetAttack()"); while (Me.Combat && t.Location.Distance(Me.Location) < 15 && !t.Dead) { ObjectManager.Update(); Thread.Sleep(500); Lua.DoString("PetAttack()"); WoWMovement.Move(WoWMovement.MovementDirection.Backwards); if (SpellManager.Spells.ContainsKey("Intimidation") && !SpellManager.Spells["Intimidation"].Cooldown) { Log("Using Intimidation"); SpellManager.Cast("Intimidation"); } if (SpellManager.Spells.ContainsKey("Kill Command") && !SpellManager.Spells["Kill Command"].Cooldown) { Log("Kill Command"); SpellManager.Cast("Kill Command"); } } WoWMovement.MoveStop(WoWMovement.MovementDirection.Backwards); } } #endregion while (Me.BagItems.Exists(i => i.Entry == 49932) && Me.QuestLog.GetQuestById(24606) == null) { Styx.Logic.Inventory.Frames.Quest.QuestFrame quest = new Styx.Logic.Inventory.Frames.Quest.QuestFrame(); Lua.DoString("UseItemByName(49932)"); Thread.Sleep(1000); quest.AcceptQuest(); } }
///<summary>Updates one Mount in the database.</summary> public static void Update(Mount mount){ string command="UPDATE mount SET " +"PatNum = "+POut.Long (mount.PatNum)+", " +"DocCategory= "+POut.Long (mount.DocCategory)+", " +"DateCreated= "+POut.Date (mount.DateCreated)+", " +"Description= '"+POut.String(mount.Description)+"', " +"Note = '"+POut.String(mount.Note)+"', " +"ImgType = "+POut.Int ((int)mount.ImgType)+", " +"Width = "+POut.Int (mount.Width)+", " +"Height = "+POut.Int (mount.Height)+" " +"WHERE MountNum = "+POut.Long(mount.MountNum); Db.NonQ(command); }
private void ProcessProcMountLine (string line) { string[] split = line.Split (new char [] {' '}); if (split != null && split.Length > 0) { Mount mount = new Mount (); if (split [0].StartsWith ("/dev/")) mount.device_short = split [0].Replace ("/dev/", String.Empty); else mount.device_short = split [0]; mount.device_or_filesystem = split [0]; mount.mount_point = split [1]; // TODO: other removable devices, floppy // ssh // network mount if (split [2] == "nfs") { mount.fsType = FsTypes.nfs; network_devices.Add (mount); } else if (split [2] == "smbfs") { mount.fsType = FsTypes.smbfs; network_devices.Add (mount); } else if (split [2] == "cifs") { mount.fsType = FsTypes.cifs; network_devices.Add (mount); } else if (split [2] == "ncpfs") { mount.fsType = FsTypes.ncpfs; network_devices.Add (mount); } else if (split [2] == "iso9660") { //cdrom mount.fsType = FsTypes.iso9660; removable_devices.Add (mount); } else if (split [2] == "usbfs") { //usb ? not tested mount.fsType = FsTypes.usbfs; removable_devices.Add (mount); } else if (split [0].StartsWith ("/")) { //block devices if (split [1].StartsWith ("/dev/")) // root static, do not add return; if (split [2] == "ext2") mount.fsType = FsTypes.ext2; else if (split [2] == "ext3") mount.fsType = FsTypes.ext3; else if (split [2] == "reiserfs") mount.fsType = FsTypes.reiserfs; else if (split [2] == "xfs") mount.fsType = FsTypes.xfs; else if (split [2] == "vfat") mount.fsType = FsTypes.vfat; else if (split [2] == "ntfs") mount.fsType = FsTypes.ntfs; else if (split [2] == "msdos") mount.fsType = FsTypes.msdos; else if (split [2] == "umsdos") mount.fsType = FsTypes.umsdos; else if (split [2] == "hpfs") mount.fsType = FsTypes.hpfs; else if (split [2] == "minix") mount.fsType = FsTypes.minix; else if (split [2] == "jfs") mount.fsType = FsTypes.jfs; block_devices.Add (mount); } } }
public void SetupMount(Mount mount) { mount.modMount.SetDefaults(); Thread.Sleep(2000); SetupModMount(mount); }
public override bool UpdateFrame(Player mountedPlayer, int state, Vector2 velocity) { PlayerHook modPlayer = mountedPlayer.GetModPlayer <PlayerHook>(mod); Mount mount = mountedPlayer.mount; //Part of vanilla code, mount will glitch out // if this is not executed. if (mount._frameState != state) { mount._frameState = state; } //End of required vanilla code //Adjust animation speed after landing/takeoff if (state == 0) { if (mount._idleTime > 0) { mount._idleTime--; } } else { if (mount._idleTime < revUpFrames) { mount._idleTime += 4; } } float throttle = 1; if (mount._idleTime < revUpFrames) { throttle = (mount._idleTime) / (float)revUpFrames; } //Choose next frame mount._frameCounter += throttle; if ((int)mount._frameCounter >= mountData.inAirFrameDelay) { mount._frameCounter -= mountData.inAirFrameDelay; mount._frameExtra++; if (mount._frameExtra >= mountData.inAirFrameCount) { mount._frameExtra = 0; } } mount._frame = mount._frameExtra; if (modPlayer.copterFireFrame >= muzzleFrames) { mount._frame = mount._frameExtra; } else if (modPlayer.copterFireFrame >= muzzleFrames >> 1) { mount._frame = mount._frameExtra + mountData.inAirFrameCount; } else { mount._frame = mount._frameExtra + 2 * mountData.inAirFrameCount; } return(false); }
private static void ProcessExchangeMountParkRequest(WorldClient Client, string Packet) { MountPark MP = Client.Character.inMountPark; if (MP != null) { char c = Packet[2]; Packet = Packet.Substring(3); int guid = -1; try { guid = int.Parse(Packet); } catch (Exception e) { }; switch (c) { case 'C': //Parcho => Etable (Stocker) if (guid == -1 || !Client.Character.InventoryCache.hasItemGuid(guid)) { return; } InventoryItemModel obj = Client.Character.InventoryCache.GetItem(guid); //on prend la DD demandée int DDid = -1; Mount DD = null; if (obj.GetStats().HasEffect(EffectEnum.MountOwner)) { DDid = obj.GetStats().GetEffect(EffectEnum.MountOwner).Items; DD = MountTable.getMount(DDid); } //FIXME mettre return au if pour ne pas créer des nouvelles dindes if (DD == null) { int color = StaticMountTable.getMountColorByParchoTemplate(obj.TemplateID); if (color < 1) { return; } DD = new Mount(color); } DD.Intialize(); //On enleve l'Item du Monde et du Perso Client.Character.InventoryCache.remove(guid); InventoryItemTable.removeItem(guid); //on ajoute la dinde a l'étable Client.Account.Data.Mounts.Add(DD.ID, DD); Client.Account.Data.Save(); //On envoie les Packet Client.Send(new ObjectRemoveMessage(obj.ID)); Client.Send(new ExchangeEndMessage('+', DD.parse())); break; case 'c': //Etable => Parcho(Echanger) Mount DD1 = MountTable.getMount(guid); //S'il n'a pas la dinde if (!Client.Account.Data.Mounts.ContainsKey(DD1.ID) || DD1 == null) { return; } //on retire la dinde de l'étable Client.Account.Data.Mounts.Remove(DD1.ID); GenericStats Stat = new GenericStats(); Stat.AddItem(EffectEnum.MountOwner, DD1.ID); Stat.AddSpecialEffect(EffectEnum.MountOwnerName, Client.Character.Name); Stat.AddSpecialEffect(EffectEnum.MountName, DD1.Name); var item = InventoryItemTable.TryCreateItem(StaticMountTable.getMountScroll(DD1.get_color()).ID, Client.Character, 1, -1, Stat.ToItemStats()); Client.Send(new ExchangeEndMessage('-', DD1.ID + "")); Stat = null; break; case 'g': //Equiper Mount DD3 = MountTable.getMount(guid); //S'il n'a pas la dinde if (DD3 == null || !Client.Account.Data.Mounts.ContainsKey(DD3.ID) || Client.Character.Mount != null) { return; } DD3.Intialize(); Client.Account.Data.Mounts.Remove(DD3.ID); Client.Account.Data.Save(); Client.Character.Mount = DD3; //Packets Client.Send(new CharacterRideEventMessage("+", DD3)); Client.Send(new ExchangeEndMessage('-', DD3.ID + "")); Client.Send(new CharacterMountXpGive(Client.Character.MountXPGive)); break; case 'p': //Equipé => Stocker //Si c'est la dinde équipé if (Client.Character.Mount != null ? Client.Character.Mount.ID == guid : false) { //Si le perso est sur la monture on le fait descendre if (Client.Character.isOnMount()) { Client.Character.toogleOnMount(); } //Si ca n'a pas réussie, on s'arrete là (Items dans le sac ?) if (Client.Character.isOnMount()) { return; } Mount DD2 = Client.Character.Mount; DD2.Intialize(); Client.Account.Data.Mounts.Add(DD2.ID, DD2); Client.Account.Data.Save(); Client.Character.Mount = null; //Packets Client.Send(new ExchangeEndMessage('+', DD2.parse())); Client.Send(new CharacterRideEventMessage("-", null)); Client.Send(new CharacterMountXpGive(Client.Character.MountXPGive)); } else //Sinon... { } break; } } else { Client.Send(new BasicNoOperationMessage()); return; } }
public SCMateSpawnedPacket(Mount mate) : base(SCOffsets.SCMateSpawnedPacket, 1) { _mate = mate; }
public void AddMount(Mount newMount) { m_mountList.Add (newMount); }
/// <summary> /// Determine if we're dealing with an actual prefab or an instance /// </summary> /// <param name="rMountPoints"></param> /// <returns></returns> private bool IsAddMountPointEnabled(Mount rMount) { PrefabType lType = PrefabUtility.GetPrefabType(rMount); return lType != PrefabType.Prefab; }
protected override RunStatus Run(object context) { if (!canRun) { return(RunStatus.Failure); } WoWGameObject pool = null; if (_me.Mounted) { Mount.Dismount("Fishing"); } if (_me.IsMoving || _me.IsFalling) { WoWMovement.MoveStop(); if (!_me.HasAura("Levitate")) { return(RunStatus.Success); } } if (BotPoi.Current != null && BotPoi.Current.Type == PoiType.Harvest) { pool = (WoWGameObject)BotPoi.Current.AsObject; if (pool == null || !pool.IsValid) { BotPoi.Current = null; return(RunStatus.Failure); } if (pool.Guid != _lastPoolGuid) { _lastPoolGuid = pool.Guid; _timeAtPoolSW.Reset(); _timeAtPoolSW.Start(); } // safety check. if spending more than 5 mins at pool than black list it. if (_timeAtPoolSW.ElapsedMilliseconds >= AutoAngler.Instance.MySettings.MaxTimeAtPool * 60000) { Utils.BlacklistPool(pool, TimeSpan.FromMinutes(10), "Spend too much time at pool"); return(RunStatus.Failure); } // Blacklist pool if we have too many failed casts if (_castCounter >= AutoAngler.Instance.MySettings.MaxFailedCasts) { AutoAngler.Instance.Log("Moving to a new fishing location since we have {0} failed casts", _castCounter); _castCounter = 0; MoveToPoolAction.PoolPoints.RemoveAt(0); return(RunStatus.Success); } // face pool if not facing it already. if (!IsFacing2D(_me.Location, _me.Rotation, pool.Location, WoWMathHelper.DegreesToRadians(5))) { LineRecastSW.Reset(); LineRecastSW.Start(); _me.SetFacing(pool.Location); // SetFacing doesn't really update my angle in game.. still tries to fish using prev angle. so I need to move to update in-game angle WoWMovement.Move(WoWMovement.MovementDirection.ForwardBackMovement); WoWMovement.MoveStop(WoWMovement.MovementDirection.ForwardBackMovement); return(RunStatus.Success); } } if (_me.IsCasting) { WoWGameObject bobber = null; try { bobber = ObjectManager.GetObjectsOfType <WoWGameObject>() .FirstOrDefault(o => o.IsValid && o.SubType == WoWGameObjectType.FishingBobber && o.CreatedBy.Guid == _me.Guid); } catch (Exception) { } if (bobber != null) { // recast line if it's not close enough to pool if (AutoAngler.Instance.MySettings.Poolfishing && pool != null && bobber.Location.Distance(pool.Location) > 3.6f) { CastLine(); } // else lets see if there's a bite! else if (((WoWFishingBobber)bobber.SubObj).IsBobbing) { _castCounter = 0; (bobber.SubObj).Use(); LootAction.WaitingForLootSW.Reset(); LootAction.WaitingForLootSW.Start(); } } return(RunStatus.Success); } CastLine(); return(RunStatus.Success); }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( // if not in a turret than move to one and interact with it new Decorator(ret => !InVehicle, new Sequence(ctx => GetMustang(), // set Turret as context new DecoratorContinue(ctx => ctx != null && ((WoWUnit)ctx).DistanceSqr > 5 * 5, new Action(ctx => { Navigator.MoveTo(((WoWUnit)ctx).Location); TreeRoot.StatusText = "Moving To Mustang"; })), new DecoratorContinue(ctx => ctx != null && ((WoWUnit)ctx).DistanceSqr <= 5 * 5, new Action(ctx => { Logging.Write("Interacting with Mustang"); if (Me.Mounted) { Mount.Dismount(); } ((WoWUnit)ctx).Interact(); })))), // Find the nearest spider and if none exist then move to thier spawn location new Decorator(ret => _currentTarget == null || !_currentTarget.IsValid || !_currentTarget.IsAlive, new Action(ctx => { _currentTarget = ObjectManager.GetObjectsOfType <WoWUnit>() .Where( u => u.IsAlive && !_blackList.Contains(u.Guid) && u.Entry == 44284). OrderBy(u => u.DistanceSqr).FirstOrDefault(); if (_currentTarget == null) { Navigator.MoveTo(_spiderLocation); Logging.Write("No spiders found. Moving to spawn point"); } else { _movetoPoint = WoWMathHelper.CalculatePointFrom(_lumberMillLocation, _currentTarget. Location, -5); Logging.Write("Locked on a new target. Distance {0}", _currentTarget.Distance); } })), new Sequence( new Action(ctx => TreeRoot.StatusText = "Scaring spider towards lumber mill"), new Action(ctx => { // blacklist spider if it doesn't move if (DateTime.Now - _stuckTimeStamp > TimeSpan.FromSeconds(6)) { _stuckTimeStamp = DateTime.Now; if (_movetoPoint.DistanceSqr(_lastMovetoPoint) < 3 * 3) { Logging.Write("Blacklisting spider"); _blackList.Add(_currentTarget.Guid); _currentTarget = null; return RunStatus.Failure; } _lastMovetoPoint = _movetoPoint; } return RunStatus.Success; }), new Action(ctx => { // update movepoint _movetoPoint = WoWMathHelper.CalculatePointFrom(_lumberMillLocation, _currentTarget. Location, -7); if (_movetoPoint.DistanceSqr(Me.Location) > 8 * 8) { Navigator.MoveTo(_movetoPoint); return RunStatus.Running; } return RunStatus.Success; }), new WaitContinue(2, ret => !Me.IsMoving, new ActionAlwaysSucceed()), new Action(ctx => { using (new FrameLock()) { Me.SetFacing(_lumberMillLocation); WoWMovement.Move(WoWMovement.MovementDirection.ForwardBackMovement); WoWMovement.MoveStop(WoWMovement.MovementDirection.ForwardBackMovement); //Lua.DoString("CastSpellByID(83605)"); } }), new WaitContinue(TimeSpan.FromMilliseconds(200), ret => false, new ActionAlwaysSucceed()), new Action(ctx => Lua.DoString("CastSpellByID(83605)")) /* * new Action(ctx => * { * var unit = ctx as WoWUnit; * if (unit != null && unit.IsValid && unit.IsAlive) * { * // move to a point that places the spider between player and lumber mill * var movetoPoint = WoWMathHelper.CalculatePointFrom(_lumberMillLocation, unit.Location, -5); * // blacklist spider if its not moving * if (DateTime.Now - _stuckTimeStamp > TimeSpan.FromSeconds(6)) * { * _stuckTimeStamp = DateTime.Now; * if (movetoPoint.DistanceSqr(_lastMovetoPoint) < 2 * 2) * { * Logging.Write("Blacklisting spider"); * _blackList.Add(unit.Guid); * return RunStatus.Failure; * } * _lastMovetoPoint = movetoPoint; * } * * if (movetoPoint.DistanceSqr(Me.Location) > 6 * 6) * Navigator.MoveTo(movetoPoint); * else * { * using (new FrameLock()) * { * //WoWMovement.MoveStop(); * //Me.SetFacing(_lumberMillLocation); * Lua.DoString("CastSpellByID(83605)"); * } * } * return RunStatus.Running; * } * return RunStatus.Failure; * })*/ )))); }
private void AddEquipment() { armour = new UnArmoured(); mount = new Feet(); }
protected Composite CreateBehavior_QuestbotMain() { return(_root ?? (_root = new Decorator(ret => !_isBehaviorDone, new Sequence(new DecoratorContinue(r => Mount != null && (Mount.GetAllAuras().FirstOrDefault(x => x.SpellId == 88043 || x.SpellId == 88189) != null), new Action(r => Shield())), new PrioritySelector(DoneYet, PartOne, PartTwo, new ActionAlwaysSucceed()))))); }
///<summary>Updates one Mount in the database. Uses an old object to compare to, and only alters changed fields. This prevents collisions and concurrency problems in heavily used tables. Returns true if an update occurred.</summary> public static bool Update(Mount mount,Mount oldMount){ string command=""; if(mount.PatNum != oldMount.PatNum) { if(command!=""){ command+=",";} command+="PatNum = "+POut.Long(mount.PatNum)+""; } if(mount.DocCategory != oldMount.DocCategory) { if(command!=""){ command+=",";} command+="DocCategory = "+POut.Long(mount.DocCategory)+""; } if(mount.DateCreated != oldMount.DateCreated) { if(command!=""){ command+=",";} command+="DateCreated = "+POut.Date(mount.DateCreated)+""; } if(mount.Description != oldMount.Description) { if(command!=""){ command+=",";} command+="Description = '"+POut.String(mount.Description)+"'"; } if(mount.Note != oldMount.Note) { if(command!=""){ command+=",";} command+="Note = '"+POut.String(mount.Note)+"'"; } if(mount.ImgType != oldMount.ImgType) { if(command!=""){ command+=",";} command+="ImgType = "+POut.Int ((int)mount.ImgType)+""; } if(mount.Width != oldMount.Width) { if(command!=""){ command+=",";} command+="Width = "+POut.Int(mount.Width)+""; } if(mount.Height != oldMount.Height) { if(command!=""){ command+=",";} command+="Height = "+POut.Int(mount.Height)+""; } if(command==""){ return false; } command="UPDATE mount SET "+command +" WHERE MountNum = "+POut.Long(mount.MountNum); Db.NonQ(command); return true; }
private RunStatus GotoPool(WoWGameObject pool) { if (_lastPoolGuid != pool.Guid) { MoveToPoolSW.Reset(); MoveToPoolSW.Start(); _lastPoolGuid = pool.Guid; if (!FindPoolPoint(pool) || PoolPoints.Count == 0) { Utils.BlacklistPool(pool, TimeSpan.FromDays(1), "Found no landing spots"); return(RunStatus.Success);// return sucess so Behavior stops and starts at begining on next tick. } } // should never be true.. but being safe.. if (PoolPoints.Count == 0) { Utils.BlacklistPool(pool, TimeSpan.FromDays(1), "Pool landing points mysteriously disapear..."); return(RunStatus.Success);// return sucess so Behavior stops and starts at begining on next tick. } TreeRoot.StatusText = "Moving to " + pool.Name; if (_me.Location.Distance(PoolPoints[0]) > 3) { _movetoConcludingSW.Reset(); if (!MoveToPoolSW.IsRunning) { MoveToPoolSW.Start(); } if (_me.IsSwimming) { if (_me.GetMirrorTimerInfo(MirrorTimerType.Breath).CurrentTime > 0) { WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend); } else if (_me.MovementInfo.IsAscending || _me.MovementInfo.JumpingOrShortFalling) { WoWMovement.MoveStop(WoWMovement.MovementDirection.JumpAscend); } } if (AutoAngler.Instance.MySettings.Fly) { // don't bother mounting up if we can use navigator to walk over if it's less than 25 units away if (_me.Location.Distance(PoolPoints[0]) < 25 && !_me.Mounted) { MoveResult moveResult = Navigator.MoveTo(PoolPoints[0]); if (moveResult == MoveResult.Failed || moveResult == MoveResult.PathGenerationFailed) { Flightor.MountHelper.MountUp(); } else { return(RunStatus.Success); } } else if (!_me.Mounted && !SpellManager.GlobalCooldown) { Flightor.MountHelper.MountUp(); } Flightor.MoveTo(WoWMathHelper.CalculatePointFrom(_me.Location, PoolPoints[0], -1f)); } else { if (!ObjectManager.Me.Mounted && Mount.ShouldMount(PoolPoints[0]) && Mount.CanMount()) { Mount.MountUp(() => PoolPoints[0]); } MoveResult moveResult = Navigator.MoveTo(PoolPoints[0]); if (moveResult == MoveResult.UnstuckAttempt || moveResult == MoveResult.PathGenerationFailed || moveResult == MoveResult.Failed) { if (!RemovePointAtTop(pool)) { return(RunStatus.Success); } AutoAngler.Instance.Debug("Unable to path to pool point, switching to a new point"); PoolPoints.Sort((a, b) => a.Distance(_me.Location).CompareTo(b.Distance(_me.Location))); } } // if it takes more than 25 seconds to get to a point remove that point and try another. if (MoveToPoolSW.ElapsedMilliseconds > 25000) { if (!RemovePointAtTop(pool)) { return(RunStatus.Failure); } MoveToPoolSW.Reset(); MoveToPoolSW.Start(); } return(RunStatus.Success); } // allow small delay so clickToMove can run its course before dismounting. better landing precision.. if (!_movetoConcludingSW.IsRunning) { _movetoConcludingSW.Start(); } if (_movetoConcludingSW.ElapsedMilliseconds < 1500) { if (_me.Location.Distance2D(PoolPoints[0]) > 0.5) { WoWMovement.ClickToMove(PoolPoints[0]); } return(RunStatus.Success); } if (_me.Mounted) { if (_me.Class == WoWClass.Druid && (_me.Shapeshift == ShapeshiftForm.FlightForm || _me.Shapeshift == ShapeshiftForm.EpicFlightForm)) { Lua.DoString("CancelShapeshiftForm()"); } else { Lua.DoString("Dismount()"); } } // can't fish while swimming.. if (_me.IsSwimming && !WaterWalking.CanCast) { AutoAngler.Instance.Debug("Moving to new PoolPoint since I'm swimming at current PoolPoint"); RemovePointAtTop(pool); return(RunStatus.Success); } return(RunStatus.Failure); }
internal static bool IsModMount(Mount Mount) { return Mount._type >= MountID.Count; }
public static void SetReady() { Terminal.Terminal.Execute($"cp {dir} {DIR}"); FileSystem.CopyDirectory(dir, DIR); Mount.Dir(dir); }
// determine if the mount should be handled or not bool IsTrash (Mount m) { return m == null || (m.Root != null && Mounts.Find (mnt => mnt.Mnt.Root != null && mnt.Mnt.Root.StringUri () == m.Root.StringUri ()) != null) || (m.Root == null && Mounts.Find (mnt => mnt.Mnt.Root == null && mnt.Mnt.Handle == m.Handle) != null); }
/// <summary> /// Updates the localized gamestrings to the selected <see cref="Localization"/>. /// </summary> /// <param name="mount">The data to be updated.</param> /// <param name="gameStringDocument">Instance of a <see cref="GameStringDocument"/>.</param> /// <exception cref="ArgumentNullException"><paramref name="gameStringDocument"/> is null.</exception> public static void UpdateGameStrings(this Mount mount, GameStringDocument gameStringDocument) { ArgumentNullException.ThrowIfNull(gameStringDocument, nameof(gameStringDocument)); gameStringDocument.UpdateGameStrings(mount); }
internal void SetupModMount(Mount mount) { ModMount newMount = (ModMount)Activator.CreateInstance(GetType()); newMount.mount = mount; mount.modMount = newMount; newMount.mod = mod; newMount.mount.setMountData(index, spawnDust, heightBoost, runSpeed, dashSpeed, acceleration, jumpHeight, jumpSpeed, bodyFrame, xOffset, yOffset, playerHeadOffset, standingFrameCount, standingFrameDelay, standingFrameStart, runningFrameCount, runningFrameDelay, runningFrameStart, flyingFrameCount, flyingFrameDelay, flyingFrameStart, inAirFrameCount, inAirFrameDelay, inAirFrameStart, idleFrameCount, idleFrameDelay, idleFrameStart, swimFrameCount, swimFrameDelay, swimFrameStart, idleFrameLoop, backTexture, array, fallDamage, dashingFrameCount, dashingFrameDelay, dashingFrameStart, buff, flightTimeMax); }