Alchemy

Doplňkové skripty
Odpovědět
Lara Craft
Site Admin
Příspěvky:36
Registrován:čtv bře 08, 2018 9:00 pm
Alchemy

Příspěvek od Lara Craft » čtv srp 09, 2018 9:49 am

Vylepšený Razielův kript, kde nemusíte mít káď v báglu, ale i vedle sebe nebo v bance a míchá, jen dokud jste naživu:

Kód: Vybrat vše

using System;
using System.Collections.Generic;
using System.Text;
using Phoenix;
using Phoenix.WorldData;

namespace Phoenix.Scripts.Raziel
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Phoenix;
    using Phoenix.WorldData;
    public class Alchemy
    {
        public UOItem keg {get; set; }
        
        public class Potion
        {
            public string Zkratka { get; set; }
            public string Menu { get; set; }
            public Graphic Graphic { get; set; }
            public UOColor Color { get; set; }
            public Graphic KegGraphic { get; set; }
            public UOColor KegColor { get; set; }
			public Graphic RegG { get; set; }
            public UOColor RegC { get; set; }
			
            public Potion(string z, string a, Graphic g, UOColor c, Graphic kg, UOColor kc)
            {
                Zkratka = z;
                Menu = a;
                Graphic = g;
                Color = c;
                KegGraphic = kg;
                KegColor = kc;
            }
        }
        private List<Potion> seznam = new List<Potion>();

        public Alchemy()
        {
            seznam.Add(new Potion("tmr", "Total Mana Refresh", 0x0F09, 0x0003, 0x1843, 0x003));
            seznam.Add(new Potion("mr", "Mana Refresh Potion", 0x0F09, 0x0005, 0x1843, 0x005));
            seznam.Add(new Potion("gs", "Greater Strength", 0x0F09, 0x0000, 0x1843, 0x0481));
            seznam.Add(new Potion("gh", "Greater Heal", 0x0F0C, 0x0000, 0x1843, 0x08A7));
            seznam.Add(new Potion("gc", "Greater Cure", 0x0F07, 0x0000, 0x1843, 0x0842));
            seznam.Add(new Potion("tr", "Total Refresh", 0x0F0B, 0x0000, 0x1843, 0x014D));
            seznam.Add(new Potion("sh", "Shrink", 0x0F09, 0x045E, 0x1843, 0x0724));
            seznam.Add(new Potion("dp", "Deadly Poison", 0x0F0A, 0x0000, 0x1843, 0x08A2));
            seznam.Add(new Potion("in", "Invisibility", 0x0F09, 0x0000, 0x1843, 0x000));
            seznam.Add(new Potion("lb", "Lava Bomb", 0x0F0D, 0x00E, 0x1843, 0x00E));
            seznam.Add(new Potion("ni", "Nightsight", 0x0F06, 0x0000, 0x1843, 0x03C4));
            seznam.Add(new Potion("ga", "Greater Agility", 0x0F08, 0x0000, 0x1843, 0x00BD));
            seznam.Add(new Potion("ag", "Agility Potion", 0x0F08, 0x0000, 0x1843, 0x00BF));
            seznam.Add(new Potion("cu", "Cure Potion", 0x0F07, 0x0000, 0x1843, 0x0090));
            seznam.Add(new Potion("he", "Heal Potion", 0x0F0C, 0x0000, 0x1843, 0x08A8));
            seznam.Add(new Potion("ge", "Greater Explosion", 0x0F0D, 0x0000, 0x1843, 0x0018));
            seznam.Add(new Potion("gp", "Greater Poison", 0x0F0A, 0x0000, 0x1843, 0x08A1));
            seznam.Add(new Potion("lp", "Lesser Poison", 0x0F0A, 0x0000, 0x1843, 0x089F));
            seznam.Add(new Potion("po", "Poison Potion", 0x0F0A, 0x0000, 0x1843, 0x08A0));
            seznam.Add(new Potion("le", "Lesser Explosion Potion", 0x0F0D, 0x0000, 0x1843, 0x001A));
            seznam.Add(new Potion("ex", "Explosion Potion", 0x0F0D, 0x0000, 0x1843, 0x0019));
            seznam.Add(new Potion("ha", "Hallucination", 0x0F06, 0x0B90, 0x1843, 0x0B90));
            seznam.Add(new Potion("lh", "Lesser Heal Potion", 0x0F0C, 0x0000, 0x1843, 0x08A9));
            seznam.Add(new Potion("lc", "Lesser Cure Potion", 0x0F07, 0x0000, 0x1843, 0x0091));
            seznam.Add(new Potion("re", "Refresh Potion", 0x0F0B, 0x0000, 0x1843, 0x014E));
            seznam.Add(new Potion("st", "Strength Potion", 0x0F09, 0x0000, 0x1843, 0x0B87));
        }

        [Command]
        public void mich(string zkratka)
        {
            int pokusu = 0, povedenych = 0;
            
            UO.DeleteJournal();
            Potion michat = seznam.Find(x => x.Zkratka == zkratka);
            if (michat == null)
            {
                UO.Print("Nenalezen potion se zkratkou " + zkratka);
                return;
            }
            UO.Print("Zadej cilovou kad:");
            keg = World.GetItem(UIManager.TargetObject());
            if(keg.Graphic != michat.KegGraphic || keg.Color != michat.KegColor)
            {
                UO.Print("Neplatny keg pro " + zkratka +"!");
                return;
            }
            while (!World.Player.Dead)
            {
                if (UO.InJournal("World save has been"))
                    UO.Wait(45000);
                UO.DeleteJournal();

                UO.UseType(0x0E9B);
                UO.WaitMenu("Vyber typ potionu", michat.Menu);
                while (!UO.InJournal("You completed") && !UO.InJournal("You toss") && !UO.InJournal("Nemas dost") && !UO.InJournal("World save has been"))
                {
                    UO.Wait(500);
                }
                if (UO.InJournal("Nemas dost"))
                {
                    UO.Print("Dosly regy...");
                    return;
                }
                pokusu++;
                if (UO.InJournal("You completed"))
                {
                    UO.UseType(0x0E9B);
                    Journal.WaitForText("You pour");
                    povedenych++;
                    UO.Wait(500);
                    UO.WaitTargetType(michat.Graphic, michat.Color);
					//UO.UseType(michat.KegGraphic, michat.KegColor);
					UO.UseObject(keg);
                    Journal.WaitForText("Prelil jsi lahvicku do kade");
                }
                UO.Print("Michani: " + pokusu + " pokusu z toho se michlo " + povedenych);
            }
        }

        [Command]
        public void gmmortar()
        {
            string menu = "";
            ushort graphic = 0;
            ushort color = 0x0000;
            int limit = 0;
            ushort regGraphic = 0;
            ushort colorGraphic = 0;

            UO.Print("Vyber gm mortar");
            UOItem gmmortar = World.GetItem(UIManager.TargetObject());
            UO.Print("Vyber keg kam prelivat potiony");
            UOItem keg = World.GetItem(UIManager.TargetObject());

            if (keg.Color == 0x0003) //tmr
            {
                menu = "Total Mana Refresh";
                graphic = 0x0F09;
                color = 0x0003;
                limit = 612;
                regGraphic = 0x0F87;
            }
            if (keg.Color == 0x08A7) //gh
            {
                menu = "Greater Heal";
                graphic = 0x0F0C;
                limit = 714;
                regGraphic = 0x0F85;
            }
            if (keg.Color == 0x0481) //gs
            {
                menu = "Greater Strength";
                graphic = 0x0F09;
                limit = 612;
                regGraphic = 0x0F86;
            }
            if (keg.Color == 0x014D) //tr
            {
                menu = "Total Refresh";
                graphic = 0x0F0B;
                limit = 510;
                regGraphic = 0x0F7A;
            }
            if (keg.Color == 0x0724) //shrink
            {
                menu = "Shrink";
                graphic = 0x0F09;
                color = 0x045E;
                limit = 306;
                regGraphic = 0x0F78;
            }
            if (keg.Color == 0x08A2) //deadly poison
            {
                menu = "Deadly Poison";
                graphic = 0x0F0A;
                limit = 1020;
                regGraphic = 0x0F88;
            }
            if (keg.Color == 0x000E) //Lava Bomb
            {
                menu = "Lava Bomb";
                graphic = 0x0F0D;
                color = 0x000E;
                limit = 612;
                regGraphic = 0x0F8F;
            }
            if (keg.Color == 0x00BD) //Greater Agility
            {
                menu = "Greater Agility";
                graphic = 0x0F08;
                limit = 306;
                regGraphic = 0x0F7B;
            }

            UO.DeleteJournal();
            while (!World.Player.Dead && UO.Count(regGraphic, colorGraphic) >= limit)
            {
                UO.DeleteJournal();
                gmmortar.Use();
                UO.WaitMenu("Vyber typ potionu", menu);
                Journal.WaitForText("You vylil hotovy lektvar do kade");
                UO.Wait(500);
                UO.DeleteJournal();

                foreach (UOItem item in World.Player.Backpack.AllItems)
                {
                    if (item.Graphic == 0x1843 && item.Color == keg.Color && item.Serial != keg.Serial)
                    {
                        item.Use();
                        break;
                    }
                }

                UO.WaitTargetObject(keg);
                Journal.WaitForText("Prelil jsi 50 lektvaru");
                UO.Wait(500);
                UO.DeleteJournal();
                foreach (UOItem item in World.Player.Backpack.AllItems)
                {
                    if (item.Graphic == 0x1843 && item.Color == keg.Color && item.Serial != keg.Serial)
                    {
                        item.Use();
                        break;
                    }
                }

                UO.WaitTargetType(0x0F0E);
                Journal.WaitForText("in your pack");
                UO.Wait(500);
                UO.DeleteJournal();

                keg.Use();
                UO.WaitTargetType(graphic, color);
                Journal.WaitForText("in your pack");
                UO.Wait(500);
            }
            UO.Print("Uz nemas dost regu.");
        }
    }
}

Odpovědět