Пример #1
0
        //---------------------------------------------------------------------------------------------

        public void CastSpell(string spellName, string target, bool useScrool, bool useSwitchHeadScrool, bool silence, bool forceScrool)
        {
            if (String.IsNullOrEmpty(spellName))
            {
                World.Player.PrintMessage("[Zvol kouzlo..]", MessageType.Error);
            }
            else
            {
                if (Necromancy.IsNecroSpell(spellName))
                {
                    Necromancy.Current.CastNecroSpell(spellName, target);
                }
                else
                {
                    StandardSpell sp;
                    if (Magery.ParseSpell(spellName, out sp))
                    {
                        this.CastSpell(sp, Targeting.ParseTargets((target == null ? "" : target).Split(',')), useScrool, useSwitchHeadScrool, silence, forceScrool);
                    }
                    else
                    {
                        Game.PrintMessage("Cast: " + spellName + " - Neexistuje!!!");
                    }
                }
            }
        }
Пример #2
0
        //---------------------------------------------------------------------------------------------

        public static UOColor GetSpellPrintColor(string spellName)
        {
            StandardSpell sp;

            if (Magery.ParseSpell(spellName, out sp) && Magery.SpellPrinColor.ContainsKey(sp))
            {
                return(Magery.SpellPrinColor[sp]);
            }

            return(new UOColor(0x096));
        }
Пример #3
0
        //---------------------------------------------------------------------------------------------

        public void MoveSpellNext(int direction, List <StandardSpell> switchCol)
        {
            if (switchCol == null)
            {
                switchCol = Magery.GetStandardSpells();             //Nebo all
            }
            int index = 0;

            try
            {
                StandardSpell sp;
                if (Magery.ParseSpell(this.SelectedSpell, out sp))
                {
                    index = UOExtensions.Utils.GetSwitchIndex(switchCol.IndexOf(sp), direction, switchCol.Count);
                }
            }
            catch { index = 0; }
            this.SelectedSpellSet = switchCol[index].ToString();
        }
Пример #4
0
        //---------------------------------------------------------------------------------------------

        public static List <StandardSpell> GetStandardSpells(params string[] spellNames)
        {
            List <StandardSpell> list = new List <StandardSpell>();

            if (spellNames.Length == 0 || (spellNames.Length == 1 && spellNames[0].ToLower() == "all"))
            {
                foreach (int val in Enum.GetValues(typeof(StandardSpell)))
                {
                    list.Add((StandardSpell)val);
                }
            }
            else
            {
                foreach (string name in spellNames)
                {
                    StandardSpell spell;
                    if (Magery.ParseSpell(name.Trim(), out spell) && !list.Contains(spell))
                    {
                        list.Add(spell);
                    }
                }
            }
            return(list);
        }