Beispiel #1
0
        private void Peace_Entic(StandardSkill Skill, Serial Target)
        {
            if (Target == null)
            {
                Core.UnregisterServerMessageCallback(0x1C, OnCalls);
                MusicDone = true;
                return;
            }
            MusicDoneFailSafe();
            UOCharacter tmp = new UOCharacter(Target);

            MusicDone = false;
            if (tmp.Distance > 18)
            {
                MusicDone = true;
                return;
            }
            tmp.WaitTarget();
            UO.UseSkill(Skill);
        }
Beispiel #2
0
        public void HideDruid(int wait)
        {
            Journal.Clear();
            Game.CurrentGame.CurrentPlayer.SwitchWarmode();

            StandardSkill usedSkill = StandardSkill.Hiding;

            SkillValue hidingSV  = SkillsHelper.GetSkillValue("Hiding");
            SkillValue stealthSV = SkillsHelper.GetSkillValue("Stealth");

            if (stealthSV.RealValue > hidingSV.RealValue)
            {
                usedSkill = StandardSkill.Stealth;
            }


            Game.RunScript(3000);


            UO.UseSkill(usedSkill);


            AsyncCounter counter = new AsyncCounter();

            counter.PrefixText    = "Vracecka: ";
            counter.HighlightTime = 1500;
            counter.Step          = 400;
            counter.StopMessage   = "You can't seem to hide here,You have hidden yourself well,You can't do much in your";
            counter.StopMethod    = IsHidden;
            counter.Run();

            if (World.Player.Backpack.AllItems.FindType(0x1B17, 0x0493).Exist)
            {
                Game.Wait(wait);
                UO.UseType(0x1B17, 0x0493);
            }
            else
            {
                World.Player.PrintMessage("Nemas artefakt!");
            }
        }
Beispiel #3
0
        public static void TrainSkill(string skillName, int timeout, bool useObject)
        {
            try
            {
                //StandardSkill.DetectingHidden
                StandardSkill skill = (StandardSkill)Enum.Parse(typeof(StandardSkill), skillName, true);
                UOItem        item  = new UOItem(Serial.Invalid);
                if (useObject)
                {
                    Game.PrintMessage("Vyber predmet:");
                    item = Targeting.GetTarget(null);
                }

                Game.CurrentGame.Mode = GameMode.Working;

                while (!UO.Dead)
                {
                    if (useObject)
                    {
                        if (item.ExistCust())
                        {
                            UO.WaitTargetObject(item);
                        }
                        else
                        {
                            Game.PrintMessage("Predmet neexistuje!");
                            break;
                        }
                    }

                    UO.UseSkill(skill);
                    Game.Wait(timeout);
                }
            }
            catch
            {
                Game.PrintMessage("Ivalid Skill name");
            }
        }
Beispiel #4
0
        public void Hide(int highlightTime, ushort highlightColor, int counterStep, Graphic dropItemGraphic, UOColor dropItemColor)
        {
            Journal.Clear();
            Game.CurrentGame.CurrentPlayer.SwitchWarmode();

            StandardSkill usedSkill = StandardSkill.Hiding;

            SkillValue hidingSV  = SkillsHelper.GetSkillValue("Hiding");
            SkillValue stealthSV = SkillsHelper.GetSkillValue("Stealth");

            if (stealthSV.RealValue > hidingSV.RealValue)
            {
                usedSkill = StandardSkill.Stealth;
            }

            if (World.Player.Layers[Layer.LeftHand].Graphic == 0x0A15)//lantern
            {
                UOItem shield = new UOItem(Serial.Invalid);

                List <UOItem> items = new List <UOItem>();
                items.AddRange(World.Player.Backpack.Items);

                foreach (UOItem item in items)
                {
                    foreach (Graphic g in ItemLibrary.Shields.GraphicArray)
                    {
                        if (item.Graphic == g && (!shield.Exist || shield.Graphic != 0x1B76))
                        {
                            shield = item;
                        }
                    }
                }

                if (shield.Exist)
                {
                    shield.Use();
                }
                else
                {
                    World.Player.Layers[Layer.LeftHand].Move(1, World.Player.Backpack, 100, 30);
                }

                Game.Wait(150);
            }


            Game.RunScript(3000);

            AsyncCounter counter = new AsyncCounter();

            counter.PrefixText = "";
            if (highlightTime > 0)
            {
                counter.HighlightTime = highlightTime;
            }

            if (highlightColor > 0)
            {
                counter.HighlightColor = highlightColor;
            }


            if (!dropItemGraphic.IsInvariant)
            {
                int origDistance = World.FindDistance;
                World.FindDistance = 3;
                UOItem item = World.Ground.FindType(dropItemGraphic, dropItemColor);
                if (item.Exist && item.Distance <= 3)
                {
                    item.Move(item.Amount, World.Player.Backpack);
                }
                World.FindDistance = origDistance;
            }

            Hiding.HideRunning = true;
            UO.UseSkill(usedSkill);
            Game.Wait(50);

            if (!dropItemGraphic.IsInvariant && World.Player.Backpack.AllItems.FindType(dropItemGraphic, dropItemColor).Exist)
            {
                DropItemGraphic = dropItemGraphic;
                DropItemColor   = dropItemColor;

                counter.RunComplete += Counter_RunComplete;
            }


            counter.Step        = counterStep;
            counter.StopMessage = "You can't seem to hide here,You have hidden yourself well";
            counter.StopMethod  = IsHidden;
            counter.Run();
        }
Beispiel #5
0
        public void HideInBattle(int highlightTime, ushort highlightColor, int counterStep)
        {
            if (World.Player.Layers[Layer.LeftHand].Graphic == 0x0A15)//lantern
            {
                UOItem shield = new UOItem(Serial.Invalid);

                List <UOItem> items = new List <UOItem>();
                items.AddRange(World.Player.Backpack.Items);

                foreach (UOItem item in items)
                {
                    foreach (Graphic g in ItemLibrary.Shields.GraphicArray)
                    {
                        if (item.Graphic == g && (!shield.Exist || shield.Graphic != 0x1B76))
                        {
                            shield = item;
                        }
                    }
                }

                if (shield.Exist)
                {
                    shield.Use();
                }
                else
                {
                    World.Player.Layers[Layer.LeftHand].Move(1, World.Player.Backpack, 100, 30);
                }

                Game.Wait(250);
            }


            Journal.Clear();
            SkillValue    hidingSV  = SkillsHelper.GetSkillValue("Hiding");
            SkillValue    stealthSV = SkillsHelper.GetSkillValue("Stealth");
            StandardSkill usedSkill = StandardSkill.Hiding;

            if (stealthSV.RealValue > hidingSV.RealValue)
            {
                usedSkill = StandardSkill.Stealth;
            }

            AsyncCounter counter = new AsyncCounter();

            counter.PrefixText = "";
            if (highlightTime > 0)
            {
                counter.HighlightTime = highlightTime;
            }

            if (highlightColor > 0)
            {
                counter.HighlightColor = highlightColor;
            }

            Game.RunScript(3000);
            UO.UseSkill(usedSkill);

            if (Journal.WaitForText(true, 200, "You are preoccupied with thoughts of battle"))
            {
                Game.CurrentGame.CurrentPlayer.SwitchWarmode();
                World.Player.PrintMessage("[ Preoccupied ]", MessageType.Warning);
                Game.Wait(250);

                if (World.Player.Hits < World.Player.Strenght)
                {
                    UO.BandageSelf();
                }
                else
                {
                    UO.UseSkill(StandardSkill.Meditation);
                }

                //else if (World.Player.Mana > 4)
                //  UO.Cast(StandardSpell.MagicArrow, World.Player.Serial);
            }
            else
            {
                counter.Step        = counterStep;
                counter.StopMessage = "You can't seem to hide here,You have hidden yourself well";
                counter.StopMethod  = IsHidden;
                counter.Run();
            }


            //You are preoccupied with thoughts of battle

            //Game.RunScript(3500);



            //Hiding.HideRunning = true;

            //if (needAction)
            //{
            //  World.Player.PrintMessage("[ HID Action ]", MessageType.Warning);

            //  if (World.Player.Hits < World.Player.Strenght)
            //    UO.BandageSelf();
            //  else if (World.Player.Mana > 4)
            //    UO.Cast(StandardSpell.MagicArrow, World.Player.Serial);
            //}

            //Game.Wait(250);
            //UO.UseSkill(usedSkill);
            //Game.Wait(50);
        }
Beispiel #6
0
        public void Hide(int highlightTime, ushort highlightColor, int counterStep)
        {
            Journal.Clear();
            Game.CurrentGame.CurrentPlayer.SwitchWarmode();

            StandardSkill usedSkill = StandardSkill.Hiding;

            SkillValue hidingSV  = SkillsHelper.GetSkillValue("Hiding");
            SkillValue stealthSV = SkillsHelper.GetSkillValue("Stealth");

            if (stealthSV.RealValue > hidingSV.RealValue)
            {
                usedSkill = StandardSkill.Stealth;
            }

            if (World.Player.Layers[Layer.LeftHand].Graphic == 0x0A15)//lantern
            {
                UOItem shield = new UOItem(Serial.Invalid);

                List <UOItem> items = new List <UOItem>();
                items.AddRange(World.Player.Backpack.Items);

                foreach (UOItem item in items)
                {
                    foreach (Graphic g in ItemLibrary.Shields.GraphicArray)
                    {
                        if (item.Graphic == g && (!shield.Exist || shield.Graphic != 0x1B76))
                        {
                            shield = item;
                        }
                    }
                }

                if (shield.Exist)
                {
                    shield.Use();
                }
                else
                {
                    World.Player.Layers[Layer.LeftHand].Move(1, World.Player.Backpack, 100, 30);
                }

                Game.Wait(150);
            }
            //UOItem whWepna = World.Player.FindColor(0x0B60, new Graphic[] { 0x143A, 0x1404, 0x0F62, 0x13B9, 0x0F5C, 0x1438, 0x0F60, 0x0F5E, 0x0E87 });        //Nightstone zbran u WJ
            //if (whWepna.Exist && whWepna.Layer != Layer.LeftHand && whWepna.Layer != Layer.RightHand)
            //{
            //  whWepna.Use();
            //  Game.Wait(150);
            //  Targeting.ResetTarget();

            //}

            Game.RunScript(3000);

            AsyncCounter counter = new AsyncCounter();

            counter.PrefixText = "";
            if (highlightTime > 0)
            {
                counter.HighlightTime = highlightTime;
            }

            if (highlightColor > 0)
            {
                counter.HighlightColor = highlightColor;
            }

            Hiding.HideRunning = true;
            UO.UseSkill(usedSkill);
            Game.Wait(50);
            counter.Step        = counterStep;
            counter.StopMessage = "You can't seem to hide here,You have hidden yourself well";
            counter.StopMethod  = IsHidden;
            counter.Run();
        }
Beispiel #7
0
        public void HideRay(int highlightTime, ushort highlightColor, int counterStep)
        {
            Journal.Clear();


            StandardSkill usedSkill = StandardSkill.Hiding;

            SkillValue hidingSV  = SkillsHelper.GetSkillValue("Hiding");
            SkillValue stealthSV = SkillsHelper.GetSkillValue("Stealth");

            if (stealthSV.RealValue > hidingSV.RealValue)
            {
                usedSkill = StandardSkill.Stealth;
            }

            if (World.Player.Layers[Layer.LeftHand].Graphic == 0x0A15)//lantern
            {
                UOItem shield = new UOItem(Serial.Invalid);

                List <UOItem> items = new List <UOItem>();
                items.AddRange(World.Player.Backpack.Items);

                foreach (UOItem item in items)
                {
                    foreach (Graphic g in ItemLibrary.Shields.GraphicArray)
                    {
                        if (item.Graphic == g && (!shield.Exist || shield.Graphic != 0x1B76))
                        {
                            shield = item;
                        }
                    }
                }

                if (shield.Exist)
                {
                    shield.Use();
                }
                else
                {
                    World.Player.Layers[Layer.LeftHand].Move(1, World.Player.Backpack, 100, 30);
                }

                Game.Wait(250);
            }


            Game.RunScript(3000);

            AsyncCounter counter = new AsyncCounter();

            counter.PrefixText = "";
            if (highlightTime > 0)
            {
                counter.HighlightTime = highlightTime;
            }

            if (highlightColor > 0)
            {
                counter.HighlightColor = highlightColor;
            }

            Hiding.HideRunning = true;

            UO.BandageSelf();
            Game.Wait(100);
            UO.UseSkill(usedSkill);
            Game.Wait(50);
            counter.Step        = counterStep;
            counter.StopMessage = "You can't seem to hide here,You have hidden yourself well";
            counter.StopMethod  = IsHidden;
            counter.Run();
        }
Beispiel #8
0
 /// <summary>
 /// Uses the skill.
 /// </summary>
 /// <param name="skill">The skill.</param>
 public static void UseSkill(StandardSkill skill)
 {
     Core.SendToServer(PacketBuilder.UseSkill((ushort)skill), true);
 }
Beispiel #9
0
 /// <summary>
 /// Uses the skill.
 /// </summary>
 /// <param name="skill">The skill.</param>
 public static void UseSkill(StandardSkill skill)
 {
     Core.SendToServer(PacketBuilder.UseSkill((ushort)skill), true);
 }