Exemplo n.º 1
0
        private string PrintState()
        {
            UOPlayer p    = World.Player;
            string   temp = "";

            temp = "HP: " + p.Hits + "/" + p.MaxHits                        //11
                   + "  ||  Mana: " + p.Mana + "/" + p.MaxMana              //19
                   + "  ||  Stamina: " + p.Stamina + "/" + p.MaxStamina     //22
                   + "  ||  Sila: " + p.Strenght                            //15
                   + "  ||  Stealth: " + p.Skills["Stealth"].RealValue / 10 //18
                   + "  ||  Weight: " + p.Weight + "/" + p.MaxWeight        //21
                   + "  ||  Armor: " + p.Armor                              //16
                   + "  ||  Gold: " + p.Gold;                               //20  =109-->110+110=220 124-->125+125=290

            if (World.GetCharacter(Aliases.GetObject("laststatus")).Distance < 20 && World.GetCharacter(Aliases.GetObject("laststatus")).Hits > -1)
            {
                if (temp.Length < 145)
                {
                    for (int i = 0; i < 145 - temp.Length; i++)
                    {
                        temp += " ";
                    }
                    temp += "                              "; //40 znaku
                    temp += "                              "; //40 znaku
                }
                temp += World.GetCharacter(Aliases.GetObject("laststatus")).Name
                        + ": "
                        + World.GetCharacter(Aliases.GetObject("laststatus")).Hits
                        + "/"
                        + World.GetCharacter(Aliases.GetObject("laststatus")).MaxHits
                        + "   Distance: "
                        + World.GetCharacter(Aliases.GetObject("laststatus")).Distance;
            }
            return(temp);
        }
Exemplo n.º 2
0
        public static UOItem FindType(this UOPlayer player, Graphic graphic, UOColor color, Serial serial)
        {
            UOItem searchItem = new UOItem(Serial.Invalid);

            if (serial.IsValid)
            {
                List <UOItem> search = new List <UOItem>();
                search.AddRange(player.Backpack.AllItems.ToArray());
                search.AddRange(player.Layers.ToArray());

                foreach (UOItem itm in search)
                {
                    if (itm.Serial.IsValid && itm.Exist && itm.Serial == serial)
                    {
                        searchItem = itm;
                        break;
                    }
                }
            }

            if (!searchItem.Serial.IsValidCust() || !searchItem.Exist)
            {
                searchItem = color.IsConstant ? player.Backpack.Items.FindType(graphic, color) : player.Backpack.Items.FindType(graphic);

                if (!searchItem.Serial.IsValidCust() || !searchItem.Exist)
                {
                    searchItem = color.IsConstant ? player.Backpack.AllItems.FindType(graphic, color) : player.Backpack.AllItems.FindType(graphic);
                    if (!searchItem.Serial.IsValidCust() || !searchItem.Exist)
                    {
                        searchItem = color.IsConstant ? player.Layers.FindType(graphic, color) : player.Layers.FindType(graphic);
                    }
                }
            }
            return(searchItem);
        }
Exemplo n.º 3
0
        private void Initialize()
        {
            data.Clear();

            data.Add("|");
            AddItem("MR", CalExtension.UOExtensions.Reagent.MandrakeRoot.Graphic, CalExtension.UOExtensions.Reagent.MandrakeRoot.Color);
            AddItem("BM", CalExtension.UOExtensions.Reagent.BloodMoss.Graphic, CalExtension.UOExtensions.Reagent.BloodMoss.Color);
            AddItem("SS", CalExtension.UOExtensions.Reagent.SpidersSilk.Graphic, CalExtension.UOExtensions.Reagent.SpidersSilk.Color);
            AddItem("SA", CalExtension.UOExtensions.Reagent.SulphurousAsh.Graphic, CalExtension.UOExtensions.Reagent.SulphurousAsh.Color);
            AddItem("GA", CalExtension.UOExtensions.Reagent.Garlic.Graphic, CalExtension.UOExtensions.Reagent.Garlic.Color);
            AddItem("NS", CalExtension.UOExtensions.Reagent.Nightshade.Graphic, CalExtension.UOExtensions.Reagent.Nightshade.Color);
            AddItem("BP", CalExtension.UOExtensions.Reagent.BlackPearl.Graphic, CalExtension.UOExtensions.Reagent.BlackPearl.Color);
            AddItem("GS", CalExtension.UOExtensions.Reagent.Ginseng.Graphic, CalExtension.UOExtensions.Reagent.Ginseng.Color);


            data.Add("|");
            AddItem("GH", CalExtension.UOExtensions.Potion.Heal.DefaultGraphic, CalExtension.UOExtensions.Potion.Heal.DefaultColor);
            AddItem("GS", CalExtension.UOExtensions.Potion.Strength.DefaultGraphic, CalExtension.UOExtensions.Potion.Strength.DefaultColor);
            AddItem("GC", CalExtension.UOExtensions.Potion.Cure.DefaultGraphic, CalExtension.UOExtensions.Potion.Cure.DefaultColor);
            AddItem("TR", CalExtension.UOExtensions.Potion.Refresh.DefaultGraphic, CalExtension.UOExtensions.Potion.Refresh.DefaultColor);
            AddItem("TMR", CalExtension.UOExtensions.Potion.TotalManaRefresh.DefaultGraphic, CalExtension.UOExtensions.Potion.TotalManaRefresh.DefaultColor);
            //AddItem("MR", CalExtension.UOExtensions.Potion.TotalManaRefresh.DefaultGraphic, CalExtension.UOExtensions.Potion.TotalManaRefresh.DefaultColor);
            data.Add("|");
            AddItem("B", 0x0E21, 0);
            AddItem("BB", 0x0E20, 0);

            player          = World.Player;
            player.Changed += new ObjectChangedEventHandler(Player_Changed);

            UpdateText();
        }
Exemplo n.º 4
0
        //---------------------------------------------------------------------------------------------

        public static UOItem CurrentShield(this UOPlayer player)
        {
            if (World.Player.Layers[Layer.LeftHand].ExistCust() && ItemLibrary.Shields.GraphicArray.Where(i => i == World.Player.Layers[Layer.LeftHand].Graphic).ToArray().Length > 0)//obourucka
            {
                return(World.Player.Layers[Layer.LeftHand]);
            }

            return(new UOItem(Serial.Invalid));
        }
Exemplo n.º 5
0
        //---------------------------------------------------------------------------------------------

        public static UOItem CurrentWeapon(this UOPlayer player)
        {
            if (World.Player.Layers[Layer.RightHand].ExistCust())//jednorucka
            {
                return(World.Player.Layers[Layer.RightHand]);
            }
            else if (World.Player.Layers[Layer.LeftHand].ExistCust() && !World.Player.Layers[Layer.RightHand].ExistCust())//obourucka
            {
                return(World.Player.Layers[Layer.LeftHand]);
            }

            return(new UOItem(Serial.Invalid));
        }
Exemplo n.º 6
0
        //---------------------------------------------------------------------------------------------

        public static UOItem FindType(this UOPlayer player, Graphic graphic, UOColor color)
        {
            UOItem searchItem = new UOItem(Serial.Invalid);

            searchItem = color.IsConstant ? player.Backpack.Items.FindType(graphic, color) : player.Backpack.Items.FindType(graphic);

            if (!searchItem.Serial.IsValidCust() || !searchItem.Exist)
            {
                searchItem = color.IsConstant ? player.Backpack.AllItems.FindType(graphic, color) : player.Backpack.AllItems.FindType(graphic);
                if (!searchItem.Serial.IsValidCust() || !searchItem.Exist)
                {
                    searchItem = color.IsConstant ? player.Layers.FindType(graphic, color) : player.Layers.FindType(graphic);
                }
            }
            return(searchItem);
        }
Exemplo n.º 7
0
        //---------------------------------------------------------------------------------------------

        public static UOItem FindColor(this UOPlayer player, UOColor color, params Graphic[] graphics)
        {
            UOItem searchItem = new UOItem(Serial.Invalid);

            List <UOItem> items = new List <UOItem>();

            items.AddRange(player.Backpack.AllItems.ToArray());

            foreach (UOItem item in World.Player.Layers)
            {
                items.Add(item);
            }

            foreach (UOItem item in items)
            {
                if (item.Color == color && (graphics.Length == 0 || Array.IndexOf(graphics, item.Graphic) >= 0))
                {
                    searchItem = item;
                    break;
                }
            }

            return(searchItem);
        }
Exemplo n.º 8
0
 //---------------------------------------------------------------------------------------------
 public static UOItem FindType(this UOPlayer player, Graphic graphic, UOColor color)
 {
     return(FindType(player, graphic, color, Serial.Invalid));
 }
Exemplo n.º 9
0
        //---------------------------------------------------------------------------------------------

        public static UOItem FindType(this UOPlayer player, IUOItemType itemType)
        {
            return(FindType(player, itemType.Graphic, itemType.Color));
        }
Exemplo n.º 10
0
        //---------------------------------------------------------------------------------------------

        public static UOItem FindType(this UOPlayer player, Graphic graphic)
        {
            return(FindType(player, graphic, UOColor.Invariant));
        }
Exemplo n.º 11
0
        //---------------------------------------------------------------------------------------------

        public static UOItem FindColor(this UOPlayer player, UOColor color)
        {
            return(FindColor(player, color, new Graphic[0]));
        }