Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Phoenix;
- using Phoenix.WorldData;
- namespace Scripts.Training
- {
- public class tvetasdsss
- {
- [Executable]
- public void Heal()
- {
- // opakujici se kod
- UO.PrintInformation("Zaměř 4 targety pro healing");
- UOCharacter a = World.GetCharacter(UIManager.TargetObject());
- UOCharacter b = World.GetCharacter(UIManager.TargetObject());
- UOCharacter d = World.GetCharacter(UIManager.TargetObject());
- UOCharacter c = World.GetCharacter(UIManager.TargetObject());
- a.RequestStatus(1000);
- b.RequestStatus(1000);
- while (!World.Player.Dead)
- {
- Heal(a,b,c,d);
- }
- }
- private void Heal(UOCharacter a, UOCharacter b, UOCharacter c, UOCharacter d)
- {
- UO.DeleteJournal();
- using (JournalEventWaiter ew = new JournalEventWaiter(true, "barely", "mumii", "bloody bandage"))
- { int i = 1;
- // case? vybrat character a waittarget az na konci pod veskerymi moznostmi (snazsi zmena funkcionality do budoucna (treba))
- if (i==1)
- {
- a.WaitTarget();
- i=2;
- }
- if (i==2)
- {
- b.WaitTarget();
- i=3;
- }
- if (i==3)
- {
- c.WaitTarget();
- i=4;
- }
- if (i==4)
- {
- d.WaitTarget();
- i=1;
- }
- UO.UseType(0x0E21);
- UO.Wait(1000); // staticka pauza
- if (!ew.Wait(4000))
- {
- UO.PrintWarning("timeout.");
- }
- }
- if (UO.InJournal("mumii")) UO.Wait(2000); // staticka pauza
- }
- 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))
- {
- // nechybi tady neco? :)
- }
- }
- }
- [Executable]
- public void Utok()
- {
- UOCharacter a = World.GetCharacter(UIManager.TargetObject());
- UO.PrintInformation("Vyber soupeře!");
- Zautocit(a); /// Script načte soupeře a započne útok // cesky koment nekterym kodovanim neprojde a zprasi se
- }
- private void Zautocit(UOCharacter a)
- {
- UO.PrintInformation("Boj zapocat !");
- a.RequestStatus(1000);
- World.Player.ChangeWarmode(WarmodeChange.War);
- UO.Attack(a);
- UO.Wait(2000);
- int i = 0;
- while (true)
- {
- if (i == 5) // kouzelne reseni s inkrementaci, ale budiz :) ja bych to treba zkusil roztrhnout do dvou metod
- // 2 stavy - kdyz je vse ok, utoc, kdyz neni, delej neco jineho... takhle to mas vsechno pohromade
- {
- UO.Attack(a);
- i = 0;
- }
- if (a.Hits <= 40)
- {
- World.Player.ChangeWarmode(WarmodeChange.Peace);
- Vyhealnout(a);
- }
- if (World.Player.Hits <= 40)
- {
- World.Player.ChangeWarmode(WarmodeChange.Peace);
- Vyhealnout(World.Player);
- }
- UO.Wait(1000); /// Pauza na autoattack (5000)
- i++;
- }
- }
- private void Vyhealnout(UOCharacter a)
- {
- UO.PrintInformation("Healim !");
- a.RequestStatus(100);
- while (a.Hits < a.MaxHits)
- {
- UO.DeleteJournal();
- using (JournalEventWaiter ew = new JournalEventWaiter(true, "barely", "mumii", "bloody bandage")) // je tohle opravdu dynamicky resena pauza?
- {
- UO.WaitTargetObject(a);
- UO.UseType(0x0E21);
- UO.Wait(500);
- if (!ew.Wait(4000))
- {
- UO.PrintWarning("timeout.");
- }
- }
- UO.Wait(100);
- }
- Zautocit(a);
- }
- [Executable]
- public void Svetlo()
- {
- while (!World.Player.Dead)
- {
- UO.WaitTargetSelf();
- UO.Cast("Nightsight");
- UO.Wait (1500); // staticka?
- if (World.Player.Mana < 5) DrinkManaRefresh(); // ma byt na zacatku... pred tim, nez zakouzlis ;)
- }
- }
- [Executable]
- public void Sipka()
- {
- 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(); // neboj se davat jednoduche ify do bloku...
- // nikdy nevis, kdy k nim neco predas a lepe se to hleda
- 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.");
- }
- }
- }
- [Executable]
- public void hid()
- {
- while (!World.Player.Dead)
- {
- UO.DeleteJournal();
- using (JournalEventWaiter ew = new JournalEventWaiter(true, "wait", "seem", "hidden"))
- {
- UO.UseSkill("Hiding");
- UO.Wait(4500); // no tvl :p
- if (!ew.Wait(1000))
- {
- UO.PrintWarning("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."); // moc nechapu ty timeouty, s tim jsem se nesetkal
- }
- }
- }
- 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); // ok, tak tady vubec nevim, co delas, tohle jsou hardcoded hodnoty...
- // Item tmr = new Item(0x0F09,0x0003) jako field v ramci tridy (nezapomen si napsat tridu Item viz nize
- // UO.UseType(tmr.getType(),tmr.getColor())
- }
- else
- {
- CepnoutMR();
- }
- if (!waiter.Wait(10000)) UO.PrintWarning("Waiting for drink timeout.");
- }
- }
- }
- void CepnoutMR()
- {
- while (UO.Count(0x0F0E) > 0) // hardcoded value
- {
- using (JournalEventWaiter waiter = new JournalEventWaiter(true, "You put the"))
- {
- UO.WaitTargetType(0x0F0E, 0x0000); // h...
- UO.UseType(0x1843, 0x0003);
- UO.Wait(500);
- if (!waiter.Wait(10000)) UO.PrintWarning("Waiting timeout.");
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment