Exemplo n.º 1
0
 public void Show()
 {
     UO.Print("Select");
     Show(UIManager.TargetObject());
 }
Exemplo n.º 2
0
        private void CheckCK()
        {
            World.FindDistance = 19;
            foreach (var ch in World.Characters)
            {
                if (ch.Notoriety > Notoriety.Criminal && ch.Notoriety < Notoriety.Invulnerable)
                {
                    int x = World.Player.X;
                    int y = World.Player.Y;
                    if (Humanoid.Any(c => c == ch.Model))
                    {
                        // CK

                        UO.Say(".potioninvis");
                        UO.Wait(100);
                        Recall(2);
                        System.Media.SoundPlayer my_wave_file = new System.Media.SoundPlayer(AlarmPath);
                        my_wave_file.Play();

                        while (!World.Player.Dead || World.Player.X == x || World.Player.Y == y)
                        {
                            UO.Wait(200);
                        }

                        UOItem dltmp = new UOItem(DoorLeft);
                        UOItem drtmp = new UOItem(DoorRight);
                        if (dltmp.Graphic == DoorLeftClosedGraphic)
                        {
                            dltmp.Use();
                        }
                        if (drtmp.Graphic == DoorRightClosedGraphic)
                        {
                            drtmp.Use();
                        }


                        UO.Wait(200);
                        MoveTo(HomeLocation);
                    }
                    else
                    {
                        ch.Click();
                        UO.Wait(200);
                        if (TopMonster.Any(c => c == ch.Name.ToLowerInvariant()))
                        {
                            if (ch.Distance > 0)
                            {
                                UO.Say(".potioninvis");
                                UO.Say(".recallhome");
                                System.Media.SoundPlayer my_wave_file = new System.Media.SoundPlayer(AlarmPath);
                                my_wave_file.Play();
                                while (!World.Player.Dead || World.Player.X == x || World.Player.Y == y)
                                {
                                    UO.Wait(200);
                                }
                            }
                        }
                        else
                        {
                            System.Media.SoundPlayer my_wave_file = new System.Media.SoundPlayer(AlarmPath);
                            my_wave_file.Play();

                            try
                            {
                                var myPos = new Point(World.Player.X, World.Player.Y);
                                Battle(ch.Serial);
                                UO.Wait(100);
                                MoveTo(myPos);
                            }
                            catch (Exception ex) { UO.PrintError(ex.Message); }
                        }
                    }
                    return;
                }
            }
        }
Exemplo n.º 3
0
        //---------------------------------------------------------------------------------------------

        public static HealInfo BandSafe(Serial serial, bool isAutoHeal)
        {
            HealInfo hInfo = new HealInfo();

            hInfo.HasBandages = Healing.CleanBandage.Exist;

            if (hInfo.HasBandages)
            {
                if (isAutoHeal && Game.CheckRunning())
                {
                    return(hInfo);
                }

                UOCharacter ch = new UOCharacter(serial);

                ch.PrintHitsMessage("[Banding...]");
                int ohits = new UOCharacter(serial).Hits;

                Game.RunScriptCheck(250);
                Journal.Clear();
                Targeting.ResetTarget();
                Healing.CleanBandage.Use();
                UO.WaitTargetObject(serial);

                DateTime start = DateTime.Now;
                //Vylecil jsi otravu!
                hInfo.Used = Journal.WaitForText(true, 3500, "You must be able to reach the target", "Chces vytvorit mumii?", "You put the bloody bandagess in your pack.", "You apply the bandages, but they barely help.", "Your target is already fully healed", "Vylecil jsi otravu!");
                int time = Convert.ToInt32((DateTime.Now - start).TotalMilliseconds);
                int wait = 2550 - time;

                if (Journal.Contains(true, "Nemuzes pouzit bandy na summona!"))
                {
                    hInfo.TryHealSummon = true;
                }
                if (Journal.Contains(true, "You must be able to reach the target"))
                {
                    hInfo.CantReach = true;
                }
                if (Journal.Contains(true, "Chces vytvorit mumii?") || Journal.Contains(true, "Your target is already fully healed"))
                {
                    hInfo.FullHealed = true;
                }
                if (Journal.Contains(true, "Vylecil jsi otravu!"))
                {
                    hInfo.CuredPoison = true;
                }

                hInfo.Success = Journal.Contains(true, "You put the bloody bandagess in your pack");
                hInfo.Failed  = Journal.Contains(true, "You apply the bandages, but they barely help");

                if (hInfo.CuredPoison)
                {
                    wait = 250;
                }

                wait += 1;

                if (wait > 0)
                {
                    Game.Wait(wait);
                }

                if (hInfo.CantReach)
                {
                    ch.PrintMessage("[Can't reach Band]" + (serial == World.Player.Serial ? " Self" : ""), Game.Val_LightGreen);
                }

                int hits = new UOCharacter(serial).Hits;
                int incr = hits - ohits;

                if (hInfo.Success && incr > 0)
                {
                    hInfo.Gain = incr;
                }
            }

            return(hInfo);
        }
Exemplo n.º 4
0
        public void Lumber()
        {
            try
            {
                int tmpx = 0, tmpy = 0;
                Check.Start();
                for (var x = HomeLocation.X - 50; x <= HomeLocation.X + 50; x++)
                {
                    for (var y = HomeLocation.Y - 50; y <= HomeLocation.Y + 50; y++)
                    {
                        var tmp = Field.GetField((ushort)x, (ushort)y);
                        if (tmp != null)
                        {
                            Fields.Add(tmp);
                        }
                    }
                }
                // Pripad kdy zaciname v domovske pozici - GH
                if (HomeDistance < 18)
                {
                    MoveTo(HomeLocation);
                    tmpx = World.Player.X;
                    tmpy = World.Player.Y;
                    Recall(1);
                }

                // Find trees and walkable fields
                for (var x = World.Player.X - 200; x <= World.Player.X + 200; x++)
                {
                    for (var y = World.Player.Y - 200; y <= World.Player.Y + 200; y++)
                    {
                        var tmp = Field.GetField((ushort)x, (ushort)y);
                        if (tmp != null)
                        {
                            Fields.Add(tmp);
                        }
                    }
                }



                UO.Print("Nacteno {0} poli", Fields.Count);
                while (World.Player.X == tmpx || World.Player.Y == tmpy)
                {
                    UO.Wait(200);
                }

                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();
                }

                UO.PrintInformation("Debug: hledani stromu");
                var tmptrees = Fields.Where(x => x.IsTree & x.Distance < 20 & (Math.Abs(x.Tree.Z - World.Player.Z) < 3) & (x.Tree.Harvested == DateTime.MinValue || (DateTime.Now - x.Tree.Harvested) > TimeSpan.FromMinutes(30))).ToList();
                tmptrees.Sort((x, y) => x.Distance.CompareTo(y.Distance));
                while (true)
                {
                    // znovu najde v okoli 20 poli stromy pokud predesly list je temer vytezen
                    UO.PrintInformation("Debug: hledani stromu");

                    if (tmptrees.Count(x => x.Tree.Harvested == DateTime.MinValue || (DateTime.Now - x.Tree.Harvested) > TimeSpan.FromMinutes(30)) < 1)
                    {
                        tmptrees = Fields.Where(x => x.IsTree & x.Distance < 20 & (Math.Abs(x.Tree.Z - World.Player.Z) < 3) & (x.Tree.Harvested == DateTime.MinValue || (DateTime.Now - x.Tree.Harvested) > TimeSpan.FromMinutes(30))).ToList();
                        tmptrees.Sort((x, y) => x.Distance.CompareTo(y.Distance));
                        if (tmptrees.Count < 2)
                        {
                            tmptrees = Fields.Where(x => x.IsTree & (Math.Abs(x.Tree.Z - World.Player.Z) < 3) & (x.Tree.Harvested == DateTime.MinValue || (DateTime.Now - x.Tree.Harvested) > TimeSpan.FromMinutes(30))).ToList();
                            tmptrees.Sort((x, y) => x.Distance.CompareTo(y.Distance));
                            tmptrees = tmptrees.Take(1).ToList();
                        }
                    }
                    UO.PrintWarning("Debug: nalezeno celkem {0} stromu, zbyva vytezit {1}", tmptrees.Count(x => x.IsTree), tmptrees.Count(x => x.Tree.Harvested == DateTime.MinValue || (DateTime.Now - x.Tree.Harvested) > TimeSpan.FromMinutes(30)));

                    UO.PrintInformation("Debug: hledani nejblizsiho stromu");
                    var trees = tmptrees.Where(x => x.IsTree & Math.Abs(x.Tree.Z - World.Player.Z) < 3 & (x.Tree.Harvested == DateTime.MinValue || (DateTime.Now - x.Tree.Harvested) > TimeSpan.FromMinutes(30))).ToList();

                    UO.PrintInformation("Debug: trizeni stromu");
                    trees.Sort((x, y) => x.Distance.CompareTo(y.Distance));
                    int tmpPi = 0;
                    var tmpP  = trees[tmpPi].ClosestWalkable;
                    UO.PrintInformation("Debug: hledani pole pro tezeni nalezeneho stromu");
                    while (tmpP.X == -1 || tmpP.Y == -1)
                    {
                        tmpP = trees[++tmpPi].ClosestWalkable;
                        if (tmpPi > 50)
                        {
                            UO.PrintError("Nenalezene stromy !!");
                            UO.TerminateAll();
                        }
                    }
                    UO.PrintInformation("Debug: presun ke stromu");
                    while (!MoveTo(tmpP))
                    {
                        UO.PrintError("Neuspesny presun na pozici");
                        UO.PrintInformation("Debug: hledani pole pro tezeni nasledujciho stromu");
                        tmpP = trees[++tmpPi].ClosestWalkable;
                        while (tmpP.X == -1 || tmpP.Y == -1)
                        {
                            tmpP = trees[++tmpPi].ClosestWalkable;
                            if (tmpPi > 50)
                            {
                                UO.PrintError("Nenalezene stromy !!");
                                UO.TerminateAll();
                            }
                        }
                    }

                    UO.PrintInformation("Debug: hledani stromu ve vzdalenosti 2 pole");
                    var tr = Fields.Where(x => x.IsTree & x.Distance < 3 & (x.Tree.Harvested == DateTime.MinValue || (DateTime.Now - x.Tree.Harvested) > TimeSpan.FromMinutes(30)));
                    UO.PrintInformation("Debug: tezeni okolnich stromu");
                    foreach (var tree in tr)
                    {
                        Mine(tree);
                        CheckCK();
                    }
                    UO.PrintInformation("Debug: Vytezeno");
                }
            }
            finally
            {
                Check.Stop();
            }
        }
Exemplo n.º 5
0
        private void Unload()
        {
            Recall(0);

            UOItem dltmp = new UOItem(DoorLeft);
            UOItem drtmp = new UOItem(DoorRight);

            if (dltmp.Graphic == DoorLeftClosedGraphic)
            {
                dltmp.Use();
            }
            if (drtmp.Graphic == DoorRightClosedGraphic)
            {
                drtmp.Use();
            }


            UO.Wait(200);
            MoveTo(HomeLocation);

            openBank(14);
            UO.Wait(500);
            UOItem box = new UOItem(LogsBox);

            box.Use();
            UO.Wait(500);
            UOItem resourceBox = new UOItem(ResourceBox);

            resourceBox.Use();
            UO.Wait(500);

            new UOItem(World.Player.Layers.First(x => x.Graphic == Log)).WaitTarget();
            UO.Say(".movetype");
            box.WaitTarget();
            UO.Wait(500);

            foreach (var it in World.Player.Backpack.Items.Where(x => x.Graphic == Log))
            {
                it.Move(ushort.MaxValue, box);
                UO.Wait(200);
            }

            UO.Wait(100);

            int tmpCnt = World.Player.Layers.Count(x => x.Graphic == 0x0F47 || x.Graphic == 0x0F48);

            if (tmpCnt == 0)
            {
                tmpCnt = resourceBox.AllItems.Count(x => x.Graphic == 0x0F47 || x.Graphic == 0x0F48);
                if (tmpCnt == 0)
                {
                    UO.PrintError("Nemas battle axe");
                    UO.TerminateAll();
                }
                else
                {
                    new UOItem(resourceBox.AllItems.First(x => x.Graphic == 0x0F47 || x.Graphic == 0x0F48)).Move(1, World.Player.Backpack);
                }
            }


            tmpCnt = World.Player.Layers.Count(x => x.Graphic == 0x1407 || x.Graphic == 0x1406);
            if (tmpCnt == 0)
            {
                tmpCnt = resourceBox.AllItems.Count(x => x.Graphic == 0x1407 || x.Graphic == 0x1406);
                if (tmpCnt == 0)
                {
                    UO.PrintError("Nemas war mace");
                    UO.TerminateAll();
                }
                else
                {
                    new UOItem(resourceBox.AllItems.First(x => x.Graphic == 0x1407 || x.Graphic == 0x1406)).Move(1, World.Player.Backpack);
                }
            }


            SelfFeed();
            resourceBox.Use();
            if (World.Player.Backpack.AllItems.FindType(0x1F4C).Amount < 8)
            {
                resourceBox.AllItems.FindType(0x1F4C).Move(9, World.Player.Backpack);
            }

            // GH
            if (World.Player.Backpack.AllItems.FindType(0x0F0E, 0x0160).Amount < 1)
            {
                resourceBox.AllItems.FindType(0x0F0E, 0x0160).Move(2, World.Player.Backpack);
            }

            // Invisky
            if (World.Player.Backpack.AllItems.FindType(0x0F0E, 0x0447).Amount < 1)
            {
                resourceBox.AllItems.FindType(0x0F0E, 0x0447).Move(2, World.Player.Backpack);
            }

            UO.Wait(200);
            Recall(1);
        }
Exemplo n.º 6
0
//    Serial: 0x400000AF  Position: 133.103.0  Flags: 0x0000  Color: 0x0000  Graphic: 0x097F  Amount: 1  Layer: None Container: 0x40276E6D

//Serial: 0x401BD51D  Name: "draw knife"  Position: 87.92.0  Flags: 0x0000  Color: 0x0000  Graphic: 0x10E4  Amount: 1  Layer: None Container: 0x40276E6D

//Serial: 0x40359906  Name: "raw fish steaks"  Position: 137.128.0  Flags: 0x0000  Color: 0x0000  Graphic: 0x097A  Amount: 915  Layer: None Container: 0x40276E6D

//Serial: 0x400000AF  Position: 133.103.0  Flags: 0x0000  Color: 0x0000  Graphic: 0x097F  Amount: 1  Layer: None Container: 0x40276E6D

//Serial: 0x40001905  Position: 3352.344.10  Flags: 0x0020  Color: 0x0000  Graphic: 0x097B  Amount: 3  Layer: None Container: 0x00000000


        //---------------------------------------------------------------------------------------------

        public void StartFishing()//Zatim jen zacatek uvidime jak to bude fachat
        {
            Journal.Clear();
            Game.CurrentGame.Mode = GameMode.Working;

            UOItem panvicka   = World.Player.Backpack.Items.FindType(ItemLibrary.Panvicka.Graphic);
            UOItem dwarfKnife = World.Player.Backpack.Items.FindType(ItemLibrary.DwarfKnife.Graphic, 0x0000);

            Game.PrintMessage("Panvicka: " + panvicka.Exist + " DwarfKnife: " + dwarfKnife.Exist);

            while (!World.Player.Dead)
            {
                if (PoleExist())
                {
                    bool end = false;

                    for (int x = -6; x < 7; x++)
                    {
                        List <UOItem> ground = new List <UOItem>();
                        ground.AddRange(World.Ground.ToArray());

                        foreach (UOItem groundItem in ground)
                        {
                            bool grab = true;

                            if (groundItem.Graphic == 0x097B)//upeceny steak
                            {
                                grab = false;
                            }

                            if (!panvicka.Exist || !dwarfKnife.Exist)
                            {
                                foreach (UOItemType fish in ItemLibrary.Fish)
                                {
                                    if (groundItem.Graphic == fish.Graphic && groundItem.Color == fish.Color)
                                    {
                                        grab = false;
                                    }
                                }
                            }

                            if (groundItem.Distance < 3 && grab)//groundItem.Graphic != 0x097B)//upeceny steak
                            {
                                groundItem.Move(60000, World.Player.Backpack);
                                Game.Wait();
                            }
                        }


                        if (panvicka.Exist && dwarfKnife.Exist)
                        {
                            List <UOItem> backpack = new List <UOItem>();
                            backpack.AddRange(World.Player.Backpack.Items.ToArray());

                            foreach (UOItem item in backpack)
                            {
                                bool cut = false;

                                foreach (UOItemType fish in ItemLibrary.Fish)
                                {
                                    if (item.Graphic == fish.Graphic && item.Color == fish.Color)
                                    {
                                        cut = true;
                                    }
                                }

                                if (cut)
                                {
                                    UO.WaitTargetObject(item.Serial);
                                    dwarfKnife.Use();
                                    Game.Wait();
                                }
                            }

                            int sychr = 0;
                            while (panvicka.Exist && World.Player.Backpack.Items.FindType(ItemLibrary.RawFishSteak.Graphic, ItemLibrary.RawFishSteak.Color).Exist&& sychr < 1500)
                            {
                                Journal.Clear();
                                UOItem rawSteak = World.Player.Backpack.Items.FindType(ItemLibrary.RawFishSteak.Graphic, ItemLibrary.RawFishSteak.Color);

                                UO.WaitTargetObject(rawSteak.Serial);
                                panvicka.Use();

                                if (!Journal.WaitForText(true, 5000 + Core.CurrentLatency, "...akce skoncila"))
                                {
                                    //end?
                                }
                                Game.Wait(50);

                                sychr++;
                            }


                            if (World.Player.Backpack.Items.FindType(0x097B, ItemLibrary.RawFishSteak.Color).Exist)
                            {
                                World.Player.Backpack.Items.FindType(0x097B, ItemLibrary.RawFishSteak.Color).DropHere(60000);
                                Game.Wait();
                            }

                            Game.Wait();
                        }

                        for (int y = -6; y < 7; y++)
                        {
                            bool enemyDetect;
                            bool worthItem;
                            while (FishTile(x, y, World.Player.Z, out enemyDetect, out worthItem))
                            {
                                if (enemyDetect)
                                {
                                    Game.PrintMessage("Monstrum aaaaaa...");

                                    while (World.Player.Hidden || !World.Player.Dead)
                                    {
                                        Game.CurrentGame.CurrentPlayer.UseMount(0);
                                        Game.Wait();
                                        Hiding.ExecHide();
                                        Game.Wait(3000);
                                    }

                                    if (World.Player.Dead)
                                    {
                                        end = true;
                                        break;
                                    }
                                    else
                                    {
                                        Game.CurrentGame.CurrentPlayer.UseMount(0);

                                        while (Characters.ExistEnemy())
                                        {
                                            Game.Wait(1000);
                                            Game.PrintMessage("Monstrum bojim bojim...");
                                        }
                                    }
                                    //TODO HID pres lamu dokud nezmizi
                                }

                                if (!PoleExist())
                                {
                                    end = true;
                                    break;
                                }
                            }
                            Game.Wait();
                        }



                        if (end)
                        {
                            break;
                        }
                    }

                    if (!end)
                    {
                        if (this.TryMoveNextPlace())
                        {
                            this.StartFishing();
                            return;
                        }
                        else
                        {
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }

            Game.PrintMessage("Rybareni dokonceno");
        }
Exemplo n.º 7
0
 public void lruneset()
 {
     UO.PrintWarning("Zamer runu do lesa a nasledne nahrej runy u postavy");
     LumbRune = UIManager.TargetObject();
 }
Exemplo n.º 8
0
        public static void MakeVlasce()
        {
            UO.Print("Vyber container s matrosem:");
            UOItem containerFrom = new UOItem(UIManager.TargetObject());

            ItemHelper.EnsureContainer(containerFrom);

            if (containerFrom.Exist)
            {
                while (containerFrom.Items.FindType(Thread.Graphic, Thread.Color).Amount > 4 && containerFrom.Items.FindType(IronWire.Graphic, IronWire.Color).Amount > 2)
                {
                    if (UO.Backpack.Items.FindType(Thread.Graphic, Thread.Color).Amount < 4)
                    {
                        UO.Backpack.Items.FindType(Vlasec.Graphic, Vlasec.Color).Move(100, containerFrom);
                        Game.Wait();
                        containerFrom.Items.FindType(Thread.Graphic, Thread.Color).Move(80, UO.Backpack);
                        Game.Wait();
                    }

                    if (UO.Backpack.Items.FindType(IronWire.Graphic, IronWire.Color).Amount < 2)
                    {
                        containerFrom.Items.FindType(IronWire.Graphic, IronWire.Color).Move(40, UO.Backpack);
                        Game.Wait();
                    }

                    while (UO.Backpack.Items.FindType(IronWire.Graphic, IronWire.Color).Amount >= 2 && UO.Backpack.Items.Count(IronString.Graphic, IronString.Color) < 2)
                    {
                        string[]           menus = new string[] { "Tinkering", "Wires", "Wires", "Iron String" };
                        JournalEventWaiter jew   = new JournalEventWaiter(true, "You put the", "Tinkering failed");
                        UO.WaitMenu(menus);
                        UOItem tools = UO.Backpack.Items.FindType(TinkersTools);
                        if (tools.Exist)
                        {
                            tools.Use();
                            jew.Wait(7500);
                            if (Journal.Contains(true, "You can't make anything with what you have"))
                            {
                                Journal.Clear();
                                break;
                            }
                        }
                        else
                        {
                            UO.Print("Nejsou toolsy.");
                            break;
                        }
                    }

                    if (UO.Backpack.Items.FindType(Thread.Graphic, Thread.Color).Amount >= 4 && UO.Backpack.Items.Count(IronString.Graphic, IronString.Color) >= 2)
                    {
                        JournalEventWaiter jew = new JournalEventWaiter(true, "You put the", "Tinkering failed");
                        UO.WaitMenu("Tinkering", "Wires", "Wires", "Vlasec");
                        UOItem tools = UO.Backpack.Items.FindType(TinkersTools);
                        if (tools.Exist)
                        {
                            tools.Use();
                            jew.Wait(7500);
                            if (Journal.Contains(true, "You can't make anything with what you have"))
                            {
                                Journal.Clear();
                                break;
                            }
                        }
                        else
                        {
                            UO.Print("Nejsou toolsy.");
                            break;
                        }
                    }
                }
            }

            Game.PrintMessage("Konec make vlasce");
        }
Exemplo n.º 9
0
        public void CopyKeys(int copiesNum)
        {
            Game.PrintMessage("Vyber kontejner s Blank klici a key ringy:");
            UOItem blankBag = new UOItem(UIManager.TargetObject());

            Game.PrintMessage("Pytlik nebo Key ring k okopirovani:");
            UOItem toCopyBag = new UOItem(UIManager.TargetObject());

            Game.PrintMessage("Pytlik kam davat klice:");
            UOItem targetBag = new UOItem(UIManager.TargetObject());

            ItemHelper.EnsureContainer(blankBag);

            int blankCount   = blankBag.Items.Count(ItemLibrary.BlankMagicKey.Graphic);
            int keyRingCount = blankBag.Items.Count(ItemLibrary.KeyRing0.Graphic);

            UOItemExtInfo extInfo = ItemHelper.GetItemExtInfo(toCopyBag, null);

            int  toCopyCount     = extInfo.Success ? extInfo.Charges.GetValueOrDefault() : toCopyBag.Items.Count(ItemLibrary.BlankMagicKey.Graphic);
            bool sourceIsKeyRing = false;

            if (keyRingCount > 0 && keyRingCount < copiesNum)
            {
                Game.PrintMessage("Neni dostatek Key ringu.");
                return;
            }

            if (blankCount < (copiesNum * toCopyCount))
            {
                Game.PrintMessage("Neni dostatek Blank Keys.");
                return;
            }

            List <UOItem> originals    = new List <UOItem>();
            List <Serial> keyRingItems = new List <Serial>();



            if (
                toCopyBag.Graphic == ItemLibrary.KeyRing1.Graphic ||
                toCopyBag.Graphic == ItemLibrary.KeyRing2.Graphic ||
                toCopyBag.Graphic == ItemLibrary.KeyRing3.Graphic)
            {
                sourceIsKeyRing = true;
                List <Serial> saveState = ItemHelper.ContainerState(World.Player.Backpack);
                UO.WaitTargetObject(toCopyBag);
                toCopyBag.Use();
                Game.Wait();

                keyRingItems = ItemHelper.ContainerStateDiff(saveState, ItemHelper.ContainerState(World.Player.Backpack));

                foreach (var ser in keyRingItems)
                {
                    UOItem itm = new UOItem(ser);
                    if (itm.Graphic == ItemLibrary.BlankMagicKey.Graphic && itm.Color == ItemLibrary.BlankMagicKey.Color)
                    {
                        originals.Add(itm);
                    }
                }
            }
            else
            {
                ItemHelper.EnsureContainer(toCopyBag);
                originals.AddRange(toCopyBag.Items.Where(itm => itm.Graphic == ItemLibrary.BlankMagicKey.Graphic && itm.Color == ItemLibrary.BlankMagicKey.Color).ToArray());
            }

            toCopyCount = originals.Count;

            Game.PrintMessage(String.Format("Ke kopirovani: {0}, prazdnych: {1}/{2}", toCopyCount, blankCount, keyRingCount));

            for (int i = 0; i < copiesNum; i++)
            {
                UOItem emptyKeyRing = blankBag.Items.FindType(ItemLibrary.KeyRing0.Graphic);
                if (keyRingCount == 0 || emptyKeyRing.Move(1, World.Player.Backpack))
                {
                    Game.Wait();
                    int counter = 0;
                    foreach (var orig in originals)
                    {
                        string origName = "";
                        if (orig.Container != World.Player.Backpack)
                        {
                            orig.Move(1, World.Player.Backpack);
                            Game.Wait();
                            ItemHelper.EnsureItem(orig);
                        }
                        origName = (orig.Name + String.Empty).Replace("Key to:", "");

                        if (String.IsNullOrEmpty(origName))
                        {
                            origName = "Klicek " + (counter + 1);
                        }

                        UOItem empty = blankBag.Items.FindType(ItemLibrary.BlankMagicKey.Graphic);

                        if (empty.Move(1, World.Player.Backpack))
                        {
                            Game.Wait();
                            UO.WaitTargetObject(empty);
                            orig.Use();
                            Game.Wait();

                            RenameKey(empty, origName);
                            Game.Wait();

                            if (emptyKeyRing.Exist && empty.Move(1, emptyKeyRing))
                            {
                                Game.Wait();
                            }
                            else if (targetBag.Exist && empty.Move(1, targetBag))
                            {
                                Game.Wait();
                            }
                        }
                        counter++;
                    }
                }
            }

            //     Serial: 0x4018E69C  Name: "Key to:calebovo novy"  Position: 62.119.0  Flags: 0x0000  Color: 0x0000  Graphic: 0x1012  Amount: 1  Layer: None Container: 0x4032F802



            if (sourceIsKeyRing)
            {
                Game.PrintMessage("Vracim klice");
                foreach (var ser in keyRingItems)
                {
                    UOItem itm = new UOItem(ser);
                    itm.Move(1, toCopyBag);
                    Game.Wait();
                }
            }
            else
            {
                foreach (var orig in originals)
                {
                    if (orig.Container != toCopyBag.Serial)
                    {
                        orig.Move(1, toCopyBag.Serial);
                        Game.Wait();
                    }
                }
            }

            Game.PrintMessage("KOnec.");
        }
Exemplo n.º 10
0
        //---------------------------------------------------------------------------------------------

        public void TrainMagery()
        {
            Game.PrintMessage("TrainMagery");
            Game.CurrentGame.Mode = GameMode.Working;
            while (!UO.Dead &&
                   World.Player.Backpack.AllItems.FindType(Reagent.Nightshade.Graphic, Reagent.Nightshade.Color).Exist&&
                   World.Player.Backpack.AllItems.FindType(Reagent.BlackPearl.Graphic, Reagent.BlackPearl.Color).Exist
                   )
            {
                while (World.Player.Mana > 10)
                {
                    if (World.Player.Hits < 40)
                    {
                        while (World.Player.Hits < World.Player.Strenght)
                        {
                            UOItem banda = World.Ground.FindType(0x0E21);//bandy
                            if (!banda.Exist)
                            {
                                return;
                            }

                            UO.WaitTargetSelf();
                            banda.Use();
                            Game.Wait(2500);
                        }
                    }

                    UO.Cast(StandardSpell.MagicArrow, Aliases.Self);
                    Game.Wait(1500);
                }

                while (World.Player.Hits < World.Player.Strenght)
                {
                    UOItem banda = World.Ground.FindType(0x0E21);//bandy
                    if (!banda.Exist)
                    {
                        break;
                    }

                    UO.WaitTargetSelf();
                    banda.Use();
                    Game.Wait(2500);
                }


                UOItem mrKad = new UOItem(World.Player.Backpack.Items.FindType(Potion.KadGraphic, Potion.ManaRefresh.TopKadColor));
                if (!mrKad.Exist)
                {
                    mrKad = World.Ground.FindType(Potion.KadGraphic, Potion.ManaRefresh.TopKadColor);
                }

                if (!mrKad.Exist)
                {
                    mrKad = World.Ground.FindType(Potion.KadGraphic, Potion.TotalManaRefresh.TopKadColor);
                }
                //       UOItem tmrKad = new UOItem(World.Player.Backpack.Items.FindType(Potion.KadGraphic, Potion.TotalManaRefresh.TopKadColor));
                if (mrKad.Exist)
                {
                    Game.CurrentGame.CurrentPlayer.GetSkillInstance <Alchemy>().DrinkPotion(Potion.ManaRefresh);
                    Game.Wait();
                }
                else
                {
                    while (World.Player.Mana < World.Player.Intelligence)
                    {
                        UO.UseSkill(StandardSkill.Meditation);
                        Game.Wait(2500);
                    }
                }
            }
            Game.PrintMessage("TrainMagery END");
        }
Exemplo n.º 11
0
        public void MakeWire(int quantity)
        {
            decimal itemMake = 0m;
            decimal itemFail = 0m;

            Journal.Clear();

            Game.PrintMessage("Jaky >");
            UOItem type          = new UOItem(UIManager.TargetObject());
            UOItem containerFrom = new UOItem(type.Container);

            Game.PrintMessage("Bagl do >");
            UOItem containerTo = new UOItem(UIManager.TargetObject());

            UOItemType t = new UOItemType();

            t.Graphic = type.Graphic;
            t.Color   = type.Color;

            type.Click();
            Game.Wait();

            String name = (type.Name + String.Empty).ToLower().Replace("ingot", "").Trim();

            name = name[0].ToString().ToUpper() + name.Substring(1, name.Length - 1).ToLower();

            Game.PrintMessage("" + name + " Wire");

            string[] menus = new string[] { "Tinkering", "Wires", "Wires", name + " Wire" };

            List <double> times = new List <double>();

            while (!UO.Dead && itemMake < quantity)
            {
                if (!World.Player.Backpack.Items.FindType(t.Graphic, t.Color).Exist)
                {
                    containerFrom.Items.FindType(t.Graphic, t.Color).Move(100, World.Player.Backpack);
                    Game.Wait();

                    if (World.Player.Backpack.Items.FindType(0x1876).Exist)
                    {
                        World.Player.Backpack.Items.FindType(0x1876).Move(10000, containerTo);
                        Game.Wait();
                    }

                    if (World.Player.Backpack.Items.FindType(0x1877).Exist)
                    {
                        World.Player.Backpack.Items.FindType(0x1877).Move(10000, containerTo);
                        Game.Wait();
                    }

                    if (World.Player.Backpack.Items.FindType(0x1878).Exist)
                    {
                        World.Player.Backpack.Items.FindType(0x1878).Move(10000, containerTo);
                        Game.Wait();
                    }

                    if (World.Player.Backpack.Items.FindType(0x1879).Exist)
                    {
                        World.Player.Backpack.Items.FindType(0x1879).Move(10000, containerTo);
                        Game.Wait();
                    }
                }

                DateTime start = DateTime.Now;


                UO.UseType(0x1EBC, 0x0000);
                UO.WaitMenu(menus);

                Journal.WaitForText(true, 8000, "You have failed to make anything", "You can't make anything", "You put", "Tinkering failed");
                if (Journal.Contains("You put"))
                {
                    itemMake++;
                }
                else
                {
                    itemFail++;
                }

                times.Add((DateTime.Now - start).TotalMilliseconds);

                if (Journal.Contains("You can't make anything"))
                {
                    Game.PrintMessage("Nemas suroviny");
                    break;
                }



                decimal okDivide       = (itemMake / (itemMake + itemFail));
                decimal okPerc         = okDivide * 100;
                double  etaMiliseconds = times.Average() * (double)(quantity - itemMake);

                Game.PrintMessage("Ks: " + itemMake + "/" + quantity + " - " + String.Format("{0:n} %", okPerc) + " ETA: " + (String.Format("{0:N2}", etaMiliseconds / 60000.0)));


                Journal.Clear();
            }
        }
Exemplo n.º 12
0
        //---------------------------------------------------------------------------------------------

        /// <summary>
        /// Obecne kouzleni hlava + svitky, svitky omezena podpora na to co je SpellScrool, co chybi napsat dodela. Nefunguje na nekro kouzla. Pokud je kouzlo vypsano nad hlavou zelene = SVITEK
        /// </summary>
        /// <param name="spell">Kouzlo</param>
        /// <param name="target">Cil = pokud Serial.Invalid resp. null tak vyhodi tercik</param>
        /// <param name="useScrool">Pouzij svitek, pokud je, jinak hlava</param>
        /// <param name="useSwitchHeadScrool">Stridej svitek a hlavu, tj. uchovava si ke kazdemu kouzlo co bylo kouzleno naposled</param>
        /// <param name="silence">Nevypise nad hlavu jmeno kouzla + lvl, pouziva se v kodu kde chcete si vypadt neco extra</param>
        /// <param name="forceScrool">Vynutit svite, pokud neni svitek tak nekouzli a v CastResiltInfu vrat FALSe</param>
        /// <returns></returns>
        public CastResultInfo CastSpell(StandardSpell spell, TargetAliasResult target, bool useScrool, bool useSwitchHeadScrool, bool silence, bool forceScrool)
        {
            Game.CheckStopBanding();
            Targeting.ResetTarget();
            Journal.Clear();

            CastResultInfo info = new CastResultInfo();

            info.Usage = useScrool ? CastUsage.Scrool : CastUsage.Head;

            if (htSwitch == null)
            {
                htSwitch = new Hashtable();
            }

            int circle = GetSpellCircle(spell);

            UOCharacter ch = new UOCharacter(target);

            if (ch.Exist && String.IsNullOrEmpty(ch.Name))
            {
                ch.Click();
                Game.Wait(50, true);
            }

            if (spell == StandardSpell.SummonCreature && !String.IsNullOrEmpty(this.selectedSummon))
            {
                Game.RunScript(5000);
                this.CastSummonCreature(this.selectedSummon, target);
            }
            else
            {
                if (htSwitch[spell] == null)
                {
                    htSwitch[spell] = info.Usage;
                }
                else if (useSwitchHeadScrool && !forceScrool)
                {
                    CastUsage currentUsage = (CastUsage)htSwitch[spell];
                    if (currentUsage == CastUsage.Head)
                    {
                        info.Usage = CastUsage.Scrool;
                    }
                    else
                    {
                        info.Usage = CastUsage.Head;
                    }
                }

                bool waitForScrool = false;
                if (info.Usage == CastUsage.Scrool && lastScrool.HasValue)// && !forceScrool)
                {
                    double currentTimeout = GetScroolTimeout();
                    double currentTime    = (DateTime.Now - lastScrool.Value).TotalSeconds;

                    if (currentTime < currentTimeout)
                    {
//            waitForScrool = true;
//            if (!forceScrool)
//              info.Usage = CastUsage.Head;
                        Game.PrintMessage(String.Format("Scroll za! {0:N1}s", currentTimeout - currentTime));
                    }
                }

                //TODO zjistit Flag na jsem parnutej
                if (info.Usage == CastUsage.Scrool && !waitForScrool)
                {
                    if (SpellScrool.ContainsKey(spell) && World.Player.Backpack.AllItems.FindType(SpellScrool[spell]).Exist)
                    {
                        if (!target.IsStatic && (!target.IsValid || !new UOObject(target).Exist))
                        {
                            Magery.TrySetCastingSpell(new CastSpellInfo(spell, true, silence));
                            World.Player.Backpack.AllItems.FindType(SpellScrool[spell]).Use();

                            if (!Journal.WaitForText(true, 250, "You can't reach that", "You can't cast", "You can't read that"))
                            {
                                lastScrool   = DateTime.Now.AddMilliseconds(-250);
                                info.Usage   = CastUsage.Scrool;
                                info.Success = true;
                            }
                            else if (!forceScrool)
                            {
                                info.Usage = CastUsage.Head;
                            }
                        }
                        else
                        {
                            Magery.TrySetCastingSpell(new CastSpellInfo(spell, true, true));

                            target.WaitTarget();
                            //UO.WaitTargetObject(target);
                            World.Player.Backpack.AllItems.FindType(SpellScrool[spell]).Use();

                            if (!Journal.WaitForText(true, 250, "You can't reach that", "You can't cast", "You can't read that"))
                            {
                                lastScrool   = DateTime.Now.AddMilliseconds(-250);
                                info.Usage   = CastUsage.Scrool;
                                info.Success = true;
                            }
                            else if (!forceScrool)
                            {
                                info.Usage = CastUsage.Head;
                            }
                        }
                    }
                    else if (!forceScrool)
                    {
                        info.Usage = CastUsage.Head;
                    }
                }

                ushort color = CalStatusMessage.Val_InfoColor;
                //if (info.Usage == CastUsage.Scrool)
                //{
                //  color = Game.Val_Green;
                //  if (!silence)
                //    World.Player.PrintMessage(spell + " [" + World.Player.Backpack.AllItems.FindType(SpellScrool[spell]).Amount + "ks]", color);
                //}

                htSwitch[spell] = info.Usage;

                if (info.Usage == CastUsage.Head)
                {
                    //Game.RunScript(Magery.GetCircleRunscriptTime(Magery.GetSpellCircle(spell)));

                    if (!target.IsStatic && (!target.IsValid || !new UOObject(target).Exist || new UOObject(target).Distance > 30))
                    {
                        Magery.TrySetCastingSpell(new CastSpellInfo(spell, false, silence));
                        UO.Cast(spell);
                    }
                    else
                    {
                        Magery.TrySetCastingSpell(new CastSpellInfo(spell, false, true));
                        target.WaitTarget();
                        UO.Cast(spell);//, target);

                        if (Journal.WaitForText(true, 150, "You can't see the target", "Target is not in line of sight"))
                        {
                            if (Journal.Contains(true, "You can't see the target"))
                            {
                                info.CantSee = true;

                                Game.PrintMessage("Cant SEE: " + target + " / " + new UOCharacter(target).Exist + " / " + new UOCharacter(target).Name);

                                info.Success = CastSpell(spell, Serial.Invalid, useScrool, useSwitchHeadScrool, silence, forceScrool).Success;
                            }
                            else if (Journal.Contains(true, "Target is not in line of sight"))
                            {
                                info.NoInLineOfSight = true;

                                new UOObject(target).PrintMessage("[Not in sight]", Game.Val_LightPurple);
                            }
                        }
                        else
                        {
                            if (ch.Exist && !silence &&
                                (spell == StandardSpell.Harm ||
                                 spell == StandardSpell.FlameStrike ||
                                 spell == StandardSpell.MagicArrow ||
                                 spell == StandardSpell.Lightning ||
                                 spell == StandardSpell.Clumsy ||
                                 spell == StandardSpell.Curse ||
                                 spell == StandardSpell.EnergyBolt ||
                                 spell == StandardSpell.Feeblemind ||
                                 spell == StandardSpell.MindBlast ||
                                 spell == StandardSpell.Paralyze)
                                )
                            {
                                if (target != World.Player.Serial && target.IsValid)
                                {
                                    new UOObject(target).PrintMessage(String.Format("[{0}/{1}]", ch.Hits, ch.MaxHits), ch.Notoriety == Notoriety.Murderer || ch.Notoriety == Notoriety.Enemy ? Game.GetEnemyColorByHits(target) : Game.GetAlieColorByHits(target));
                                }
                            }
                        }
                    }

                    if (Journal.WaitForText(true, 100, "The spell is not in your spellbook"))
                    {
                        info.Success        = false;
                        info.NotInSpellBook = true;
                        Targeting.ResetTarget();
                    }
                    else if (!info.CantReach)
                    {
                        info.Success = true;
                    }
                }
                else
                {
                    Game.PrintMessage(spell + ": " + World.Player.Backpack.AllItems.FindType(SpellScrool[spell]).Amount + "");
                }
            }


            return(info);
        }
Exemplo n.º 13
0
 public void Track(int choice, bool war)
 {
     Track(choice);
     UO.Attack(Aliases.GetObject("laststatus"));
 }
Exemplo n.º 14
0
 public void Track(string var)
 {
     UO.PrintError("Spatny parametr");
     Track();
 }
Exemplo n.º 15
0
        public void TrainPoisEngage()
        {
            if (IsRunning)
            {
                return;
            }
            IsRunning = true;

            UOItem trainKit = World.Player.Backpack.AllItems.FindType(TrainKit.Graphic, TrainKit.Color);

            if (trainKit.Exist)
            {
                IsRunning = true;
                List <UOCharacter> characters = new List <UOCharacter>();
                characters.AddRange(World.Characters.ToArray());
                var fiter = characters.Where(ch => (ch.Notoriety != Notoriety.Guild && (ch.Notoriety == Notoriety.Enemy || ch.Notoriety == Notoriety.Murderer || ch.Notoriety == Notoriety.Criminal || ch.Notoriety == Notoriety.Neutral)) &&
                                             ch.Serial != World.Player.Serial &&
                                             ch.Distance <= 1 &&
                                             !Game.IsMob(ch.Serial) &&
                                             !Game.IsMobRenamed(ch.Serial) &&
                                             !ch.Renamable &&
                                             !(ItemLibrary.IsMostCommonPlayerSummon(ch)));

                int  done    = 0;
                bool success = false;

                foreach (UOCharacter ch in fiter)
                {
                    if (!this.doneList.Contains(ch.Serial))
                    {
                        Game.RunScriptCheck(1000);
                        Game.CurrentGame.CurrentPlayer.SwitchWarmode();
                        Game.Wait(250);
                        UO.WaitTargetObject(ch.Serial);
                        trainKit.Use();

                        JournalEventWaiter jew = new JournalEventWaiter(true, "Uspesne jsi otravil svuj cil", "Kdyz se snazis pracovat s jedem, nemel bys delat nic jineho", "Na tomhle nemuzes trenovat", "Z teto nestvury se nic noveho nenaucis", "Na cili j*z nekdo trenoval");//todo
                        jew.Wait(500);

                        if (Journal.Contains(true, "Uspesne jsi otravil svuj cil", "Na tomhle nemuzes trenovat", "Z teto nestvury se nic noveho nenaucis", "Na cili j*z nekdo trenoval"))
                        {
                            this.doneList.Add(ch.Serial);
                            success = true;
                        }

                        Journal.Clear();
                        break;
                    }
                    else
                    {
                        done++;
                    }
                }

                if (!success && done > 0)
                {
                    World.Player.PrintMessage("Vse okolo poisnuto!");
                }
                else if (fiter.Count() == 0)
                {
                    World.Player.PrintMessage("Nic k poisnuti!");
                }
            }
            else
            {
                World.Player.PrintMessage("Nemas pois KIT");
            }

            IsRunning = false;
        }
Exemplo n.º 16
0
        public static void EnchantBySitickoBlood()
        {
            if (!World.Player.Backpack.Items.FindType(0x1EBC, 0x0000).Exist)
            {
                Game.PrintMessage("Nemas tools");
                return;
            }

            if (!World.Player.Backpack.Items.FindType(0x0F9D, 0x047F).Exist)
            {
                Game.PrintMessage("Nemas magicke siticko");
                return;
            }

            Game.PrintMessage("Vyber container s Blood, Rose, Shadow ingy");
            UOItem containerIngotFrom = new UOItem(UIManager.TargetObject());

            Game.PrintMessage("Vyber container s brnenim");
            UOItem containerArmorFrom = new UOItem(UIManager.TargetObject());

            containerArmorFrom.Use();
            Game.Wait();
            containerIngotFrom.Use();
            Game.Wait();

            List <UOItem> sourceItems = new List <UOItem>();

            sourceItems.AddRange(containerArmorFrom.Items.ToArray());

            int           counter = 0;
            List <double> times   = new List <double>();

            foreach (UOItem armor in sourceItems)
            {
                counter++;
                DateTime start = DateTime.Now;

                if (!armor.Move(1, World.Player.Backpack))
                {
                    continue;
                }

                Game.Wait();

                while (World.Player.Backpack.Items.FindType(0x1876, 0x0665).Amount < 15)
                {
                    UO.DeleteJournal();

                    if (!World.Player.Backpack.Items.FindType(0x1BEF, 0x0665).Exist)
                    {
                        containerIngotFrom.Items.FindType(0x1BEF, 0x0665).Move(15, World.Player.Backpack);
                        Game.Wait();
                    }

                    string[] menus = new string[] { "Tinkering", "Wires", "Wires", "Rose Wire" };

                    UO.UseType(0x1EBC, 0x0000);
                    UO.WaitMenu(menus);

                    Journal.WaitForText(true, 8000, "You have failed to make anything", "You can't make anything", "You put", "Tinkering failed");

                    if (Journal.Contains("You can't make anything"))
                    {
                        Game.PrintMessage("Nemas suroviny");
                        armor.Move(1, containerArmorFrom.Serial);
                        return;
                    }
                }

                while (World.Player.Backpack.Items.FindType(0x1876, 0x0770).Amount < 15)
                {
                    UO.DeleteJournal();

                    if (!World.Player.Backpack.Items.FindType(0x1BEF, 0x0770).Exist)
                    {
                        containerIngotFrom.Items.FindType(0x1BEF, 0x0770).Move(15, World.Player.Backpack);
                        Game.Wait();
                    }

                    string[] menus = new string[] { "Tinkering", "Wires", "Wires", "Shadow Wire" };

                    UO.UseType(0x1EBC, 0x0000);
                    UO.WaitMenu(menus);

                    Journal.WaitForText(true, 8000, "You have failed to make anything", "You can't make anything", "You put", "Tinkering failed");

                    if (Journal.Contains("You can't make anything"))
                    {
                        Game.PrintMessage("Nemas suroviny");
                        armor.Move(1, containerArmorFrom.Serial);
                        return;
                    }
                }

                while (World.Player.Backpack.Items.FindType(0x1876, 0x04C2).Amount < 15)
                {
                    UO.DeleteJournal();

                    if (!World.Player.Backpack.Items.FindType(0x1BEF, 0x04C2).Exist)
                    {
                        containerIngotFrom.Items.FindType(0x1BEF, 0x04C2).Move(15, World.Player.Backpack);
                        Game.Wait();
                    }

                    string[] menus = new string[] { "Tinkering", "Wires", "Wires", "Blood Rock Wire" };

                    UO.UseType(0x1EBC, 0x0000);
                    UO.WaitMenu(menus);

                    Journal.WaitForText(true, 8000, "You have failed to make anything", "You can't make anything", "You put", "Tinkering failed");

                    if (Journal.Contains("You can't make anything"))
                    {
                        Game.PrintMessage("Nemas suroviny");
                        armor.Move(1, containerArmorFrom.Serial);
                        return;
                    }
                }

                Game.Wait();

                World.Player.Backpack.Items.FindType(0x0F9D, 0x047F).Use();
                UO.WaitTargetObject(armor);

                Game.Wait();
                armor.Move(1, containerArmorFrom.Serial);
                Game.Wait();

                times.Add((DateTime.Now - start).TotalMilliseconds);

                double etaMiliseconds = times.Average() * (double)(sourceItems.Count - counter);

                Game.PrintMessage(counter + "/" + sourceItems.Count + " ETA: " + (String.Format("{0:N2} min.", etaMiliseconds / 60000.0)));
            }
        }
Exemplo n.º 17
0
 public static void Snap(string fileName)
 {
     fileName = Path.ChangeExtension(fileName, "bmp");
     CaptureWindowToFile(UO.ClientWindow.Handle, fileName, ImageFormat.Bmp);
     UO.ClientPrint("Screenshot: " + Path.GetFileName(fileName));
 }
Exemplo n.º 18
0
 public RailMiner(UO uO)
 {
     this.UOD = uO;
 }
Exemplo n.º 19
0
        public static List <EnemyInfo> GetEnemyList(List <UOCharacter> chars, IUOPosition center)
        {
            List <EnemyInfo> enemyList = new List <EnemyInfo>();

            foreach (UOCharacter ch in chars)//World.Characters)
            {
                if (Game.CurrentGame.IsAlie(ch.Serial) || Game.CurrentGame.IsHealAlie(ch.Serial))
                {
                    continue;
                }

                EnemyInfo enemy = new EnemyInfo();
                enemy.Char       = ch;
                enemy.Damage     = (ch.MaxHits - ch.Hits);
                enemy.Perc       = (((decimal)(ch.MaxHits - ch.Hits) / (decimal)ch.MaxHits) * 100.0m) / (decimal)ch.MaxHits;
                enemy.DamagePerc = ((decimal)(ch.MaxHits - ch.Hits) / (decimal)ch.MaxHits) * 100.0m;
                enemy.Distance   = Robot.GetRelativeVectorLength(center, UOPositionBase.CharacterPosition(ch));

                if (enemy.Distance <= 5)
                {
                    enemy.Zone = 0;
                }
                else if (enemy.Distance <= 10)
                {
                    enemy.Zone = 1;
                }
                else if (enemy.Distance <= 15)
                {
                    enemy.Zone = 2;
                }
                else
                {
                    enemy.Zone = 3;
                }

                if (String.IsNullOrEmpty(ch.Name))
                {
                    ch.Click();
                    UO.Wait(100);
                }

                if ((String.Empty + ch.Name).ToLower().Contains("mirror") && ch.MaxHits >= 255)
                {
                    enemy.Priority = 100;
                }
                else if ((String.Empty + ch.Name).ToLower().Contains("chameleon"))
                {
                    enemy.Priority = ch.MaxHits;
                }
                else if ((String.Empty + ch.Name).ToLower().Contains("lethargy"))
                {
                    enemy.Priority = ch.MaxHits;
                }
                else if ((String.Empty + ch.Name).ToLower().Contains("lethargy"))
                {
                    enemy.Priority = ch.MaxHits;
                }
                else if ((String.Empty + ch.Name).ToLower().Contains("acid ooze"))
                {
                    enemy.Priority = ch.MaxHits;
                }
                else if ((String.Empty + ch.Name).ToLower().Contains("bird"))
                {
                    enemy.Priority = ch.MaxHits - 100;
                }

                if (enemy.Char.Notoriety == Notoriety.Enemy || enemy.Char.Notoriety == Notoriety.Murderer)
                {
                    enemy.Priority += 1000;
                }

                enemyList.Add(enemy);
            }
            return(enemyList);
        }
Exemplo n.º 20
0
        public void TrainTamingRecusive(int maxTries, int maxCharDistance, params string[] positionsDefinition)
        {
            Robot r = new Robot();

            r.UseTryGoOnly     = true;
            r.UseMinWait       = true;
            r.UseRun           = true;
            r.SearchSuqareSize = 450;

            this.doneList = new List <Serial>();

            string[] locations = positionsDefinition;

            Game.PrintMessage("TrainTamingRecusive START " + maxTries + ", " + maxCharDistance + ", " + positionsDefinition.Length);
            Game.Wait(1000);

            foreach (string loc in locations)
            {
                string[] options = loc.Split('|');

                int    button   = -1;
                string bookType = "r";

                if (!String.IsNullOrEmpty(options[0]) && Regex.IsMatch(options[0], "(?<booktype>[a-z])(?<button>\\d{1,2})"))
                {
                    Match m = Regex.Match(options[0], "(?<booktype>[a-z])(?<button>\\d{1,2})");
                    bookType = m.Groups["booktype"].Value.ToLower();
                    button   = Int32.Parse(m.Groups["button"].Value);
                }

                if (button > -1)
                {
                    string book = "RuneBookUse";
                    if (bookType == "t")
                    {
                        Phoenix.Runtime.RuntimeCore.Executions.Execute(Phoenix.Runtime.RuntimeCore.ExecutableList["TravelBookUse"], 1);
                        UO.Wait(1000);
                        book = "TravelBookUse";
                    }
                    else if (bookType == "c")
                    {
                        Phoenix.Runtime.RuntimeCore.Executions.Execute(Phoenix.Runtime.RuntimeCore.ExecutableList["CestovniKnihaUse"], 1);
                        UO.Wait(1000);
                        book = "CestovniKnihaUse";
                    }



                    bool teleported = false;
                    while (!teleported)
                    {
                        UO.DeleteJournal();

                        Phoenix.Runtime.RuntimeCore.Executions.Execute(RuntimeCore.ExecutableList[book], button);
                        Game.Wait(500);
                        if (!World.Player.Hidden)
                        {
                            UO.UseSkill("Hiding");
                        }

                        UO.Print("Cekam na kop.. nehybat");

                        if (Journal.WaitForText(true, 2000, "Nesmis vykonavat zadnou akci"))
                        {
                            Game.CurrentGame.CurrentPlayer.SwitchWarmode();
                            Game.Wait(1000);
                        }
                        else if (Journal.WaitForText(true, 120000, "You have been teleported"))
                        {
                            teleported = true;
                        }

                        if (Game.CurrentGame.WorldSave())
                        {
                            UO.Print("WS opakovani kopu za 45s");
                            Game.Wait(45000);
                            if (bookType == "t")
                            {
                                Phoenix.Runtime.RuntimeCore.Executions.Execute(Phoenix.Runtime.RuntimeCore.ExecutableList["TravelBookUse"], 1);
                                UO.Wait(1000);
                            }
                            Game.Wait(500);
                        }
                    }
                }

                for (int i = (button > -1 ? 1 : 0); i < options.Length; i++)
                {
                    if (UO.Dead)
                    {
                        return;
                    }

                    string[] parm = options[i].Split('.');

                    string   x         = parm[0];
                    string[] y         = parm[1].Split(new string[] { "//" }, StringSplitOptions.RemoveEmptyEntries);
                    string   placeName = "";
                    if (y.Length > 1)
                    {
                        placeName = y[1];
                    }


                    UOPositionBase pos = new UOPositionBase(ushort.Parse(x), ushort.Parse(y[0]), (ushort)0);

                    int distance = parm.Length > 2 ? UOExtensions.Utils.ToNullInt(parm[2]).GetValueOrDefault(1) : 1;
                    int gotries  = parm.Length > 3 ? UOExtensions.Utils.ToNullInt(parm[3]).GetValueOrDefault(1000) : 1000;

                    Game.PrintMessage("GoTo: " + pos);
                    if (r.GoTo(pos, distance, gotries))
                    {
                        Game.PrintMessage("In position: " + pos);

                        if (parm[parm.Length - 1].ToLower() == "opendoor")
                        {
                            ItemHelper.OpenDoorAll();
                            Game.Wait();


                            if (World.Player.Layers[Layer.OuterTorso].Exist)
                            {
                                World.Player.Layers[Layer.OuterTorso].Move(1, World.Player.Backpack);
                                Game.Wait();
                            }
                        }

                        List <UOCharacter> characters = new List <UOCharacter>();
                        characters.AddRange(World.Characters.Where(c => !doneList.Contains(c.Serial)));
                        characters.Sort(delegate(UOCharacter char1, UOCharacter char2)
                        {
                            return(char1.Distance.CompareTo(char2.Distance));
                        });

                        foreach (UOCharacter character in characters)
                        {
                            if (UO.Dead)
                            {
                                return;
                            }

                            Game.Wait(50);

                            if (character.Distance < maxCharDistance && character.Serial != World.Player.Serial && character.Model != 0x0190 && character.Model != 0x0191 && character.Model != 0x0192)
                            {
                                doneList.Add(character);

                                SkillValue atSkill = SkillsHelper.GetSkillValue("Animal Taming");
                                bool       isBird  = character.Model == 0x0006;
                                bool       tryKill = atSkill.RealValue > 450 && maxTries < 100;
                                bool       tame    = true;

                                if (isBird)
                                {
                                    if (tryKill)
                                    {
                                        World.Player.PrintMessage("Try Kill.");
                                        UO.Cast(StandardSpell.Harm, character.Serial);
                                        Game.Wait(3000);

                                        if (character.Exist)
                                        {
                                            UO.Cast(StandardSpell.Harm, character.Serial);
                                            Game.Wait(2500);
                                        }
                                    }
                                    tame = atSkill.RealValue < 450;
                                    //World.Player.PrintMessage("Try Kill result: " + KillCharacter(character));
                                }

                                if (Game.Debug)
                                {
                                    Game.PrintMessage("Bird: " + isBird + ", Tame: " + tame + ", Kill: " + tryKill + ", Skill: " + atSkill.Value);
                                }

                                if (tame && r.GoTo(character.GetPosition(), 2, 25))
                                {
                                    this.TameCharacter(character, maxTries);
                                }
                            }
                        }
                    }
                }

                Game.PrintMessage("NextLocation");
                Game.Wait(1000);
            }

            if (UO.Dead)
            {
                return;
            }

            TrainTamingRecusive(maxTries, maxCharDistance, positionsDefinition);
        }
Exemplo n.º 21
0
 public void lhomeloc()
 {
     UO.PrintWarning("Aktualni poloha ulozena vychozi, mela by mit nadosah runy a jidlo");
     HomeLocation = new Point(World.Player.X, World.Player.Y);
 }
Exemplo n.º 22
0
        public void TameCharacter(UOCharacter character, int maxTries, bool keepDisttance)//, Robot r)
        {
            Game.CurrentGame.CurrentPlayer.SwitchWarmode();

            Robot r = new Robot();

            r.UseTryGoOnly     = true;
            r.SearchSuqareSize = 20;

            UOItem currentStaff = EnsuredTamingStaff;
            int    tries        = 0;

            if (Game.Debug)
            {
                Game.PrintMessage(String.Format("{0}, {1}, {2}, {3}, {4}", character.Exist, character.RequestStatus(500), character.Hits, character.Distance, UO.Dead));
            }

            while (character.Exist && character.RequestStatus(500) && character.Hits > 0 && character.Distance < 6 && !UO.Dead)
            {
                UO.DeleteJournal();

                bool end  = false;
                bool kill = false;

                if (character.Distance > 3 && keepDisttance)
                {
                    r.GoTo(new UOPositionBase(character.X, character.Y, 0), 2, 2);
                    Game.Wait(500);
                }

                UO.UseSkill("Hiding");
                Game.Wait(250);

                if (World.Player.Hidden)
                {
                    UO.Say(" ");
                    Game.Wait(250);
                }

                IRequestResult result = UO.WaitTargetObject(character.Serial);
                currentStaff.Use();

                //Game.Wait(500);
                SkillValue tamingValue = SkillsHelper.GetSkillValue("AnimalTaming");
                UOItem     robe        = World.Player.Layers[Layer.OuterTorso];
                Game.PrintMessage("RV: " + tamingValue.RealValue + " / " + robe.Exist);

                using (JournalEventWaiter jew = new JournalEventWaiter(true,
                                                                       "You can't see the target",
                                                                       "Ochoceni se nezdarilo",
                                                                       "Your taming failed",
                                                                       "byl tamnut",
                                                                       "not tamable",
                                                                       "You are not able to tame",
                                                                       "Jsi moc daleko",
                                                                       "Jeste nemuzes pouzit hulku",
                                                                       "Toto zvire nelze ochocit",
                                                                       "Toto zvire nedokazes ochocit",
                                                                       "You are not able to tame this animal"

                                                                       ))
                {
                    if (jew.Wait(15000))
                    {
                        if (Journal.Contains(true, "Ochoceni se nezdarilo"))
                        {
                            Game.PrintMessage("Try - Ochoceni se nezdarilo");
                        }
                        else if (Journal.Contains(true, "Your taming failed"))
                        {
                            Game.PrintMessage("Try - Your taming failed");
                        }
                        else if (Journal.Contains(true, "Jeste nemuzes pouzit hulku"))
                        {
                            Game.PrintMessage("Try - Jeste nemuzes pouzit hulku");
                            Game.Wait(6000);
                        }
                        else if (Journal.Contains(true, "Jsi moc daleko"))
                        {
                            if (keepDisttance)
                            {
                                bool go = r.GoTo(new UOPositionBase(character.X, character.Y, 0), 1, 10);
                                if (!go)
                                {
                                    end = true;
                                }
                                Game.Wait();
                                Game.PrintMessage("Try - Jsi moc daleko: " + go);
                            }
                        }
                        else if (Journal.Contains(true, "You can't see the target"))
                        {
                            UO.WaitTargetCancel();
                            Game.Wait();
                            UO.Press(System.Windows.Forms.Keys.Escape);
                            Game.Wait();
                            Game.CurrentGame.CurrentPlayer.SwitchWarmode();
                            Game.Wait();
                            bool go = r.GoTo(new UOPositionBase(character.X, character.Y, 0), 1, 10);
                            if (!go)
                            {
                                end = true;
                            }
                            Game.Wait();

                            Game.PrintMessage("Try - You can't see the target go: " + go);
                        }
                        else if (Journal.Contains(true, "byl tamnut"))// && currentStaff.Color == TamingStaff.Color)
                        {
                            Game.PrintMessage("End - byl tamnut");
                            end = true;
                        }
                        else if (Journal.Contains(true, "not tamable") || Journal.Contains(true, "Toto zvire nelze ochocit"))
                        {
                            character.Click();
                            Game.Wait(500);
                            character.RequestStatus(500);

                            bool isTrofejAnimal = false;// TrofejKlamaci.Contains(character.Model);

                            foreach (Graphic g in TrofejKlamaci)
                            {
                                if (g == character.Model)
                                {
                                    isTrofejAnimal = true;
                                }
                            }


                            if (isTrofejAnimal && character.Notoriety != Notoriety.Innocent && character.Notoriety != Notoriety.Invulnerable && character.Notoriety != Notoriety.Guild)//krysa/hind/bear/goat/snake atd)TODO
                            {
                                kill = true;
                                //zabit / riznout / vylotit
                                Game.PrintMessage("Kill - not tamable " + character.Model);
                            }
                            else
                            {
                                Game.PrintMessage("End - not tamable");
                                end = true;
                            }
                        }
                        else if (Journal.Contains(true, "Toto zvire nedokazes ochocit") || Journal.Contains(true, "You are not able to tame this animal"))
                        {
                            if (World.Player.Backpack.AllItems.FindType(0x1F03).Exist)
                            {
                                World.Player.Backpack.AllItems.FindType(0x1F03).Use();
                                Game.Wait(500);
                            }
                            else if (World.Player.Backpack.AllItems.FindType(0x1F01).Exist)
                            {
                                World.Player.Backpack.AllItems.FindType(0x1F01).Use();
                                Game.Wait(500);
                            }

                            if (tries > 1)
                            {
                                Game.PrintMessage("End - Nelze ochocit " + character.Serial);
                                end = true;
                            }

                            Game.Wait(3500);
                        }
                        else
                        {
                            Game.Wait(1000);
                        }
                    }
                    else
                    {
                        if (Game.CurrentGame.WorldSave())
                        {
                            Game.Wait(60000);
                            Game.PrintMessage("Try - WordSave" + character.Serial);
                        }
                        else
                        {
                            if (tries > 1)
                            {
                                Game.PrintMessage("End - JEW timeout " + character.Serial);
                                end = true;
                            }
                        }
                    }

                    if (tries > maxTries)// && currentStaff.Color == TrainTamingStaff.Color)
                    {
                        end = true;
                    }

                    if (tamingValue.RealValue < 1000 && maxTries < 100)
                    {
                        bool switchToTrain  = false;
                        bool switchToTaming = false;
                        if (tries == 0)
                        {
                            if ((Journal.Contains(true, "nenauc") || Journal.Contains(true, "You Cannot learn anything more")) && robe.Exist)
                            {
                                robe.Move(1, World.Player.Backpack);
                                Game.Wait();
                                switchToTrain = true;
                            }

                            if (!Journal.Contains(true, "nenauc"))
                            {
                                switchToTrain = true;
                            }
                        }
                        else if (tries == 1)
                        {
                            if (Journal.Contains(true, "nenauc") || Journal.Contains(true, "You Cannot learn anything more"))
                            {
                                switchToTaming = true;

                                Game.PrintMessage("robe.Exist:" + robe.Exist);

                                if (robe.Exist)
                                {
                                    robe.Use();
                                    Game.Wait();
                                }
                            }
                        }

                        if (switchToTrain)
                        {
                            if (World.Player.Backpack.AllItems.FindType(TrainTamingStaff.Graphic, TrainTamingStaff.Color).Exist)
                            {
                                currentStaff = World.Player.Backpack.AllItems.FindType(TrainTamingStaff.Graphic, TrainTamingStaff.Color);
                            }
                            else if (World.Player.Layers.FindType(TrainTamingStaff.Graphic, TrainTamingStaff.Color).Exist)
                            {
                                currentStaff = World.Player.Backpack.AllItems.FindType(TrainTamingStaff.Graphic, TrainTamingStaff.Color);
                            }

                            Game.Wait();
                        }


                        if (switchToTaming)
                        {
                            currentStaff = EnsuredTamingStaff;
                            Game.Wait();
                        }
                    }
                    if (tries > 2)
                    {
                        if (Journal.Contains(true, "nenauc") || currentStaff.Color == TamingStaffCharged.Color && !World.Player.Layers[Layer.OuterTorso].Exist)
                        {
                            if (World.Player.Backpack.AllItems.FindType(0x1F03).Exist)
                            {
                                World.Player.Backpack.AllItems.FindType(0x1F03).Use();
                                Game.Wait();
                            }
                            else if (World.Player.Backpack.AllItems.FindType(0x1F01).Exist)
                            {
                                World.Player.Backpack.AllItems.FindType(0x1F01).Use();
                                Game.Wait(500);
                            }
                        }
                    }

                    if (kill)
                    {
                        if (!this.KillCharacter(character))
                        {
                            end = true;
                        }
                    }

                    if (end)
                    {
                        Game.PrintMessage("While - end: " + tries);
                        //   doneList.Remove(character.Serial);
                        break;
                    }
                }
                tries++;
                Game.PrintMessage("While - cyklus pokus: " + tries);
            }

            foreach (UOItem item in World.Ground)
            {
                if (item.Distance < 5)
                {
                    bool isKlamak = false;
                    foreach (Graphic g in Taming2.ShrinkKlamaci)
                    {
                        if (item.Graphic == g)
                        {
                            isKlamak = true;
                        }
                    }

                    if (Array.IndexOf(ItemLibrary.ShrinkKlamaci.GraphicArray, item.Graphic) > -1 || Array.IndexOf(ShrinkKlamaci, item.Graphic) > -1 || isKlamak)
                    {
                        item.Move(1, (ushort)(World.Player.X + 1), (ushort)(World.Player.Y + 1), item.Z);
                        Game.Wait(150);
                        item.Move(1, World.Player.Backpack, 30, 30);
                        Game.Wait(150);
                    }
                }
            }

            Game.PrintMessage("While - END");
            if (World.Player.Backpack.AllItems.FindType(0x1F03).Exist)
            {
                World.Player.Backpack.AllItems.FindType(0x1F03).Use();
                Game.Wait(250);
            }
            else if (World.Player.Backpack.AllItems.FindType(0x1F01).Exist)
            {
                World.Player.Backpack.AllItems.FindType(0x1F01).Use();
                Game.Wait(250);
            }
        }
Exemplo n.º 23
0
        private void Mine(Field T, int Try = 0)
        {
            if (StartMine == null)
            {
                StartMine = DateTime.Now;
            }
            int tmp = LumbDelay - (int)(DateTime.Now - StartMine).TotalMilliseconds;

            if (tmp > 0)
            {
                for (double i = 0; i < tmp; i += tmp / 10)
                {
                    if (i > 100)
                    {
                        CheckCK();
                    }

                    UO.Wait(tmp / 10);
                }
            }
            if (Try == 0 & UseCrystal)
            {
                UO.Say(".vigour");
            }
            if (T.Mine())
            {
                StartMine = DateTime.Now;

                if (Try == 0 & UseCrystal)
                {
                    UO.Wait(LumbDelay);
                    UO.Say(".vigour");
                }
            }
            else
            {
                if (Try == 0 & UseCrystal)
                {
                    UO.Wait(LumbDelay);
                    UO.Say(".vigour");
                    return;
                }
            }
            CheckCK();
            UO.Wait(300);
            if (Check.NoLog)
            {
                Check.NoLog = false;
                T.Harvested();

                if (Check.MaxedWeight)
                {
                    var sp = new Point(World.Player.X, World.Player.Y);
                    Unload();
                    MoveTo(sp);
                    Check.MaxedWeight = false;
                }
                return;
            }



            if (Check.SkillDelay)
            {
                Check.SkillDelay = false;
                UO.Wait(5500);
            }

            Mine(T, (Try + 1));
        }
Exemplo n.º 24
0
        //---------------------------------------------------------------------------------------------

        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);
        }
Exemplo n.º 25
0
        private void Recall(int v)
        {
            int x = World.Player.X;
            int y = World.Player.Y;

            UO.Warmode(false);
            switch (v)
            {
            case 0:
                while (World.Player.X == x | World.Player.Y == y)
                {
                    while (World.Player.Mana < 20)
                    {
                        UO.UseSkill(StandardSkill.Meditation);
                        UO.Wait(2500);
                    }
                    UO.WaitTargetSelf();
                    UO.Say(".recallhome");
                    Journal.WaitForText(true, 10000, "Kouzlo se nezdarilo.");
                    Journal.ClearAll();
                    UO.Wait(200);
                }
                break;

            case 1:
                MoveTo(HomeLocation);
                while (World.Player.X == x || World.Player.Y == y)
                {
                    while (World.Player.Mana < 20)
                    {
                        UO.UseSkill(StandardSkill.Meditation);
                        UO.Wait(2500);
                    }


                    foreach (Rune r in RuneTree.Runes.Where(run => run.Id.ToString() == LumbRune.ToString()))
                    {
                        RuneTree.findRune(r);
                        r.RecallSvitek();
                    }


                    Journal.ClearAll();
                    UO.Wait(500);
                    Journal.WaitForText(true, 10000, "Kouzlo se nezdarilo.");
                    UO.Wait(200);
                }
                break;

            case 2:
                while (World.Player.X == x | World.Player.Y == y)
                {
                    while (World.Player.Mana < 20)
                    {
                        UO.Wait(500);
                    }
                    UO.WaitTargetSelf();
                    UO.Say(".recallhome");
                    Journal.WaitForText(true, 10000, "Kouzlo se nezdarilo.");
                    Journal.ClearAll();
                    UO.Wait(200);
                }
                break;
            }
        }
Exemplo n.º 26
0
        public void mikulasuse()
        {
            World.FindDistance = 20;
            if (World.Player.Backpack.Items.FindType(0x1ECD, 0x0B1D).Exist)
            {
                UO.UseType(0x1ECD, 0x0B1D);//ukolnicek
                Game.Wait();
            }
            //OpenDoorAll();
            if (!World.Player.Layers[Layer.Mount].Exist)
            {
                string summon = "";
                if (Game.CurrentGame.CurrentPlayer.PlayerClass == PlayerClass.Ranger || Game.CurrentGame.CurrentPlayer.PlayerClass == PlayerClass.Mage || Game.CurrentGame.CurrentPlayer.PlayerClass == PlayerClass.Cleric)
                {
                    summon = "Horse";
                }
                else if (Game.CurrentGame.CurrentPlayer.PlayerClass == PlayerClass.Necromancer)
                {
                    summon = "Dark Oclock";
                }

                bool fizz = false;
                if (!String.IsNullOrEmpty(summon))
                {
                    Journal.Clear();
                    UO.SummonCreature(summon, World.Player);
                    fizz = Journal.WaitForText(true, 3500, "fizz");

                    if (fizz)
                    {
                        Journal.Clear();
                        UO.SummonCreature(summon, World.Player);
                        fizz = Journal.WaitForText(true, 3500, "fizz");
                    }
                }

                Game.Wait();
                if (!fizz)
                {
                    Game.CurrentGame.CurrentPlayer.UseMount(500);
                    Game.Wait(250);
                    if (World.Player.Layers[Layer.Mount].Exist)
                    {
                        return;
                    }
                }
            }


            foreach (UOCharacter ch in World.Characters)
            {
                if (String.IsNullOrEmpty(ch.Name))
                {
                    ch.Click();
                    Game.Wait();
                }

                if (ch.Distance <= 3)
                {
                    if (ch.Model == 0x003E && ch.Color == 0x0B98 && ch.Name.ToLower() == "certik")
                    {
                        UO.Say(ch.Name + " branu");
                        return;
                    }
                }
                else if (ch.Distance <= 7)
                {
                    if (ch.Model == 0x0190 && ch.Color == 0x0421 && ch.Name.ToLower() == "matej")
                    {
                        Journal.Clear();
                        UO.Say(ch.Name + " hi");


                        string kop = String.Empty;

                        if (Journal.WaitForText(true, 250, "umbre"))
                        {
                            kop = "umbra";
                        }

                        if (!String.IsNullOrEmpty(kop))
                        {
                            if (World.Player.Backpack.Items.FindType(0x22C5, 0x0000).Exist)
                            {
                                Kniha.Current.CestovniKnihaUse(1);
                                Game.Wait();

                                if (kop == "umbra")
                                {
                                    Kniha.Current.CestovniKnihaUse(25);
                                }
                                //else
                                //{
                                //  Kniha.Current.CestovniKnihaUse(5);
                                //}
                            }
                            Game.Wait(1000);
                        }

                        Hiding.ExecHide();
                        return;
                    }
                }

                if (ch.Distance <= 1)
                {
                    if (ch.Model == 0x002F && ch.Color == 0x047E && ch.Name.ToLower() == "velice stary ent")
                    {
                        Journal.Clear();
                        UO.Say(ch.Name + " hi");

                        string kop = String.Empty;

                        if (Journal.WaitForText(true, 250, "luny"))
                        {
                            kop = "luna";
                        }
                        else if (Journal.WaitForText(true, 250, "scara"))
                        {
                            kop = "scara";
                        }
                        else if (Journal.WaitForText(true, 250, "ilshe"))
                        {
                            kop = "jhelom";
                        }

                        if (!String.IsNullOrEmpty(kop))
                        {
                            if (World.Player.Backpack.Items.FindType(0x22C5, 0x0000).Exist)
                            {
                                Kniha.Current.CestovniKnihaUse(1);
                                Game.Wait();

                                if (kop == "luna")
                                {
                                    Kniha.Current.CestovniKnihaUse(24);
                                }
                                else if (kop == "scara")
                                {
                                    Kniha.Current.CestovniKnihaUse(12);
                                }
                                else
                                {
                                    Kniha.Current.CestovniKnihaUse(8);
                                }
                            }
                            else
                            {
                                if (kop == "luna")
                                {
                                    Kniha.Current.TravelBookUse(1);
                                }
                                else if (kop == "scara")
                                {
                                    Kniha.Current.RuneBookUse(5);
                                }
                                else
                                {
                                    Kniha.Current.RuneBookUse(1);
                                }
                            }
                            Game.Wait(1000);
                        }

                        Hiding.ExecHide();

                        return;
                    }
                }
            }

            foreach (UOItem o in World.Ground)
            {
                if (o.Distance <= 1)
                {
                    if (o.Graphic == 0x09B1 && o.Color == 0x0000)//kosick
                    {
                        UO.PrintObject(o, "Kosik");
                        o.Use();
                        return;
                    }
                    else if (o.Graphic == 0x09D7 && o.Color == 0x0422)//Hilina
                    {
                        UO.PrintObject(o, "Hlina");
                        o.Use();
                        return;
                    }
                    else if (o.Graphic == 0x1777 && o.Color == 0x084F)//kameny
                    {
                        UO.PrintObject(o, "Kamen");
                        o.Use();
                        return;
                    }
                    else if (o.Graphic == 0x0C9A && o.Color == 0x0000)//stromek
                    {
                        UO.PrintObject(o, "Stromek");
                        o.Use();
                        return;
                    }
                    else if (o.Distance == 0 && o.Graphic == 0x3490 && o.Color == 0x0000)//vir
                    {
                        UO.PrintObject(o, "Vir");
                        o.Use();
                        return;
                    }
                    else if (o.Graphic == 0x0913 && o.Color == 0x0000)//hlina ubra
                    {
                        UO.PrintObject(o, "Hlina");
                        o.Use();
                        return;
                    }
                    else if (o.Graphic == 0x1366 && o.Color == 0x0B31)//Sklo
                    {
                        UO.PrintObject(o, "Sklo");
                        o.Use();
                        return;
                    }
                    else if (o.Graphic == 0x2000 && o.Color == 0x0000)//Truhla
                    {
                        UO.PrintObject(o, "Truhla");
                        o.Use();
                        return;
                    }



                    //Serial: 0x402C7C46  Position: 5261.157.15  Flags: 0x0000  Color: 0x0000  Graphic: 0x2000  Amount: 0  Layer: None Container: 0x00000000


                    // Serial: 0x402DE34C  Name: "Recall Rune - Minoc Mining Ca"  Position: 142.111.0  Flags: 0x0000  Color: 0x0482  Graphic: 0x1F14  Amount: 1  Layer: None Container: 0x403174BC


                    //          Serial: 0x402DFCAC  Name: "a porcelain clay"  Position: 3623.472.0  Flags: 0x0000  Color: 0x0000  Graphic: 0x0913  Amount: 0  Layer: None Container: 0x00000000

                    //Serial: 0x00375110  Name: "Matej"  Position: 2608.518.1  Flags: 0x0000  Color: 0x0421  Model: 0x0190  Renamable: False Notoriety: Innocent HP: -1 / -1

                    //Serial: 0x4027C37D  Name: "a piece of glass"  Position: 2520.503.16  Flags: 0x0000  Color: 0x0B31  Graphic: 0x1366  Amount: 0  Layer: None Container: 0x00000000



                    //          Serial: 0x400F5A69  Position: 818.2375.1  Flags: 0x0000  Color: 0x0000  Graphic: 0x3490  Amount: 0  Layer: None Container: 0x00000000

                    //Serial: 0x402E44E2  Position: 838.2352.0  Flags: 0x0000  Color: 0x0000  Graphic: 0x0C9A  Amount: 0  Layer: None Container: 0x00000000



                    //Serial: 0x40260AF6  Position: 4815.1779.-20  Flags: 0x0000  Color: 0x084F  Graphic: 0x1777  Amount: 0  Layer: None  Container: 0x00000000


                    /*TODO
                     *
                     *
                     * else if (o.Graphic == 0x09D7 && o.Color == 0x0422)//Hilina
                     * {
                     * UO.PrintObject(o, "Hlina");
                     * o.Use();
                     * return;
                     * }
                     *
                     * else if (o.Graphic == 0x09D7 && o.Color == 0x0422)//Hilina
                     * {
                     * UO.PrintObject(o, "Hlina");
                     * o.Use();
                     * return;
                     * }*/
                }
                else if (o.Distance <= 25 && o.Distance > 1)
                {
                    if (o.Graphic == 0x1366 && o.Color == 0x0B31)//Sklo
                    {
                        UO.PrintObject(o, "Sklo");
                    }
                    else if (o.Graphic == 0x0913 && o.Color == 0x0000)//hlina ubra
                    {
                        UO.PrintObject(o, "Hlina");
                    }
                }
            }
            // 0x0B1D  Graphic: 0x1ECD
        }
Exemplo n.º 27
0
        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);
            }
        }
Exemplo n.º 28
0
        private static void Run()
        {
            PeekMessage(out var message, IntPtr.Zero, 0, 0, 0);

            var wndProc = new WndProcDelegate(WndProc);

            var windowClass = new WNDCLASS();

            windowClass.lpszClassName = ApiKey;
            windowClass.lpfnWndProc   = Marshal.GetFunctionPointerForDelegate(wndProc);

            Trace.Log("Registering window");
            var windowClassAtom = RegisterClass(ref windowClass);

            if (windowClassAtom == 0 && Marshal.GetLastWin32Error() != 1410)
            {
                Trace.Log("failed");
                return;
            }

            Trace.Log("Creating window");
            var windowHandle = CreateWindowEx(0, ApiKey, ApiKey, 0, 0, 0, 0, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

            if (windowHandle == IntPtr.Zero)
            {
                Trace.Log("failed");
                return;
            }

            Trace.Log("Entering main loop");

            try
            {
                while (true)
                {
                    while (PeekMessage(out message, IntPtr.Zero, 0, 0, 0))
                    {
                        if (GetMessage(out message, IntPtr.Zero, 0, 0) == -1)
                        {
                            Trace.Log("GetMessage failed");
                            return;
                        }

                        TranslateMessage(ref message);
                        DispatchMessage(ref message);
                    }
                    UO.CheckCancellation();
                    Thread.Sleep(100);
                }
            }
            catch (Exception ex)
            {
                Trace.Log(ex.ToString());
            }
            finally
            {
                Trace.Log("Destroying window");
                if (!DestroyWindow(windowHandle))
                {
                    Trace.Log("Cannot destroy");
                }

                Trace.Log("Unregistering window");
                if (!UnregisterClass(ApiKey, IntPtr.Zero))
                {
                    Trace.Log("Cannot unregister");
                }

                lock (startLock)
                    started = false;
            }
        }
Exemplo n.º 29
0
        public static void MakeKrabiceKade()
        {
            UO.Print("Vyber container s matrosem:");
            UOItem containerFrom = new UOItem(UIManager.TargetObject());

            ItemHelper.OpenContainerRecursive(containerFrom);
            ItemHelper.OpenContainerRecursive(World.Player.Backpack);


            var stavesGraphic = (Graphic)0x1EB1;
            var lidGraphic    = (Graphic)0x1DB8;
            var logGraphic    = (Graphic)0x1BDD;
            var ingotGraphic  = (Graphic)0x1BEF;
            var bronzeColor   = (UOColor)0x06D6;
            var toolsGraphic  = (Graphic)0x1EBC;
            var sawGraphic    = (Graphic)0x1034;
            var formaGraphic  = (Graphic)0x0E7F;
            var kadGraphic    = (Graphic)0x1843;
            var oreGraphic    = (Graphic)0x19B9;
            var oreGraphics   = new Graphic[] { 0x19B9, 0x19B8, 0x19B7 };

            UOItem backpack = World.Player.Backpack;
            UOItem saw      = backpack.AllItems.FindType(sawGraphic);
            UOItem tools    = backpack.AllItems.FindType(toolsGraphic);

            if (backpack.AllItems.FindType(logGraphic).Exist || backpack.AllItems.FindType(logGraphic).Amount < 10)
            {
                containerFrom.AllItems.FindType(logGraphic).Move(10, backpack);
                Game.Wait();
            }

            while (saw.Exist && tools.Exist)
            {
                if (!containerFrom.AllItems.FindType(logGraphic).Exist || !containerFrom.AllItems.FindType(ingotGraphic, bronzeColor).Exist || !containerFrom.AllItems.FindType(lidGraphic).Exist || !containerFrom.AllItems.FindType(oreGraphic).Exist)
                {
                    UO.Print("Dosel matros!");
                    return;
                }

                while (World.Player.Backpack.AllItems.Count(kadGraphic, 0x0000) < 20)
                {
                    if (containerFrom.AllItems.Count(kadGraphic, 0x0000) >= 20)
                    {
                        while (World.Player.Backpack.AllItems.Count(kadGraphic, 0x0000) < 20)
                        {
                            containerFrom.AllItems.FindType(kadGraphic).Move(1, World.Player.Backpack);
                            Game.Wait(500);
                        }
                    }
                    else
                    {
                        UOItem forma = backpack.AllItems.FindType(formaGraphic);
                        UO.Print("Staves: " + backpack.AllItems.Count(stavesGraphic) + "Forma: " + forma.Exist);

                        while (!forma.Exist)
                        {
                            UO.Print("Staves: " + backpack.AllItems.Count(stavesGraphic));
                            while (backpack.AllItems.Count(stavesGraphic) < 2)
                            {
                                if (containerFrom.AllItems.FindType(stavesGraphic).Exist&& containerFrom.AllItems.Count(stavesGraphic) > 1)
                                {
                                    containerFrom.AllItems.FindType(stavesGraphic).Move(2, backpack);
                                }
                                else
                                {
                                    containerFrom.AllItems.FindType(logGraphic).Move(3, backpack);
                                    Game.Wait();

                                    Journal.Clear();
                                    UO.WaitMenu("Carpentry", "Containers & Cont. parts", "Containers & Cont. parts", "Barrel Staves");
                                    saw.Use();

                                    new JournalEventWaiter(true, "fail", "you put", "targeting").Wait(10000);

                                    if (Journal.Contains(true, "targeting"))
                                    {
                                        UO.Print("Dosel matros Stavesy!");
                                        return;
                                    }
                                }
                            }

                            containerFrom.AllItems.FindType(lidGraphic).Move(2, backpack);
                            Game.Wait();

                            Journal.Clear();
                            UO.WaitMenu("Carpentry", "Containers & Cont. parts", "Containers & Cont. parts", "Forma na lahve");
                            saw.Use();

                            new JournalEventWaiter(true, "fail", "you put", "targeting").Wait(10000);

                            if (Journal.Contains(true, "targeting"))
                            {
                                UO.Print("Dosel matros Forma!");
                                return;
                            }

                            forma = backpack.AllItems.FindType(formaGraphic);
                        }


                        containerFrom.AllItems.FindType(oreGraphic).Move(2, backpack);
                        Game.Wait();

                        containerFrom.AllItems.FindType(logGraphic).Move(2, backpack);
                        Game.Wait();

                        if (!backpack.AllItems.FindType(ingotGraphic, bronzeColor).Exist)
                        {
                            containerFrom.AllItems.FindType(ingotGraphic, bronzeColor).Move(2, backpack);
                            Game.Wait();
                        }


                        Journal.Clear();
                        UO.WaitMenu("Tinkering", "Containers", "Containers", "Kad na potiony");
                        tools.Use();

                        new JournalEventWaiter(true, "fail", "you put", "targeting").Wait(10000);

                        if (Journal.Contains(true, "targeting"))
                        {
                            UO.Print("Dosel matros Kad!");
                            return;
                        }
                    }
                }


                if (World.Player.Backpack.Items.Count(logGraphic) < 10)
                {
                    containerFrom.AllItems.FindType(logGraphic).Move(10, backpack);
                }

                Journal.Clear();
                UO.WaitMenu("Carpentry", "Miscellaneous", "Miscellaneous", "Krabice kadi");
                saw.Use();

                new JournalEventWaiter(true, "fail", "you put", "targeting").Wait(10000);

                if (World.Player.Backpack.AllItems.FindType(0x185E, 0x07E0).Exist)
                {
                    UOItem kade = containerFrom.AllItems.FindType(0x185E, 0x07E0);
                    if (kade.Exist)
                    {
                        backpack.AllItems.FindType(0x185E, 0x07E0).Move(1, kade.Container, kade.X, kade.Y);
                    }
                    else
                    {
                        backpack.AllItems.FindType(0x185E, 0x07E0).Move(1, containerFrom);
                    }
                }
            }
        }
Exemplo n.º 30
0
        public static void StayAndFight(int distance, int hpMin, bool boost, bool reversePath, string path)
        {
            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

            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();

            GotoEventHandler beforeMoveHandler = (sender, e) =>
            {
                ushort x = e.Destination.X.GetValueOrDefault();
                ushort y = e.Destination.Y.GetValueOrDefault();

                foreach (UOItem item in World.Ground)
                {
                    if (item.Graphic == 0x0DDA && item.X == x && item.Y == y)
                    {
                        e.IvalidDestination = true;
                    }
                }
            };

            GotoEventHandler beforeMoveHandler2 = (sender, e) =>
            {
                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());

                    foreach (UOCharacter ch in chars)
                    {
                        if (ch.Distance < current.Distance)
                        {
                            e.Abort = true;
                            break;
                        }
                    }
                }
            };

            GotoEventHandler beforeMoveHandler3 = (sender, e) =>
            {
                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());

                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 (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())
                            {
                                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);

                                if (World.Player.Hits <= hpMin)
                                {
                                    while (World.Player.Hits < hpMin)
                                    {
                                        if (Game.CurrentGame.CurrentPlayer.PlayerClass == 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)
                                            {
                                                Alchemy.ExecDrinkPotion("Heal");
                                                Game.Wait(500);
                                            }
                                        }

                                        //Game.CurrentGame.SwitchWarRunOff();

                                        Game.Wait(500);
                                    }
                                }

                                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]");
                            }

                            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));
                    }
                }
            }
        }