Пример #1
0
        public static void StartGain(Mobile killer, Mobile killed)
        {
            Setup        set = new Setup();
            PlayerMobile pm  = null;

            if (killer is PlayerMobile) //Find & Set killer
            {
                pm = killer as PlayerMobile;
            }
            else
            {
                BaseCreature bc = killer as BaseCreature;

                if (bc.Controlled && set.ExpFromPetKills)
                {
                    pm = bc.GetMaster() as PlayerMobile;
                }
            }

            if (pm == null) //if no killer Exit system
            {
                return;
            }

            double Gain = Figures.GetKillExp(pm, killed, new Setup()); //Get the exp for the kill

            FinalizeExp(pm, killed, Gain, new Setup());
        }
Пример #2
0
        public static void FinalizeExp(Mobile m, Mobile killed, double Gain, bool Craft, Setup set)
        {
            double BeforeFilter;//used only for party exp system
            double AfterLevelDiffFilter;
            double AfterCapFilter;
            Party  party = Party.Get(m);

            if (!Craft && killed != null && party != null && set.ExpPartyShare)
            {
                int PlayersInRange = 0;

                foreach (PartyMemberInfo info in party.Members)
                {
                    PlayerMobile pm = info.Mobile as PlayerMobile;

                    if (pm.Alive && pm.InRange(killed, set.PartyRange))
                    {
                        PlayersInRange++;
                    }
                }//Dumb that I have to count players this way....

                if (set.ExpEvenPartyShare)
                {
                    BeforeFilter = Gain / PlayersInRange;
                }
                else
                {
                    BeforeFilter = Gain;
                }

                foreach (PartyMemberInfo info in party.Members)
                {
                    PlayerMobile pm = info.Mobile as PlayerMobile;

                    if (pm.Alive && pm.InRange(killed, set.PartyRange))
                    {
                        AfterLevelDiffFilter = Figures.LevelDiffFilter(pm, killed, BeforeFilter, new Setup());
                        AfterCapFilter       = Figures.CapFilter(pm, AfterLevelDiffFilter, new Setup());
                        AddExp(pm, AfterCapFilter, new Setup());
                    }
                }
            }
            else
            {
                PlayerMobile pm = m as PlayerMobile;
                AfterLevelDiffFilter = Figures.LevelDiffFilter(pm, killed, Gain, new Setup());
                AfterCapFilter       = Figures.CapFilter(pm, AfterLevelDiffFilter, new Setup());

                AddExp(pm, AfterCapFilter, new Setup());
            }
        }
Пример #3
0
        public static double ExpMirror(Mobile m)
        {
            Setup        set = new Setup();
            PlayerMobile pm  = m as PlayerMobile;

            if (set.AccumulativeExp)
            {
                return(pm.AccKillExp + Figures.Stats(pm) + Figures.Skills(pm));
            }
            else
            {
                return(pm.KillExp + Figures.Stats(pm) + Figures.Skills(pm));
            }
        }