예제 #1
0
        private static void EventSink_Login(LoginEventArgs args)
        {
            if (!CentralMemory.Running || !CSS.Running)
            {
                return;
            }

            Mobile m = args.Mobile;

            IconsModule im = (IconsModule)CentralMemory.GetModule(m.Serial, typeof(IconsModule));

            if (im == null)
            {
                return;
            }

            IconsModule imRemove = new IconsModule(m.Serial);

            foreach (KeyValuePair <Type, IconInfo> kvp in im.Icons)
            {
                IconInfo ii = kvp.Value;
                if (ii == null)
                {
                    imRemove.Add(ii);
                    continue;
                }

                if (ii.SpellType == null || ii.School == School.Invalid)
                {
                    imRemove.Add(ii);
                    continue;
                }

                if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(m, ii.School))
                {
                    imRemove.Add(ii);
                    continue;
                }

                m.SendGump(new SpellIconGump(ii));
            }

            if (im.Icons.Count > 0)
            {
                CentralMemory.AppendModule(m.Serial, (Module)imRemove, true);
            }
        }
예제 #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.AccessLevel == AccessLevel.Player)
            {
                Container pack = from.Backpack;
                if (!(Parent == from || (pack != null && Parent == pack)))
                {
                    from.SendMessage("O livro deve estar na sua mochila para ser aberto. Não pode estar dentro de outro container.");
                    return;
                }
                else if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(from, this.School))
                {
                    return;
                }
            }

            from.CloseGump(typeof(SeminaristaSpellbookGump));
            from.SendGump(new SeminaristaSpellbookGump(this));
        }
예제 #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.AccessLevel == AccessLevel.Player)
            {
                Container pack = from.Backpack;
                if (!(Parent == from || (pack != null && Parent == pack)))
                {
                    from.SendMessage("The spellbook must be in your backpack [and not in a container within] to open.");
                    return;
                }
                else if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(from, this.School))
                {
                    return;
                }
            }

            from.CloseGump(typeof(RangerSpellbookGump));
            from.SendGump(new RangerSpellbookGump(this));
        }