public void Teleport(Serial target) { if (new UOCharacter(target).Distance > 12) { UO.PrintError("Moc daleko"); return; } DateTime start; UO.Warmode(false); if (World.Player.Backpack.AllItems.FindType(0x1F42).Amount > 0) { new UOObject(target).WaitTarget(); World.Player.Backpack.AllItems.FindType(0x1F42).Use(); } else { UO.Cast(StandardSpell.Teleport, target); } if (!Journal.WaitForText(true, 3300, "Kouzlo se nezdarilo.")) { start = DateTime.Now; } else { return; } UO.Attack(target); }
public void Leap() { if (DateTime.Now - LastLeap > TimeSpan.FromMilliseconds(4400)) { UOCharacter ch = new UOCharacter(Aliases.LastAttack); if (ch.Distance < 10 && World.Player.Warmode) { if (!World.Player.Warmode) { UO.Warmode(true); } UO.Attack(ch); UO.Say(".leap"); LastLeap = DateTime.Now; while (DateTime.Now - LastLeap < TimeSpan.FromMilliseconds(4400)) { UO.Wait(100); } World.Player.Print("===== LEAP ====="); } else { UO.PrintError("Moc Daleko"); } } else { UO.PrintError("Jeste nemuzes pouzit Leap"); } }
//--------------------------------------------------------------------------------------------- protected void StatusForm_MouseDoubleClick(object sender, MouseEventArgs e) { if (Game.CurrentGame.IsAlie(mobile.Serial) || Game.CurrentGame.IsHealAlie(mobile.Serial) || this.mobile.Serial == World.Player.Serial) { Healing.LastCharacter = mobile; UO.PrintObject(mobile, Game.Val_LightPurple, "[LastChar...]"); } else { Game.RunScript(CalebConfig.AttackDelay); World.Player.ChangeWarmode(WarmodeChange.War); UO.Attack(mobile.Serial); } }
public void AttackSelectTarget(params string[] targetAlternates) { Game.RunScriptCheck(Targeting.DynamicAttackDelay); UOCharacter enemy = new UOCharacter(Serial.Invalid); if (targetAlternates.Length == 0) { enemy = new UOCharacter(Aliases.LastAttack); } else { enemy = new UOCharacter(Targeting.ParseTargets(targetAlternates)); } if (enemy.Serial == Serial.Invalid || !enemy.Exist) { new Targeting().Find3(); Game.Wait(250); enemy = new UOCharacter(Aliases.LastAttack); } if (enemy.Exist) { if (!lastEnemy.IsValid || lastEnemy != enemy.Serial) { counter = 0; } if (!World.Player.Warmode) { UO.Warmode(true); Game.Wait(250); } UO.Attack(enemy.Serial); Game.atackCounterEnabled = true; if (counter % 4 == 0) { Game.PrintMessage(String.Format("[{0}/{1}]", enemy.Hits, enemy.MaxHits), Game.GetEnemyColorByHits(enemy.Serial)); // enemy.PrintMessage(String.Format("[{0}/{1}]", enemy.Hits, enemy.MaxHits), Game.GetEnemyColorByHits(enemy.Serial)); } counter++; } }
private void HarmSelf(bool attacklast, bool war = false) { UO.Warmode(false); if (war) { UO.Cast(StandardSpell.MagicArrow, World.Player.Serial); UO.Wait(2200); } else { UO.Cast(StandardSpell.Harm, World.Player.Serial); UO.Wait(1600); } if (attacklast) { UO.Warmode(true); UO.Attack(Aliases.GetObject("laststatus").IsValid ? Aliases.GetObject("laststatus") : 0x00); } }
void StatusForm_MouseDoubleClick(object sender, MouseEventArgs e) { if (mobile.Notoriety == Notoriety.Enemy || mobile.Notoriety == Notoriety.Murderer) { World.Player.ChangeWarmode(WarmodeChange.War); UO.Attack(mobile.Serial); } else { if (World.Player.Warmode) { UO.Attack(mobile.Serial); } else { mobile.Use(); } } }
//--------------------------------------------------------------------------------------------- protected bool KillCharacter(UOCharacter character) { UOItem wepn = new UOItem(Serial.Invalid); foreach (UOItemType t in ItemLibrary.WeaponsFenc) { wepn = UO.Backpack.AllItems.FindType(t.Graphic); if (wepn.Exist) { break; } else { wepn = World.Player.Layers[Layer.LeftHand].Graphic == t.Graphic ? World.Player.Layers[Layer.LeftHand] : wepn;//.FindType(t.Graphic); if (wepn.Exist) { break; } else { wepn = World.Player.Layers[Layer.RightHand].Graphic == t.Graphic ? World.Player.Layers[Layer.RightHand] : wepn; if (wepn.Exist) { break; } } } } bool isArch = false; if (!wepn.Exist) { foreach (UOItemType t in ItemLibrary.WeaponsArch) { wepn = UO.Backpack.AllItems.FindType(t.Graphic); if (wepn.Exist) { isArch = true; break; } else { wepn = World.Player.Layers[Layer.LeftHand].Graphic == t.Graphic ? World.Player.Layers[Layer.LeftHand] : wepn;//.FindType(t.Graphic); if (wepn.Exist) { break; } else { wepn = World.Player.Layers[Layer.RightHand].Graphic == t.Graphic ? World.Player.Layers[Layer.RightHand] : wepn; if (wepn.Exist) { break; } } } } } if (wepn.Exist) { UO.WaitTargetObject(character); if (wepn.Layer != Layer.RightHand || wepn.Layer != Layer.LeftHand) { wepn.Use(); Game.Wait(); } int killTries = 0; while (character.Exist && character.Distance < 8 && character.Hits > -1 && killTries < 50) { Game.PrintMessage("Kill " + character.Name + " Trie:" + killTries); if (isArch) { Ranger.EnsureArcherAmmo(); Game.Wait(Game.SmallestWait); } World.Player.ChangeWarmode(WarmodeChange.War); Game.Wait(); UO.Attack(character); Game.Wait(); new Robot().GoTo(character.X, character.Y, 1, 4); character.Print("{0}/{1}", character.Hits, character.MaxHits); killTries++; Game.Wait(5000); } if (!character.Exist) { Game.Wait(500); new Loot().LootGround(Loot.LootType.Quick, true); return(true); } } else { Game.PrintMessage("Nemas u sebe Kryss"); } return(false); }
public static void StayAndFight(int distance, int hpMin, bool boost, bool reversePath, string path, string summonName, int summonCount) { ManualLastTarget.SwitchShowStatusBar(); int initGold = World.Player.Gold; int initFD = World.Player.Backpack.AllItems.FindType(0x103D, 0x0B52).Amount; //Serial: 0x4023CD57 Name: "Fairy Dust" Position: 136.144.0 Flags: 0x0020 Color: 0x0B52 Graphic: 0x103D Amount: 4 Layer: None Container: 0x4019287E PlayerClass pclass = Game.CurrentGame.CurrentPlayer.PlayerClass; UOPosition zero = new UOPosition(World.Player.X, World.Player.Y, (ushort)World.Player.Z); CalebConfig.AutoHeal = true; World.Player.ChangeWarmode(WarmodeChange.War); Game.Wait(); short maxHitsBase = World.Player.MaxHits; DateTime? lastBoostTime = null; List <Serial> deny = new List <Serial>(); UOCharacter current = null; Robot r = new Robot(); Robot r2 = new Robot(); Robot r3 = new Robot(); Loot l = new Loot(); DateTime startTime = DateTime.Now; Hashtable htKilled = new Hashtable(); int walkCounter = 0; GotoEventHandler beforeMoveHandler = (sender, e) => { ushort x = e.Destination.X.GetValueOrDefault(); ushort y = e.Destination.Y.GetValueOrDefault(); walkCounter++; if (Game.CurrentGame.Mobs.Count > 0 && (walkCounter % 15) == 0) { new Thread(new ThreadStart(MobMaster.Current.MobCome)).Start(); } foreach (UOItem item in World.Ground) { if (item.Graphic == 0x0DDA && item.X == x && item.Y == y) { e.IvalidDestination = true; } } }; GotoEventHandler beforeMoveHandler2 = (sender, e) => { walkCounter++; if (current != null && e.Tries > 5) { List <UOCharacter> chars = new List <UOCharacter>(); chars.AddRange(World.Characters.Where(ch => (ch.Notoriety == Notoriety.Enemy || ch.Notoriety == Notoriety.Murderer) && ch.Distance <= distance && !deny.Contains(ch.Serial) && !Characters.IsSummon(ch) && ch.Serial != World.Player.Serial).OrderBy(ch => ch.Distance).ThenBy(ch => ch.MaxHits).ToArray()); if (Game.CurrentGame.Mobs.Count > 0 && (walkCounter % 15) == 0) { new Thread(new ThreadStart(MobMaster.Current.MobCome)).Start(); } foreach (UOCharacter ch in chars) { if (ch.Distance < current.Distance) { e.Abort = true; break; } } } }; GotoEventHandler beforeMoveHandler3 = (sender, e) => { walkCounter++; List <UOCharacter> chars = new List <UOCharacter>(); chars.AddRange(World.Characters.Where(ch => (ch.Notoriety == Notoriety.Enemy || ch.Notoriety == Notoriety.Murderer) && ch.Distance <= distance && !deny.Contains(ch.Serial) && !Characters.IsSummon(ch) && ch.Serial != World.Player.Serial).OrderBy(ch => ch.Distance).ThenBy(ch => ch.MaxHits).ToArray()); if (Game.CurrentGame.Mobs.Count > 0 && (walkCounter % 15) == 0) { new Thread(new ThreadStart(MobMaster.Current.MobCome)).Start(); } foreach (UOCharacter ch in chars) { if (current == null || ch.Distance < current.Distance) { e.Abort = true; break; } } }; List <IUOPosition> posPath = new List <IUOPosition>(); posPath.Add(new UOPositionBase(World.Player.X, World.Player.Y, (ushort)World.Player.Z)); if (!String.IsNullOrEmpty(path)) { posPath.AddRange(UOPositionBase.ParseList(path)); } r2.BeforeMove += beforeMoveHandler; r2.BeforeMove += beforeMoveHandler2; r.BeforeMove += beforeMoveHandler; r3.BeforeMove += beforeMoveHandler; r3.BeforeMove += beforeMoveHandler3; int pathIndex = 0; Poisoning p = new Poisoning(); while (!UO.Dead) { if (boost) { if (lastBoostTime == null || (DateTime.Now - lastBoostTime).Value.TotalMilliseconds > 180000) { Game.RunScript(8000); lastBoostTime = DateTime.Now; Game.PrintMessage("Try booost..."); UO.Cast(StandardSpell.ReactiveArmor, Aliases.Self); Game.Wait(2500); Game.RunScript(4000); UO.Cast(StandardSpell.Strength, Aliases.Self); Game.Wait(3500); Game.RunScript(4000); UO.Cast(StandardSpell.Protection, Aliases.Self); Game.Wait(3500); } } List <UOCharacter> chars = new List <UOCharacter>(); chars.AddRange(World.Characters.Where(ch => (ch.Notoriety == Notoriety.Enemy || ch.Notoriety == Notoriety.Murderer) && ch.Distance <= distance && !Characters.IsSummon(ch) && ch.Serial != World.Player.Serial).OrderBy(ch => ch.Distance).ThenBy(ch => ch.MaxHits).ToArray()); foreach (UOCharacter ch in chars) { bool isVladimirSkorp = ch.Model == 0x0030 && ch.Color == 0x0B78; if (deny.Contains(ch.Serial) && ch.Distance > 2) { continue; } ch.RequestStatus(500); ch.Click(); Game.Wait(); if (World.Player.Hits <= hpMin) { while (World.Player.Hits < hpMin) { Game.Wait(500); } } ch.Print(Game.Val_GreenBlue, "[killing...]"); current = ch; if (!String.IsNullOrEmpty(summonName) && World.Player.Layers[Layer.Hat].Graphic == 0x1451 && Game.CurrentGame.Mobs.Count < summonCount && World.Player.Mana > 20) { Magery.ExecCastSummonCreature(summonName, "Self"); Game.Wait(4000); MobMaster.Current.MobStop(); } for (int i = 0; i < Game.CurrentGame.Mobs.Count; i++) { MobMaster.Current.MobKill(); Game.Wait(250); } if (ch.Exist && ch.Hits > 0 && ch.Distance < 50 && r2.GoTo(ch.X, ch.Y, 1, 25)) { UOItem trainKit = World.Player.Backpack.AllItems.FindType(Poisoning.TrainKit.Graphic, Poisoning.TrainKit.Color); if (trainKit.Exist) { p.TrainPoisEngage(); } while (ch.Exist && ch.Hits > 0) { if (!Game.CurrentGame.WorldSave()) { //Serial: 0x401E33B3 Position: 0.0.0 Flags: 0x0000 Color: 0x0000 Graphic: 0x1451 Amount: 0 Layer: Hat Container: 0x0037EAF7 if (!String.IsNullOrEmpty(summonName) && World.Player.Layers[Layer.Hat].Graphic == 0x1451 && Game.CurrentGame.Mobs.Count < summonCount && World.Player.Mana > 20) { Magery.ExecCastSummonCreature(summonName, "Self"); Game.Wait(4000); MobMaster.Current.MobStop(); } if (ch.Exist && ch.Hits > 0 && ch.Distance > 1 && ch.Distance < 30) { Game.PrintMessage("HUNT... " + new UOPositionBase(ch.X, ch.Y, 0)); Game.RunScript(500); Game.Wait(500); UO.Attack(ch.Serial); if (!r.GoTo(ch.X, ch.Y, 1, 5)) { break; } } htKilled[ch.Serial] = ch; UO.Attack(ch.Serial); Game.RunScript(1500); Game.Wait(1000); for (int i = 0; i < Game.CurrentGame.Mobs.Count; i++) { MobMaster.Current.MobKill(); Game.Wait(250); } if (World.Player.Hits <= hpMin) { while (World.Player.Hits < hpMin) { if (pclass == PlayerClass.Vampire) { if (Game.CurrentGame.CanDrink) { Alchemy.ExecDrinkPotion("Blood"); Game.Wait(500); } if (World.Player.Hits < 45) { Vampire.SnezBandu(); Game.Wait(500); } } else { if (Game.CurrentGame.CanDrink && Potion.Heal.ContainsTopKad(World.Player.Backpack)) { Alchemy.ExecDrinkPotion("Heal"); Game.Wait(150); } } if (World.Player.Hits < hpMin) { Game.RunScript(5); // Game.CurrentGame.SwitchWarRunOff(); Game.Wait(2500); } if (Game.CurrentGame.Mobs.Count > 0) { if (!ch.Exist) { MobMaster.Current.MobStop(); Game.Wait(150); } else { MobMaster.Current.MobKill(); Game.Wait(150); } } } } if (ch.Exist && ch.Hits > 0 && ch.Distance > 1 && ch.Distance < 30) { Game.PrintMessage("HUNT... " + new UOPositionBase(ch.X, ch.Y, 0)); if (!r.GoTo(ch.X, ch.Y, 1, 5)) { break; } } } else { Game.Wait(2500); } } if (!ch.Exist) { if (isVladimirSkorp && World.Player.Backpack.Items.FindType(0x227B, 0x0697).Exist) { Game.UseTypeCust(0x227B, 0x0697, "nearestcorpse", "[Target]", "[Ladislav]"); } if (Game.CurrentGame.Mobs.Count > 0) { MobMaster.Current.MobCome(); } Game.PrintMessage("KILLED..."); Game.Wait(1500); current = null; break; } } else { Game.PrintMessage("Deny ADD " + ch.Name); deny.Add(ch.Serial); break; } } l.LootGround(Loot.LootType.QuickCut); if (chars.Count == 0 || chars.Count - deny.Count <= 0) { pathIndex++; if (pathIndex > posPath.Count - 1) { if (reversePath) { posPath.Reverse(); } pathIndex = 0; } Game.PrintMessage("Goto Next " + posPath[pathIndex]); deny.Clear(); Game.Wait(500); if (!r3.GoTo(posPath[pathIndex], 0, 500)) { Game.PrintMessage("Cant go to NEXT " + posPath[pathIndex]); continue; } else { Game.PrintMessage(posPath[pathIndex].ToString() + " - Com:" + posPath[pathIndex].CommandName); if (!String.IsNullOrEmpty(posPath[pathIndex].CommandName)) { if (posPath[pathIndex].CommandName.ToLower() == "opendoor") { ItemHelper.OpenDoorAll(); Game.Wait(); } } //,exec stayandfight 5 110 false true "5125.1152|5122.1163|5124.1178|5124.1185|5124.1185.0.OpenDoor|5124.1187.0.OpenDoor|5125.1188|5125.1198|5125.1209|5137.1208|5143.1207|5156.1208|5167.1209|5181.1209|5182.1212|5188.1211|5188.1201|5188.1193|5180.1193" Game.PrintMessage(String.Format("Zabito {0} za {1:N0} min. Gold: {2}, FD: {3}", htKilled.Values.Count, (DateTime.Now - startTime).TotalMinutes, World.Player.Gold - initGold, World.Player.Backpack.AllItems.FindType(0x103D, 0x0B52).Amount - initFD)); } } } }
//Serial: 0x40363D29 Name: "clean bandages" Position: 3167.30.26 Flags: 0x0020 Color: 0x0000 Graphic: 0x0E21 Amount: 29339 Layer: None Container: 0x00000000 //--------------------------------------------------------------------------------------------- public void TrainMob() { Game.CurrentGame.Mode = GameMode.Working; Game.PrintMessage("Vyber mob..."); UOCharacter mob = new UOCharacter(UIManager.TargetObject()); if (mob.Exist) { UO.Warmode(true); Game.Wait(); UO.Attack(mob); Game.Wait(); UO.WaitTargetSelf(); UO.Say("all kill"); while (!UO.Dead) { if ((mob.MaxHits > 0 && (decimal)mob.Hits / (decimal)mob.MaxHits <= 0.65m) || (World.Player.MaxHits > 0 && (decimal)World.Player.Hits / (decimal)World.Player.MaxHits <= 0.65m)) { UO.Say("all stop"); Game.Wait(); UO.Warmode(false); Game.Wait(); while (mob.Hits > 0 && mob.Hits < mob.MaxHits) { UOItem banda = World.Ground.FindType(0x0E21); if (banda.Exist) { banda.Use(); UO.WaitTargetObject(mob); Game.Wait(2500); } else { Game.PrintMessage("Neni banda..."); return; } } while (World.Player.Hits < World.Player.MaxHits) { UOItem banda = World.Ground.FindType(0x0E21); if (banda.Exist) { banda.Use(); UO.WaitTargetSelf(); Game.Wait(2500); } else { Game.PrintMessage("Neni banda..."); return; } } if (!World.Player.Backpack.Items.FindType(0x0F3F).Exist) { foreach (UOItem item in World.Player.Backpack.AllItems) { if (item.Graphic == 0x1EA0) { item.Use(); Game.Wait(); if (World.Player.Backpack.Items.FindType(0x0F3F).Exist) { break; } } } } UO.Warmode(true); Game.Wait(); UO.Attack(mob); Game.Wait(); UO.WaitTargetSelf(); UO.Say("all kill"); } else { Game.Wait(1000); UO.Attack(mob); } } } else { Game.PrintMessage("Mob neexistuje..."); } }
public void Battle(Serial target) { Journal.Clear(); Stoodup = false; UOCharacter enemy = new UOCharacter(target); UOItem weapon; var tmpCnt = World.Player.Layers.Count(x => x.Graphic == 0x1407 || x.Graphic == 0x1406); if (tmpCnt > 0) { weapon = new UOItem(World.Player.Layers.First(x => x.Graphic == 0x1407 || x.Graphic == 0x1406)); } else { MessageBox.Show("Nemas zbran "); return; } try { weapon.Equip(); try { UO.Attack(enemy); } catch { } Core.RegisterServerMessageCallback(0x6E, onStoodUp); while (!Journal.Contains(true, "Ziskala jsi ", "Ziskal jsi ", "gogo")) { if (enemy.Hits < 1 || enemy.Hits > 1000 || enemy.Dead) { break; } if (enemy.Distance > 1) { MoveTo(enemy.X, enemy.Y); } if (Journal.Contains("Vysavas zivoty!")) { Journal.SetLineText(Journal.Find("Vysavas zivoty!"), " "); UO.RunCmd("bandage"); weapon.Equip(); try { UO.Attack(enemy); } catch { } } while (!Stoodup) { if (enemy.Hits < 1 || enemy.Hits > 1000 || enemy.Dead) { break; } UO.Wait(300); } Stoodup = false; moveXField(6); UO.Wait(300); } } finally { var tmpCn = World.Player.Layers.Count(x => x.Graphic == 0x0F47 || x.Graphic == 0x0F48); if (tmpCn > 0) { new UOItem(World.Player.Layers.First(x => x.Graphic == 0x0F47 || x.Graphic == 0x0F48)).Equip(); } Core.UnregisterServerMessageCallback(0x6E, onStoodUp); } }
public void Track(int choice, bool war) { Track(choice); UO.Attack(Aliases.GetObject("laststatus")); }