///////////////////////////////////////////////////////////////////////// // // www.ultima.smoce.net // Name: Drinking v.2 // ///////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using System.Text; using Phoenix; using Phoenix.WorldData; namespace Script.Drinking { public class Drinking { /// /// hlaska co odpocitava, kdy muzete pit... internal static bool Cekani_hlaska = false; /// /// /// /// hlaska, kdyz mas posledni pot, tak ti to nad postavou napise internal static bool limit_pot = true; /// /// /// /// Nalij potiont z kegu, kdyz mas 0 v baglu? internal static bool keg_nouze = true; /// /// [Executable] public static void prelej(int pocet) {//by smoce UO.Print(0x027, "Přelejvač.."); UO.Wait(300); UO.PrintInformation("Target Z ktere kade."); UOItem kad1 = new UOItem(UIManager.TargetObject()); UO.Wait(500); UO.PrintInformation("Target DO ktere kade."); UOItem kad2 = new UOItem(UIManager.TargetObject()); while (kad1.Exist && pocet != 0) { kad1.Use(); UO.WaitTargetObject(kad2.Serial); UO.Wait(600); // prelejvani nastaveni timer ... pocet--; } } public struct TMR { public const ushort Keg_t = 0x1843; public const ushort Keg_c = 0x0003; public const ushort type = 0x0F09; public const ushort color = 0x0003; } public struct GH { public const ushort Keg_t = 0x1843; public const ushort Keg_c = 0x08A7; public const ushort type = 0x0F0C; public const ushort color = 0x0000; } public struct TR { public const ushort Keg_t = 0x1843; public const ushort Keg_c = 0x014D; public const ushort type = 0x0F0B; public const ushort color = 0x0000; } public struct GC { public const ushort Keg_t = 0x1843; public const ushort Keg_c = 0x0842; public const ushort type = 0x0F07; public const ushort color = 0x0000; } public struct GS { public const ushort Keg_t = 0x1843; public const ushort Keg_c = 0x0481; public const ushort type = 0x0F09; public const ushort color = 0x0000; } public struct GB { public const ushort Keg_t = 0x1843; public const ushort Keg_c = 0x0025; public const ushort type = 0x0F0C; public const ushort color = 0x0025; } public struct LA { public const ushort Keg_t = 0x1843; public const ushort Keg_c = 0x000E; public const ushort type = 0x0F0D; public const ushort color = 0x000E; } [Executable] public void vypij(String napoj) { switch (napoj) { case "GH": if (UO.Count(GH.type) > 0) { UO.UseType(GH.type); UO.Wait(500); UO.Print(0x0435, "Zbyva " + UO.Count(GH.type) + " GH."); if (UO.Count(GH.type) <= 1) { World.Player.Print(0x0435, "Zbyva " + UO.Count(GH.type) + " GH."); } if (Cekani_hlaska == true) { cekani(); } } else { UO.Print("Doprdele, neni GH!!"); if(keg_nouze==true){ nalij("GH"); UO.Wait(50); UO.UseType(GH.type); UO.Wait(500); UO.Print(0x0435, "Zbyva " + UO.Count(GH.type) + " GH."); } } break; case "TMR": if (UO.Count(TMR.type, TMR.color) > 0) { UO.UseType(TMR.type, TMR.color); UO.Wait(500); UO.Print(0x0480, "Zbyva " + UO.Count(TMR.type, TMR.color) + " TMR."); if (UO.Count(GH.type) <= 1) {World.Player.Print(0x0480, "Zbyva " + UO.Count(TMR.type, TMR.color) + " TMR."); } if (Cekani_hlaska == true) { cekani(); } } else { UO.Print("Doprdele, neni TMR!!"); if (keg_nouze == true) { nalij("TMR"); UO.Wait(50); UO.UseType(TMR.type, TMR.color); UO.Wait(500); UO.Print(0x0480, "Zbyva " + UO.Count(TMR.type, TMR.color) + " TMR."); } } break; case "TR": if (UO.Count(TR.type) > 0) { UO.UseType(TR.type); UO.Wait(500); UO.Print("Zbyva " + UO.Count(TR.type) + " TR."); if (UO.Count(GH.type) <= 1) {World.Player.Print("Zbyva " + UO.Count(TR.type) + " TR."); } if (Cekani_hlaska == true) { cekani(); } } else { UO.Print("Doprdele, neni TR!!"); if (keg_nouze == true) { nalij("TR"); UO.Wait(50); UO.UseType(TR.type); UO.Wait(500); UO.Print("Zbyva " + UO.Count(TR.type) + " TR."); } } break; case "GS": if (UO.Count(GS.type, GS.color) > 0) { UO.UseType(GS.type, GS.color); UO.Wait(500); UO.Print(0x0481, "Zbyva " + UO.Count(GS.type, GS.color) + " GS."); if (UO.Count(GH.type) <= 1) {World.Player.Print(0x0481, "Zbyva " + UO.Count(GS.type, GS.color) + " GS."); } if (Cekani_hlaska == true) { cekani(); } } else { UO.Print("Doprdele, neni GS!!"); if (keg_nouze == true) { nalij("GS"); UO.Wait(50); UO.UseType(GS.type, GS.color); UO.Wait(500); UO.Print(0x0481, "Zbyva " + UO.Count(GS.type, GS.color) + " GS."); } } break; case "GC": if (UO.Count(GC.type) > 0) { UO.UseType(GC.type); UO.Wait(500); UO.Print(0x0553, "Zbyva " + UO.Count(GC.type) + " GC."); if (UO.Count(GH.type) <= 1) {World.Player.Print(0x0553, "Zbyva " + UO.Count(GC.type) + " GC.") ;} if (Cekani_hlaska == true) { cekani(); } } else { UO.Print("Doprdele, neni GC!!"); if (keg_nouze == true) { nalij("GC"); UO.Wait(50); UO.UseType(GC.type); UO.Wait(500); UO.Print(0x0553, "Zbyva " + UO.Count(GC.type) + " GC."); } } break; case "GB": if (UO.Count(GB.type, GB.color) > 0) { UO.UseType(GB.type, GB.color); UO.Wait(500); UO.Print("Zbyva " + UO.Count(GB.type, GB.color) + " GB."); if (UO.Count(GH.type) <= 1) {World.Player.Print("Zbyva " + UO.Count(GB.type, GB.color) + " GB."); } if (Cekani_hlaska == true) { cekani(); } } else { UO.Print("Doprdele, neni GB!!"); if (keg_nouze == true) { nalij("GB"); UO.Wait(50); UO.UseType(GB.type, GB.color); UO.Wait(500); UO.Print("Zbyva " + UO.Count(GB.type, GB.color) + " GB."); } } break; case "LAVA": if (UO.Count(LA.type, LA.color) > 0) { UO.UseType(LA.type, LA.color); UO.Wait(500); UO.Print("Zbyva " + UO.Count(LA.type, LA.color) + " LAva."); if (UO.Count(GH.type) <= 1) {World.Player.Print("Zbyva " + UO.Count(LA.type, LA.color) + " LAva."); } if (Cekani_hlaska == true) { cekani(); } } else { UO.Print("Doprdele, neni LAVA!!"); if (keg_nouze == true) { nalij("LAVA"); UO.Wait(50); UO.UseType(LA.type, LA.color); UO.Wait(500); UO.Print("Zbyva " + UO.Count(LA.type, LA.color) + " LAva."); } } break; default: UO.PrintError("Spatne argumenty, nebo chybi napoj!! "); break; } } [Executable] public void nalij(String napoj) //cepuje { switch (napoj) { case "GH": if (UO.Count(GH.Keg_t, GH.Keg_c) > 0) { if (World.Player.Backpack.AllItems.Count(0x0F0E) > 0) { World.Player.ChangeWarmode(WarmodeChange.Switch); UO.WaitTargetObject(World.Player.Backpack.AllItems.FindType(0x0F0E)); UO.UseType(GH.Keg_t, GH.Keg_c); UO.Print(0x0435, "Cepnuto GH (" + UO.Count(GH.type, GH.color) + ")"); } else { UO.Print("Nemas lahvicky."); } } else { UO.Print("Nemas kad s GH"); } break; case "GB": if (UO.Count(GB.Keg_t, GB.Keg_c) > 0) { if (World.Player.Backpack.AllItems.Count(0x0F0E) > 0) { World.Player.ChangeWarmode(WarmodeChange.Switch); UO.WaitTargetObject(World.Player.Backpack.AllItems.FindType(0x0F0E)); UO.UseType(GB.Keg_t, GB.Keg_c); UO.Print("Cepnuto GB (" + UO.Count(GB.type, GB.color) + ")"); } else { UO.Print("Nemas lahvicky."); } } else { UO.Print("Nemas kad s GB"); } break; case "TMR": if (UO.Count(TMR.Keg_t, TMR.Keg_c) > 0) { if (World.Player.Backpack.AllItems.Count(0x0F0E) > 0) { World.Player.ChangeWarmode(WarmodeChange.Switch); UO.WaitTargetObject(World.Player.Backpack.AllItems.FindType(0x0F0E)); UO.UseType(TMR.Keg_t, TMR.Keg_c); UO.Print(0x0480, "Cepnuto TMR (" + UO.Count(TMR.type, TMR.color) + ")"); } else { UO.Print("Nemas lahvicky."); } } else { UO.Print("Nemas kad s TMR"); } break; case "GC": if (UO.Count(GC.Keg_t, GC.Keg_c) > 0) { if (World.Player.Backpack.AllItems.Count(0x0F0E) > 0) { World.Player.ChangeWarmode(WarmodeChange.Switch); UO.WaitTargetObject(World.Player.Backpack.AllItems.FindType(0x0F0E)); UO.UseType(GC.Keg_t, GC.Keg_c); UO.Print(0x0553, "Cepnuto GC (" + UO.Count(GC.type, GC.color) + ")"); } else { UO.Print("Nemas lahvicky."); } } else { UO.Print("Nemas kad s GC"); } break; case "GS": if (UO.Count(GS.Keg_t, GS.Keg_c) > 0) { if (World.Player.Backpack.AllItems.Count(0x0F0E) > 0) { World.Player.ChangeWarmode(WarmodeChange.Switch); UO.WaitTargetObject(World.Player.Backpack.AllItems.FindType(0x0F0E)); UO.UseType(GS.Keg_t, GS.Keg_c); UO.Print(0x0481, "Cepnuto GS (" + UO.Count(GS.type, GS.color) + ")"); } else { UO.Print("Nemas lahvicky."); } } else { UO.Print("Nemas kad s GS"); } break; case "TR": if (UO.Count(TR.Keg_t, TR.Keg_c) > 0) { if (World.Player.Backpack.AllItems.Count(0x0F0E) > 0) { World.Player.ChangeWarmode(WarmodeChange.Switch); UO.WaitTargetObject(World.Player.Backpack.AllItems.FindType(0x0F0E)); UO.UseType(TR.Keg_t, TR.Keg_c); UO.Print("Cepnuto TR (" + UO.Count(TR.type, TR.color) + ")"); } else { UO.Print("Nemas lahvicky."); } } else { UO.Print("Nemas kad s TR"); } break; case "LAVA": if (UO.Count(LA.Keg_t, LA.Keg_c) > 0) { if (World.Player.Backpack.AllItems.Count(0x0F0E) > 0) { World.Player.ChangeWarmode(WarmodeChange.Switch); UO.WaitTargetObject(World.Player.Backpack.AllItems.FindType(0x0F0E)); UO.UseType(LA.Keg_t, LA.Keg_c); UO.Print("Cepnuto LACA Bombiš (" + UO.Count(LA.type, LA.color) + ")"); } else { UO.Print("Nemas lahvicky."); } } else { UO.Print("Nemas kad s LAVA"); } break; default: UO.PrintError("Spatne argumenty, nebo chybi napoj!! "); break; } } // staci doplnit k potiontum cekani(); a je to tam .... internal void cekani() //cekani { UO.Wait(14000); int x = 0; do { UO.Wait(1000); x++; UO.Print("Zbyva: " + (5 - x) + " sec"); } while (x < 5); UO.Print("!!!!Muzes pit!!!!"); } } }