public override void OnDoubleClick(Mobile from)
        {
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt));
            PlayerMobile      pm        = from as PlayerMobile;

            if (IsChildOf(pm.Backpack))
            {
                int CurrentLevel   = xmlplayer.Levell;
                int NeededToLevel  = xmlplayer.ToLevell;
                int CurrentExp     = xmlplayer.Expp;
                int CurrentKXP     = xmlplayer.kxp;
                int DifferenceNeed = NeededToLevel - CurrentExp;
                if (xmlplayer.Levell >= xmlplayer.MaxLevel)
                {
                    pm.SendMessage("Target has reached the max level, this doesn't work for them!");
                    return;
                }
                else
                {
                    xmlplayer.kxp  += DifferenceNeed;
                    xmlplayer.Expp += DifferenceNeed;

                    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!");
            }
        }
Beispiel #2
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!");
            }
        }
Beispiel #3
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());
                    }
                }
            }
        }
        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 (target is PlayerMobile)
                {
                    int CurrentLevel   = xmlplayer.Levell;
                    int NeededToLevel  = xmlplayer.ToLevell;
                    int CurrentExp     = xmlplayer.Expp;
                    int CurrentKXP     = xmlplayer.kxp;
                    int DifferenceNeed = NeededToLevel - CurrentExp;
                    if (xmlplayer.Levell >= xmlplayer.MaxLevel)
                    {
                        pm.SendMessage("Target has reached the max level, this doesn't work for them!");
                        return;
                    }
                    else
                    {
                        xmlplayer.kxp  += DifferenceNeed;
                        xmlplayer.Expp += DifferenceNeed;

                        if (xmlplayer.Expp >= xmlplayer.ToLevell && xmlplayer.Levell < xmlplayer.MaxLevel)
                        {
                            LevelHandler.DoLevel(pm, new Configured());
                        }
                    }
                }
            }
        }