///////////////////////////////////////////////////////////////////////// // // www.ultima.smoce.net // Name: Cartography Train // ///////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using System.Text; using Phoenix; using Phoenix.WorldData; namespace Phoenix.NetGarden.Train { [RuntimeObject] public class Cartography { protected ushort[] map = {0x14EB, 0x0000}; protected ushort[] atlas = {0x0FBE, 0x0B98}; public Cartography() {} [Executable("train_cart")] public void train() { string[] continueText = { "Thy trembling hand results in an unusable map.", "You put the map in your pack." }; string[] stopText = { "You put the map in your pack." }; // -- vyber atlasu UO.Print("Target blank map atlas:"); Serial atlasItemSerial = UIManager.TargetObject(); UOItem atlasItem = new UOItem(atlasItemSerial); if (atlasItem.Graphic != this.atlas[0] || atlasItem.Color != this.atlas[1]) { throw new System.ApplicationException("Nevybral jsi atlas!"); } // -- uklidime mapy int mapsNum = UO.Count(this.map[0], this.map[1]); for (int i = 0; i < mapsNum; i++) { UO.WaitTargetType(this.map[0], this.map[1]); atlasItem.Use(); UO.Wait(500); } // -- trenink while (!World.Player.Dead && !Journal.Contains("xstop")) { // vyndame mapu z atlasu UO.WaitTargetSelf(); atlasItem.Use(); do { UO.Wait(500); } while (!World.Player.Backpack.Items.FindType(this.map[0], this.map[1]).Exist); // napiseme mapu UO.DeleteJournal(); while (!Journal.Contains(stopText)) { UO.DeleteJournal(); UO.WaitMenu("What sort of map", "Detail Map"); UO.UseType(this.map[0], this.map[1]); Journal.WaitForText(continueText); } // zreciklujeme mapu UO.WaitTargetType(this.map[0], this.map[1]); atlasItem.Use(); UO.Wait(500); } } } }