Veterinary Train

Datum: 27/07/2011 12:40:11

Staženo: 743x

Popis:

Autora nevím, trenování pomocí 2 NPC, kontrola HP a hlášky sám píše..


Hodnocení: 3.5/10 (107 hlasy)

Download file:cs

Příkazy:

  • ,exec veterinary
  • ,exec vetboj "int hits"
  • ,exec detek
  • ,exec magerysipka

Kód:

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

    namespace Scripts.Training
    {       
        public class tvetasdsss
        {
            [Executable]
            public void Veterinary()
            {
                int i = 0;
                UOCharacter a = World.GetCharacter(UIManager.TargetObject());
                UOCharacter b = World.GetCharacter(UIManager.TargetObject());
                a.RequestStatus(1000);
                b.RequestStatus(1000);
                while (true)
                {
                    if (i == 3)
                    {
                        b.WaitTarget();
                        UO.Say(a.Name + " kill");
                        UO.Wait(100);
                        UO.Say(b.Name + " stop");
                        UO.Wait(100);
                        i = 0;
                    }
                    CheckHits(a, b);
                    HealAnimals(a, b);
                    i++;
                }
            }

            private void HealAnimals(UOCharacter a, UOCharacter b)
            {
                UO.DeleteJournal();
                using (JournalEventWaiter ew = new JournalEventWaiter(true, "barely", "mumii", "bloody bandage"))
                {
                    if (a.Hits < b.Hits)
                    {
                        a.WaitTarget();
                    }
                    else
                    {
                        b.WaitTarget();
                    }
                    UO.UseType(0x0E21);
                    UO.Wait(500);
                    if (!ew.Wait(4000))
                    {
                        UO.PrintWarning("timeout.");
                    }
                }
                if (UO.InJournal("mumii")) UO.Wait(2000);
            }

            private void CheckHits(UOCharacter a, UOCharacter b)
            {
                if ((a.Hits < 50) || (b.Hits < 50))
                {
                    UO.Say("All stop");
                    while (!(a.Hits == a.MaxHits) && !(b.Hits == b.MaxHits))
                    {
                        HealAnimals(a, b);
                    }
                }
            }

            [Executable]
            public void VetBoj(int hits)
            {
                UOCharacter ja = World.GetCharacter(UIManager.TargetObject());
                UO.PrintInformation("Script zahajen !");
                Zautocit(ja, hits);
            }

            private void Zautocit(UOCharacter ja, int hits)
            {
                int i = 0;
                UO.PrintInformation("Boj zapocat !");
                ja.RequestStatus(1000);
                World.Player.ChangeWarmode(WarmodeChange.War);
                UO.Attack(ja);
                UO.Wait(2000);
                UO.Say("all stop");
                while (true)
                {
                    if (i == 5)
                    {
                        UO.Attack(ja);
                        i = 0;
                    }
                    if (ja.Hits <= hits)
                    {
                        World.Player.ChangeWarmode(WarmodeChange.Peace);
                       
                        Vyhealnout(ja, hits);
                    }
                    UO.Wait(1000);
                    i++;
                }
            }

            private void Vyhealnout(UOCharacter ja, int hits)
            {
                UO.Say("all stop");
                UO.PrintInformation("Healovani zapocato !");
                ja.RequestStatus(100);
                while (ja.Hits < ja.MaxHits)
                {
                    UO.DeleteJournal();
                    using (JournalEventWaiter ew = new JournalEventWaiter(true, "barely", "mumii", "bloody bandage"))
                    {
                        UO.WaitTargetObject(ja);
                        UO.UseType(0x0E21);
                        UO.Wait(500);
                        if (!ew.Wait(4000))
                        {
                            UO.PrintWarning("timeout.");
                        }
                    }
                    UO.Wait(100);
                }
                Zautocit(ja, hits);
            }

            [Executable]
            public void detek()
            {
                while (true)
                {
                    UO.UseSkill("Detecting Hidden");
                    using (JournalEventWaiter ew = new JournalEventWaiter(true, "You can see"))
                    {
                        if (!ew.Wait(3000))
                            UO.Print("Timeout");
                    }
                }
            }

            [Executable]
            public void MagerySipka()
            {
                while (!World.Player.Dead)
                {
                    using (JournalEventWaiter waiter = new JournalEventWaiter(true, "The spell fizzles", "You feel yourself resisting magic"))
                    {
                        if (World.Player.Hits < World.Player.MaxHits) FullHeal();    // if (World.Player.Hits < World.Player.MaxHits) FullHeal();
                        if (World.Player.Mana < 20) DrinkManaRefresh();
                        if (UO.Count(0x0F7A) > 5 && UO.Count(0x0F88) > 5 && UO.Count(0x0E21) > 5)
                        {
                            UO.WaitTargetSelf();
                            UO.Cast("Magic Arrow");
                        }
                        else
                        {
                            UO.Print("Neco ti chyby..");
                            return;
                        }
                        if (!waiter.Wait(3000)) UO.PrintWarning("Waiting for spell timeout.");
                    }
                }
            }

            void FullHeal()
            {
                while (World.Player.Hits != World.Player.MaxHits)
                {
                    using (JournalEventWaiter waiter = new JournalEventWaiter(true, "You apply the bandages, but they barely help", "You put the bloody bandagess in your pack.", "Chces vytvorit mumii?"))
                    {
                        UO.BandageSelf();
                        if (!waiter.Wait(10000)) UO.PrintWarning("Waiting for bandage timeout.");
                    }
                }
            }

            void DrinkManaRefresh()
            {
                while (World.Player.Mana < 20)
                {
                    using (JournalEventWaiter waiter = new JournalEventWaiter(true, "You put the empty bottles in your pack.", "You put the empty bottless in your pack."))
                    {
                        if (UO.Count(0x0F09, 0x0003) > 0)
                        {
                            UO.UseType(0x0F09, 0x0003);
                        }
                        else
                        {
                            CepnoutMR();
                        }
                        if (!waiter.Wait(10000)) UO.PrintWarning("Waiting for drink timeout.");
                    }
                }
            }

            void CepnoutMR()
            {
                while (UO.Count(0x0F0E) > 0)
                {
                    using (JournalEventWaiter waiter = new JournalEventWaiter(true, "You put the"))
                    {
                        UO.WaitTargetType(0x0F0E, 0x0000);
                        UO.UseType(0x1843, 0x0003);
                        UO.Wait(500);
                        if (!waiter.Wait(10000)) UO.PrintWarning("Waiting timeout.");
                    }
                }
            }
        }
    }

Zde ještě není žádný komentář.

Nový komentář