Guest User

Untitled

a guest
Jan 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 9.61 KB | None | 0 0
  1.     using System;
  2.     using System.Collections.Generic;
  3.     using System.Text;
  4.     using Phoenix;
  5.     using Phoenix.WorldData;
  6.    
  7.      
  8.     namespace Scripts.Training
  9.     {      
  10.         public class tvetasdsss
  11.         {
  12.             [Executable]
  13.             public void Heal()
  14.             {
  15.             // opakujici se kod
  16.                 UO.PrintInformation("Zaměř 4 targety pro healing");
  17.                 UOCharacter a = World.GetCharacter(UIManager.TargetObject());
  18.                 UOCharacter b = World.GetCharacter(UIManager.TargetObject());
  19.                 UOCharacter d = World.GetCharacter(UIManager.TargetObject());
  20.                 UOCharacter c = World.GetCharacter(UIManager.TargetObject());
  21.                 a.RequestStatus(1000);
  22.                 b.RequestStatus(1000);
  23.                 while (!World.Player.Dead)
  24.                 {
  25.                     Heal(a,b,c,d);
  26.                    
  27.                 }
  28.             }
  29.      
  30.            
  31.            
  32.            
  33.             private void Heal(UOCharacter a, UOCharacter b, UOCharacter c, UOCharacter d)
  34.             {
  35.                 UO.DeleteJournal();  
  36.                 using (JournalEventWaiter ew = new JournalEventWaiter(true, "barely", "mumii", "bloody bandage"))
  37.                 {   int i = 1;
  38.                 // case? vybrat character a waittarget az na konci pod veskerymi moznostmi (snazsi zmena funkcionality do budoucna (treba))
  39.                     if (i==1)
  40.                     {
  41.                         a.WaitTarget();
  42.                         i=2;
  43.                     }
  44.                     if (i==2)
  45.                     {
  46.                         b.WaitTarget();
  47.                         i=3;
  48.                     }
  49.                     if (i==3)
  50.                     {
  51.                         c.WaitTarget();
  52.                         i=4;
  53.                     }
  54.                     if (i==4)
  55.                     {
  56.                         d.WaitTarget();
  57.                         i=1;
  58.                     }
  59.                     UO.UseType(0x0E21);
  60.                     UO.Wait(1000); // staticka pauza
  61.                     if (!ew.Wait(4000))
  62.                     {
  63.                         UO.PrintWarning("timeout.");
  64.                     }
  65.                 }
  66.                 if (UO.InJournal("mumii")) UO.Wait(2000); // staticka pauza
  67.             }
  68.      
  69.             private void CheckHits(UOCharacter a, UOCharacter b)
  70.             {
  71.                 if ((a.Hits < 50) || (b.Hits < 50))
  72.                 {
  73.                     UO.Say("All stop");
  74.                     while (!(a.Hits == a.MaxHits) && !(b.Hits == b.MaxHits))
  75.                     {
  76.                       // nechybi tady neco? :)
  77.                     }
  78.                 }
  79.             }
  80.      
  81.             [Executable]
  82.             public void Utok()
  83.             {
  84.                 UOCharacter a = World.GetCharacter(UIManager.TargetObject());
  85.                 UO.PrintInformation("Vyber soupeře!");
  86.                 Zautocit(a);  /// Script načte soupeře a započne útok // cesky koment nekterym kodovanim neprojde a zprasi se
  87.             }
  88.      
  89.             private void Zautocit(UOCharacter a)
  90.             {
  91.                 UO.PrintInformation("Boj zapocat !");
  92.                 a.RequestStatus(1000);
  93.                 World.Player.ChangeWarmode(WarmodeChange.War);
  94.                 UO.Attack(a);
  95.                 UO.Wait(2000);
  96.                 int i = 0;
  97.                 while (true)
  98.                 {
  99.                     if (i == 5) // kouzelne reseni s inkrementaci, ale budiz :) ja bych to treba zkusil roztrhnout do dvou metod
  100.                     // 2 stavy - kdyz je vse ok, utoc, kdyz neni, delej neco jineho... takhle to mas vsechno pohromade
  101.                     {
  102.                         UO.Attack(a);
  103.                         i = 0;
  104.                     }
  105.                     if (a.Hits <= 40)
  106.                     {
  107.                         World.Player.ChangeWarmode(WarmodeChange.Peace);
  108.                        
  109.                         Vyhealnout(a);
  110.                     }
  111.                     if (World.Player.Hits <= 40)
  112.                     {
  113.                         World.Player.ChangeWarmode(WarmodeChange.Peace);
  114.                         Vyhealnout(World.Player);
  115.                     }
  116.                     UO.Wait(1000); /// Pauza na autoattack (5000)
  117.                     i++;
  118.                 }
  119.             }
  120.      
  121.             private void Vyhealnout(UOCharacter a)
  122.             {
  123.                 UO.PrintInformation("Healim !");
  124.                 a.RequestStatus(100);
  125.                 while (a.Hits < a.MaxHits)
  126.                 {
  127.                     UO.DeleteJournal();
  128.                     using (JournalEventWaiter ew = new JournalEventWaiter(true, "barely", "mumii", "bloody bandage")) // je tohle opravdu dynamicky resena pauza?
  129.                     {
  130.                         UO.WaitTargetObject(a);
  131.                         UO.UseType(0x0E21);
  132.                         UO.Wait(500);
  133.                         if (!ew.Wait(4000))
  134.                         {
  135.                             UO.PrintWarning("timeout.");
  136.                         }
  137.                     }
  138.                     UO.Wait(100);
  139.                 }
  140.                 Zautocit(a);
  141.             }
  142.            
  143.             [Executable]
  144.             public void Svetlo()
  145.             {
  146.                 while (!World.Player.Dead)
  147.                 {
  148.                 UO.WaitTargetSelf();
  149.                 UO.Cast("Nightsight");
  150.                 UO.Wait (1500); // staticka?
  151.                 if (World.Player.Mana < 5) DrinkManaRefresh(); // ma byt na zacatku... pred tim, nez zakouzlis ;)
  152.                 }
  153.                
  154.             }
  155.            
  156.            
  157.            
  158.            
  159.             [Executable]
  160.             public void Sipka()
  161.             {
  162.                 while (!World.Player.Dead)
  163.                 {
  164.                     using (JournalEventWaiter waiter = new JournalEventWaiter(true, "The spell fizzles", "You feel yourself resisting magic"))
  165.                     {
  166.                         if (World.Player.Hits < World.Player.MaxHits) FullHeal();    // if (World.Player.Hits < World.Player.MaxHits) FullHeal();
  167.                         if (World.Player.Mana < 20) DrinkManaRefresh();             // neboj se davat jednoduche ify do bloku...
  168.                         // nikdy nevis, kdy k nim neco predas a lepe se to hleda
  169.                         if (UO.Count(0x0F7A) > 5 && UO.Count(0x0F88) > 5 && UO.Count(0x0E21) > 5)
  170.                         {
  171.                             UO.WaitTargetSelf();
  172.                             UO.Cast("Magic Arrow");
  173.                         }
  174.                         else
  175.                         {
  176.                             UO.Print("Neco ti chyby..");
  177.                             return;
  178.                         }
  179.                         if (!waiter.Wait(3000)) UO.PrintWarning("Waiting for spell timeout.");
  180.                     }
  181.                 }
  182.             }
  183.            
  184.             [Executable]
  185.             public void hid()
  186.             {
  187.                 while (!World.Player.Dead)
  188.                 {
  189.                 UO.DeleteJournal();
  190.                     using (JournalEventWaiter ew = new JournalEventWaiter(true, "wait", "seem", "hidden"))
  191.                     {
  192.                         UO.UseSkill("Hiding");
  193.                         UO.Wait(4500); // no tvl :p
  194.                         if (!ew.Wait(1000))
  195.                         {
  196.                             UO.PrintWarning("timeout.");
  197.                         }
  198.                     }
  199.                 }
  200.             }
  201.            
  202.             void FullHeal()
  203.             {
  204.                 while (World.Player.Hits != World.Player.MaxHits)
  205.                 {
  206.                     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?"))
  207.                     {
  208.                         UO.BandageSelf();
  209.                         if (!waiter.Wait(10000)) UO.PrintWarning("Waiting for bandage timeout."); // moc nechapu ty timeouty, s tim jsem se nesetkal
  210.                     }
  211.                 }
  212.             }
  213.      
  214.             void DrinkManaRefresh()
  215.             {
  216.                 while (World.Player.Mana < 20)
  217.                 {
  218.                     using (JournalEventWaiter waiter = new JournalEventWaiter(true, "You put the empty bottles in your pack.", "You put the empty bottless in your pack."))
  219.                     {
  220.                         if (UO.Count(0x0F09, 0x0003) > 0)
  221.                         {
  222.                             UO.UseType(0x0F09, 0x0003); // ok, tak tady vubec nevim, co delas, tohle jsou hardcoded hodnoty...
  223.                             // Item tmr = new Item(0x0F09,0x0003) jako field v ramci tridy (nezapomen si napsat tridu Item viz nize
  224.                             // UO.UseType(tmr.getType(),tmr.getColor())
  225.                         }
  226.                         else
  227.                         {
  228.                             CepnoutMR();
  229.                         }
  230.                         if (!waiter.Wait(10000)) UO.PrintWarning("Waiting for drink timeout.");
  231.                     }
  232.                 }
  233.             }
  234.      
  235.             void CepnoutMR()
  236.             {
  237.                 while (UO.Count(0x0F0E) > 0) // hardcoded value
  238.                 {
  239.                     using (JournalEventWaiter waiter = new JournalEventWaiter(true, "You put the"))
  240.                     {
  241.                         UO.WaitTargetType(0x0F0E, 0x0000); // h...
  242.                         UO.UseType(0x1843, 0x0003);
  243.                         UO.Wait(500);
  244.                         if (!waiter.Wait(10000)) UO.PrintWarning("Waiting timeout.");
  245.                     }
  246.                 }
  247.             }
  248.         }
  249.     }
Add Comment
Please, Sign In to add comment