Пример #1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            Pause pauseatt = (Pause)XmlAttach.FindAttachment(from, typeof(Pause));

            switch (info.ButtonID)
            {
            case 0:
            {
                from.CloseGump(typeof(Pausegump));
                break;
            }

            case 1:
            {
                from.CloseGump(typeof(Pausegump));

                if (pauseatt.Paused == true)
                {
                    pauseatt.Paused = false;
                    from.Hidden     = false;
                    from.Paralyzed  = false;
                    from.Frozen     = false;
                    from.Blessed    = false;

                    from.SendMessage("Pause deactivated.");

                    PlayerMobile pm = (PlayerMobile)from;
                    ((PlayerMobile)pm).ClaimAutoStabledPets();
                }
                break;
            }
            }
        }
        private static void EventSink_Login(LoginEventArgs args)
        {
            Mobile m = args.Mobile;

            if (args.Mobile.NetState == null)
            {
                return;
            }

            if (m is PlayerMobile)
            {
                PlayerMobile             pm        = (PlayerMobile)m;
                Configured               c         = new Configured();
                XMLDeleteLevelAttOnLogin cr        = new XMLDeleteLevelAttOnLogin();
                XMLPlayerLevelAtt        xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt));
                if (xmlplayer != null && cr.ActivateDeleteOnLogin == true)
                {
                    xmlplayer.Delete();
                }
                else
                {
                    return;
                }
            }
        }
Пример #3
0
        public static int Classic(Mobile from)
        {
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = from as PlayerMobile;

            int exp      = LevelCore.GetExp(pm);//LevelCore.Stats(pm) + LevelCore.Skills(pm);
            int ToLevell = (int)(xmlplayer.Levell * 100);
            int highest  = 100;

            if (Cl.Enabled)
            {
                if (exp >= ToLevell && xmlplayer.Levell != highest)
                {
                    xmlplayer.Levell  += 1;
                    xmlplayer.ToLevell = (int)(xmlplayer.Levell * 100);

                    if (exp >= ToLevell)
                    {
                        LevelHandler.Classic(pm);
                    }

                    return(exp);
                }
                return(exp);
            }
            return(0);
        }
Пример #4
0
        public override void OnAttach()
        {
            Configured c = new Configured();

            base.OnAttach();
            if (AttachedTo is PlayerMobile)
            {
                XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(((PlayerMobile)AttachedTo), typeof(XMLPlayerLevelAtt));
                if (xmlplayer == null)
                {
                    return;
                }
                else
                {
                    if (xmlplayer.Levell < c.WhatLevelToDelete)
                    {
                        ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Dex, "XmlDex" + Name, c.StatBonusDex, TimeSpan.Zero));
                        ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Str, "XmlStr" + Name, c.StatBonusStr, TimeSpan.Zero));
                        ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Int, "XmlInt" + Name, c.StatBonusInt, TimeSpan.Zero));
                        InvalidateParentProperties();
                    }
                    else
                    {
                        Delete();
                    }
                }
            }
            else
            {
                Delete();
            }
        }
Пример #5
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            AddOnEditor_Att addoneditor = (AddOnEditor_Att)XmlAttach.FindAttachment(from, typeof(AddOnEditor_Att));

            if (info.ButtonID == (int)Buttons.Select)
            {
                from.Target = new Select_Target(from);
                Resend(from);
            }
            if (addoneditor.SelectedAddon != null)
            {
                if (info.ButtonID == (int)Buttons.AddItem)
                {
                    from.Target = new Add_Target(from);
                }
                else if (info.ButtonID == (int)Buttons.RemoveItem)
                {
                    from.Target = new Remove_Target(from, false);
                }
                else if (info.ButtonID == (int)Buttons.DeleteItem)
                {
                    from.Target = new Remove_Target(from, true);
                }
                else if (info.ButtonID == (int)Buttons.InspectItem)
                {
                }
                Resend(from);
            }
            else
            {
                from.SendMessage("You must select an Addon first!");
            }
        }
Пример #6
0
            protected override void OnTarget(Mobile from, object targ)
            {
                AddOnEditor_Att addoneditor = (AddOnEditor_Att)XmlAttach.FindAttachment(from, typeof(AddOnEditor_Att));

                BaseAddon addon = addoneditor.SelectedAddon;

                AddonComponent component = (AddonComponent)targ;

                if (component.Addon == addon)
                {
                    from.SendMessage("You cannot add an Addon to itself");
                    from.Target = new Add_Target(from);
                }

                else if (targ is Item)
                {
                    Item item = (Item)targ;

                    addon.AddComponent(new AddonComponent(item.ItemID), item.X - addon.X, item.Y - addon.Y, addon.Z);

                    item.Delete();
                }
                else
                {
                    from.SendMessage("That is not an Item.");
                    from.Target = new Add_Target(from);
                }
            }
Пример #7
0
        private void OnPickedInstrument(Mobile from, BaseInstrument instrument)
        {
            if (!instrument.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001); //This must be in your backpack
            }

            XmlMusic xm = (XmlMusic)XmlAttach.FindAttachment(instrument, typeof(XmlMusic));

            if (xm == null)
            {
                XmlAttach.AttachTo(instrument, new XmlMusic());
            }
            try
            {
                xm = (XmlMusic)XmlAttach.FindAttachment(instrument, typeof(XmlMusic));
                List <string> tempSong = new List <string>(m_Song);
                string        speed    = tempSong[0];
                tempSong.RemoveAt(0);
                xm.PlayList = LoadPlayList(from, speed, tempSong);
                xm.Song     = m_Name;
            }
            catch { EndEditTrack(from, false); }
            EndEditTrack(from, true);
        }
Пример #8
0
        public override void OnDoubleClick(Mobile from)
        {
            ConfiguredPetXML  cp        = new ConfiguredPetXML();
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = from as PlayerMobile;

            if (IsChildOf(pm.Backpack))
            {
                if (xmlplayer.Levell >= c.EndMaxLvl)  /* Max Level per System */
                {
                    pm.SendMessage("You have reached the max level, this doesn't work for you!");
                    return;
                }
                else
                {
                    xmlplayer.kxp += m_SCV;
                }
                pm.SendMessage("You have been awarded {0} EXP points", m_SCV);
                if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                {
                    LevelHandler.DoLevel(pm, new Configured());
                }
                this.Delete();
            }
            else
            {
                pm.SendMessage("This must be in your pack!");
            }
        }
Пример #9
0
        protected override void OnTarget(Mobile from, object target)
        {
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = from as PlayerMobile;
            BaseCreature      pet       = target as BaseCreature;

            if (target == pet)
            {
                from.SendMessage("This only works on Players!");
            }
            else if (xmlplayer.Levell >= c.EndMaxLvl)              /* Max Level per System */
            {
                pm.SendMessage("Target has reached the max level, this doesn't work for them!");
            }
            else
            {
                if (target is Mobile)
                {
                    Mobile mt = (Mobile)target;
                    mt.SendMessage("You have been awarded {0} EXP points", xp.SCV);
                    xmlplayer.kxp += xp.SCV;
                    if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                    {
                        LevelHandler.DoLevel(pm, new Configured());
                    }
                }
            }
        }