Esempio n. 1
0
        //Serial: 0x40213311  Name: "Fire Bolt scroll"  Position: 66.145.0  Flags: 0x0020  Color: 0x0070  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x40211101  Name: "Clumsy scroll"  Position: 66.68.0  Flags: 0x0020  Color: 0x0079  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x40218569  Name: "Necromancer's Armor scroll"  Position: 75.65.0  Flags: 0x0000  Color: 0x0040  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x40000C72  Name: "Curse scroll"  Position: 97.89.0  Flags: 0x0000  Color: 0x0099  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x4020FEF9  Name: "Hallucination scroll"  Position: 101.70.0  Flags: 0x0020  Color: 0x0010  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x4021E770  Name: "Dark scroll"  Position: 138.90.0  Flags: 0x0020  Color: 0x0050  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x40349B3E  Name: "Summon Undead scroll"  Position: 137.74.0  Flags: 0x0000  Color: 0x0005  Graphic: 0x0E35  Amount: 274  Layer: None Container: 0x4038402B
        //Serial: 0x402730C5  Position: 137.65.0  Flags: 0x0000  Color: 0x0020  Graphic: 0x0E35  Amount: 248  Layer: None Container: 0x4038402B

        //---------------------------------------------------------------------------------------------

        private static UOItem EnsureNecroScroll(NecromancySpell spell)
        {
            UOItem result = World.Player.FindType(SpellScrool[spell]);

            if (!result.Exist)
            {
                List <UOItem> scrools     = World.Player.Backpack.Items.Where(i => i.Graphic == 0x0E35).ToList();//new List<UOItem>();
                List <UOItem> exactScrool =
                    scrools.Where(i => !String.IsNullOrEmpty(i.Name) &&
                                  i.Name.ToLower().Replace(" ", "").StartsWith(Enum.GetName(typeof(NecromancySpell), spell).ToLower())).ToList();

                if (exactScrool.Count > 0)
                {
                    result = exactScrool[0];
                }
                else
                {
                    foreach (UOItem possibleItem in scrools.Where(i => String.IsNullOrEmpty(i.Name)).ToArray())
                    {
                        possibleItem.Click();
                        Game.Wait(100);

                        if (!String.IsNullOrEmpty(possibleItem.Name))
                        {
                            if (possibleItem.Name.ToLower().Replace(" ", "").StartsWith(Enum.GetName(typeof(NecromancySpell), spell).ToLower()))//Nefunguje na nekro armor
                            {
                                result = possibleItem;
                                break;
                            }
                        }
                    }
                }
            }

            if (!result.Exist)
            {
                if (BookOfDead.Exist)
                {
                    Kniha.Current.DeadBookUse((uint)spell);
                    Game.Wait(250);
                    result = World.Player.FindType(SpellScrool[spell]);

                    if (result.Exist)
                    {
                        result.Move(result.Amount, World.Player.Backpack.Serial);
                        Game.Wait(250);
                    }
                }
                else
                {
                    World.Player.PrintMessage("[Nemas Book of Dead..]", MessageType.Warning);
                }
            }

            return(result);
        }
Esempio n. 2
0
        //---------------------------------------------------------------------------------------------

        //TODO
        public CastResultInfo CastNecroSpell(NecromancySpell spell, string target)
        {
            Journal.Clear();
            CastResultInfo info = new CastResultInfo();

            info.Usage = CastUsage.Scrool;

            if (EnsureNecroScroll(spell))
            {
                World.Player.PrintMessage(spell + "" /*+  " [" + World.Player.FindType(SpellScrool[spell]).Amount + "ks]"*/);//spis regy
                Game.RunScriptCheck(5000);

                TargetInfo tInfo = Targeting.GetTarget(target);

                if (tInfo.Success)
                {
                    UOItem scroll = World.Player.FindType(SpellScrool[spell]);

                    scroll.Use();
                    if (tInfo.Object.Exist)
                    {
                        UO.WaitTargetObject(tInfo);
                    }
                    else
                    {
                        UO.WaitTargetTile(tInfo.StaticTarget.X, tInfo.StaticTarget.Y, tInfo.StaticTarget.Z, tInfo.StaticTarget.Graphic);
                    }

                    if (Journal.WaitForText(true, 150, "You can't see the target", "Target is not in line of sight"))
                    {
                        if (Journal.Contains(true, "You can't see the target"))
                        {
                            info.CantSee = true;
                            Game.PrintMessage("Cant SEE: " + tInfo.StaticTarget.Serial + " / " + tInfo.Object.Exist + " / " + tInfo.Character.Name);
                        }
                        else if (Journal.Contains(true, "Target is not in line of sight"))
                        {
                            info.NoInLineOfSight = true;
                            tInfo.Object.PrintMessage("[Not in sight]", Game.Val_LightPurple);
                        }
                    }
                }
            }

            return(info);
        }
Esempio n. 3
0
        //Serial: 0x40213311  Name: "Fire Bolt scroll"  Position: 66.145.0  Flags: 0x0020  Color: 0x0070  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x40211101  Name: "Clumsy scroll"  Position: 66.68.0  Flags: 0x0020  Color: 0x0079  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x40218569  Name: "Necromancer's Armor scroll"  Position: 75.65.0  Flags: 0x0000  Color: 0x0040  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x40000C72  Name: "Curse scroll"  Position: 97.89.0  Flags: 0x0000  Color: 0x0099  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x4020FEF9  Name: "Hallucination scroll"  Position: 101.70.0  Flags: 0x0020  Color: 0x0010  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x4021E770  Name: "Dark scroll"  Position: 138.90.0  Flags: 0x0020  Color: 0x0050  Graphic: 0x0E35  Amount: 100  Layer: None Container: 0x4038402B
        //Serial: 0x40349B3E  Name: "Summon Undead scroll"  Position: 137.74.0  Flags: 0x0000  Color: 0x0005  Graphic: 0x0E35  Amount: 274  Layer: None Container: 0x4038402B
        //Serial: 0x402730C5  Position: 137.65.0  Flags: 0x0000  Color: 0x0020  Graphic: 0x0E35  Amount: 248  Layer: None Container: 0x4038402B

        //---------------------------------------------------------------------------------------------

        private static bool EnsureNecroScroll(NecromancySpell spell)
        {
            bool result = World.Player.FindType(SpellScrool[spell]).Exist;

            if (!result)
            {
                if (BookOfDead.Exist)
                {
                    Kniha.Current.DeadBookUse((uint)spell);
                    Game.Wait();
                    result = World.Player.FindType(SpellScrool[spell]).Exist;
                }
                else
                {
                    World.Player.PrintMessage("[Nemas Book of Dead..]", MessageType.Warning);
                }
            }

            return(result);
        }
Esempio n. 4
0
        //---------------------------------------------------------------------------------------------

        public static bool ParseSpell(string spellName, out NecromancySpell resultSpell)
        {
            resultSpell = NecromancySpell.Invalid;

            spellName.Replace("Necro_", "");

            try
            {
                resultSpell = (NecromancySpell)Enum.Parse(typeof(NecromancySpell), spellName);
            }
            catch { resultSpell = NecromancySpell.Invalid; }

            if (resultSpell == NecromancySpell.Invalid)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }