Ejemplo n.º 1
0
        private void GiveArcaneFocus(Mobile to, TimeSpan duration, int strengthBonus)
        {
            if (to == null)                     //Sanity
            {
                return;
            }

            ArcaneFocus focus = FindArcaneFocus(to);

            if (focus == null)
            {
                ArcaneFocus f = new ArcaneFocus(duration, strengthBonus);
                if (to.PlaceInBackpack(f))
                {
                    f.SendTimeRemainingMessage(to);
                    to.SendLocalizedMessage(1072740);                       // An arcane focus appears in your backpack.
                }
                else
                {
                    f.Delete();
                }
            }
            else                                  //OSI renewal rules: the new one will override the old one, always.
            {
                to.SendLocalizedMessage(1072828); // Your arcane focus is renewed.
                focus.LifeSpan      = duration;
                focus.CreationTime  = DateTime.Now;
                focus.StrengthBonus = strengthBonus;
                focus.InvalidateProperties();
                focus.SendTimeRemainingMessage(to);
            }
        }
Ejemplo n.º 2
0
        private void GiveArcaneFocus(Mobile to, TimeSpan duration, int strengthBonus)
        {
            if (to == null)     //Sanity
            {
                return;
            }

            ArcaneFocus focus = FindArcaneFocus(to);

            if (focus == null)
            {
                ArcaneFocus f = new ArcaneFocus((int)duration.TotalSeconds, strengthBonus);
                if (to.PlaceInBackpack(f))
                {
                    to.AddStatMod(new StatMod(StatType.Str, "[ArcaneFocus]", strengthBonus, duration));

                    f.SendTimeRemainingMessage(to);
                    to.SendLocalizedMessage(1072740); // An arcane focus appears in your backpack.
                }
                else
                {
                    f.Delete();
                }
            }
            else //OSI renewal rules: the new one will override the old one, always.
            {
                to.SendLocalizedMessage(1072828); // Your arcane focus is renewed.
                focus.TimeLeft      = (int)duration.TotalSeconds;
                focus.StrengthBonus = strengthBonus;
                focus.InvalidateProperties();
                focus.SendTimeRemainingMessage(to);
            }
        }
Ejemplo n.º 3
0
        public static int GetFocusLevel(Mobile from)
        {
            ArcaneFocus focus = FindArcaneFocus(from);

            if (focus == null || focus.Deleted)
            {
                return(0);
            }

            return(focus.StrengthBonus);
        }
Ejemplo n.º 4
0
        public static int GetFocusLevel(Mobile from)
        {
            ArcaneFocus focus = FindArcaneFocus(from);

            if (focus == null || focus.Deleted)
            {
                if (Core.TOL && from is BaseCreature && from.Skills[SkillName.Spellweaving].Value > 0)
                {
                    return((int)Math.Max(1, Math.Min(6, from.Skills[SkillName.Spellweaving].Value / 20)));
                }

                return(0);
            }

            return(focus.StrengthBonus);
        }
Ejemplo n.º 5
0
        public static int GetSDIBonus(Mobile m)
        {
            if (m_Table.ContainsKey(m))
            {
                int bonus = 10;

                ArcaneFocus focus = SpellweavingSpell.FindArcaneFocus(m);

                if (focus != null)
                {
                    bonus += focus.StrengthBonus;
                }

                return(bonus);
            }

            return(0);
        }
Ejemplo n.º 6
0
        public static int GetFocusLevel(Mobile from)
        {
            ArcaneFocus focus = FindArcaneFocus(from);

            return(focus?.Deleted != false ? 0 : focus.StrengthBonus);
        }