コード例 #1
0
        public static TimeSpan GetDuration(Mobile caster, Mobile target)
        {
            if (Core.AOS)
            {
                if (caster is TeiravonMobile)
                {
                    TeiravonMobile m_Player = (TeiravonMobile)caster;

                    if (m_Player.IsCleric() || m_Player.IsDarkCleric())
                    {
                        double temp = ((Math.Abs((double)m_Player.Karma / (double)300) * (double)m_Player.PlayerLevel));

                        if (temp < 10)
                        {
                            temp = (double)10;
                        }

                        if (temp > 600)
                        {
                            temp = (double)600;
                        }

                        return(TimeSpan.FromSeconds(temp));
                    }
                    else
                    {
                        return(TimeSpan.FromSeconds(((10 * m_Player.PlayerLevel)) + 15));
                    }
                }

                return(TimeSpan.FromSeconds(((6 * caster.Skills.EvalInt.Fixed) / 50) + 1));
            }

            return(TimeSpan.FromSeconds(caster.Skills[SkillName.Magery].Value * 1.2));
        }
コード例 #2
0
        private static TimeSpan Mobile_ManaRegenRate(Mobile from)
        {
            if (from.Skills == null)
            {
                return(Mobile.DefaultManaRate);
            }

            if (!from.Meditating)
            {
                CheckBonusSkill(from, from.Mana, from.ManaMax, SkillName.Meditation);
            }

            double rate;
            double armorPenalty = GetArmorOffset(from);
            double hungermod;

            if (from.Hunger > 12)
            {
                hungermod = 1.0;
            }
            else
            {
                hungermod = (from.Hunger * .08);
            }

            if (Core.AOS)
            {
                double medPoints = from.Int + (from.Skills[SkillName.Meditation].Value * 2);

                medPoints *= (from.Skills[SkillName.Meditation].Value < 150.0) ? (from.Skills[SkillName.Meditation].Value < 100.0 ? 0.025 : .0275) : 0.03;

                CheckBonusSkill(from, from.Mana, from.ManaMax, SkillName.Focus);

                double focusPoints = (int)(from.Skills[SkillName.Focus].Value * 0.05);

                if (armorPenalty > 0)
                {
                    medPoints = 0; // In AOS, wearing any meditation-blocking armor completely removes meditation bonus
                }
                double totalPoints = AosAttributes.GetValue(from, AosAttribute.RegenMana) +
                                     focusPoints + medPoints + (from.Meditating ? medPoints : 0.0);

                if (CheckTransform(from, typeof(VampiricEmbraceSpell)))
                {
                    totalPoints += 3;
                }
                else if (CheckTransform(from, typeof(LichFormSpell)))
                {
                    totalPoints += 13;
                }

                if (from is Mobiles.BaseCreature && ((Mobiles.BaseCreature)from).IsParagon)
                {
                    totalPoints += 40;
                }

                if (from is TeiravonMobile)
                {
                    TeiravonMobile tav = from as TeiravonMobile;
                    if (tav.IsUndead() && tav.Shapeshifted && (tav.IsDarkCleric() || tav.IsNecromancer()))
                    {
                        totalPoints += tav.PlayerLevel;
                    }
                }

                if (totalPoints < -1)
                {
                    totalPoints = -1;
                }

                rate = 1.0 / (0.1 * (2 + (int)totalPoints));
            }
            else
            {
                double medPoints = (from.Int + from.Skills[SkillName.Meditation].Value) * 0.5;

                if (medPoints <= 0)
                {
                    rate = 7.0;
                }
                else if (medPoints <= 100)
                {
                    rate = 7.0 - (239 * medPoints / 2400) + (19 * medPoints * medPoints / 48000);
                }
                else if (medPoints < 120)
                {
                    rate = 1.0;
                }
                else
                {
                    rate = 0.75;
                }

                rate += armorPenalty;

                if (from.Meditating)
                {
                    rate *= 0.5;
                }

                if (rate < 0.5)
                {
                    rate = 0.5;
                }
                else if (rate > 7.0)
                {
                    rate = 7.0;
                }
            }

            if (from is TeiravonMobile)
            {
                if (hungermod > 0)
                {
                    rate = rate / hungermod;
                }
                else
                {
                    rate = 30;
                }

                TeiravonMobile m_Player = (TeiravonMobile)from;

                if (m_Player.HasFeat(TeiravonMobile.Feats.WholenessOfSelf))
                {
                    rate *= .75;
                }
            }


            return(TimeSpan.FromSeconds(rate));
        }
コード例 #3
0
        public static Chart CompileStatChart()
        {
            /*
             *          PieChart chart = new PieChart( "Stat Distribution", "graphs_strdexint_distrib", true );
             *
             *          ChartItem strItem = new ChartItem( "Strength", 0 );
             *          ChartItem dexItem = new ChartItem( "Dexterity", 0 );
             *          ChartItem intItem = new ChartItem( "Intelligence", 0 );
             *
             *          foreach ( Mobile mob in World.Mobiles.Values )
             *          {
             *                  if ( mob.RawStatTotal == mob.StatCap && mob is PlayerMobile )
             *                  {
             *                          strItem.Value += mob.RawStr;
             *                          dexItem.Value += mob.RawDex;
             *                          intItem.Value += mob.RawInt;
             *                  }
             *          }
             *
             *          chart.Items.Add( strItem );
             *          chart.Items.Add( dexItem );
             *          chart.Items.Add( intItem );
             */

            PieChart chart = new PieChart("Class Distribution", "graphs_class_distrib", true);

            ChartItem fightItem   = new ChartItem("Fighters", 0);
            ChartItem rogueItem   = new ChartItem("Rogues", 0);
            ChartItem mageItem    = new ChartItem("Mages", 0);
            ChartItem clericItem  = new ChartItem("Clerics", 0);
            ChartItem rangerItem  = new ChartItem("Rangers", 0);
            ChartItem druidItem   = new ChartItem("Druids", 0);
            ChartItem barbItem    = new ChartItem("Barbarians", 0);
            ChartItem crafterItem = new ChartItem("Crafters", 0);
            ChartItem advItem     = new ChartItem("Advanced", 0);

            foreach (Mobile mob in World.Mobiles.Values)
            {
                if (mob != null && mob is TeiravonMobile)
                {
                    TeiravonMobile tav  = mob as TeiravonMobile;
                    Account        acct = (Account)tav.Account;
                    if ((acct.LastLogin + TimeSpan.FromDays(90.0)) < DateTime.Now)
                    {
                        continue;
                    }

                    if (tav.IsFighter() || tav.IsCavalier() || tav.IsMonk())
                    {
                        fightItem.Value++;
                    }
                    else if (tav.IsThief() || tav.IsAssassin() || tav.IsBard())
                    {
                        rogueItem.Value++;
                    }
                    else if (tav.IsMage())
                    {
                        mageItem.Value++;
                    }
                    else if (tav.IsCleric() || tav.IsDarkCleric())
                    {
                        clericItem.Value++;
                    }
                    else if (tav.IsArcher() || tav.IsMageSlayer() || tav.IsRanger())
                    {
                        rangerItem.Value++;
                    }
                    else if (tav.IsForester() || tav.IsShapeshifter())
                    {
                        druidItem.Value++;
                    }
                    else if (tav.IsBerserker() || tav.IsDragoon())
                    {
                        barbItem.Value++;
                    }
                    else if (tav.IsCrafter())
                    {
                        crafterItem.Value++;
                    }
                    else
                    {
                        advItem.Value++;
                    }
                }
            }

            chart.Items.Add(fightItem);
            chart.Items.Add(rogueItem);
            chart.Items.Add(mageItem);
            chart.Items.Add(clericItem);
            chart.Items.Add(rangerItem);
            chart.Items.Add(druidItem);
            chart.Items.Add(barbItem);
            chart.Items.Add(crafterItem);
            chart.Items.Add(advItem);


            return(chart);
        }
コード例 #4
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (m is TeiravonMobile)
            {
                TeiravonMobile tav = m as TeiravonMobile;

                if (tav.IsPaladin() || tav.IsCleric() || tav.IsDarkCleric())
                {
                    GivePrayer(tav);
                    return(TimeSpan.FromSeconds(10.0));
                }
                else
                {
                    Spell spell = new SpiritSpeakSpell(m);

                    spell.Cast();

                    if (spell.IsCasting)
                    {
                        return(TimeSpan.FromSeconds(5.0));
                    }

                    return(TimeSpan.Zero);
                }
            }

            else
            {
                Spell spell = new SpiritSpeakSpell(m);

                spell.Cast();

                if (spell.IsCasting)
                {
                    return(TimeSpan.FromSeconds(5.0));
                }

                return(TimeSpan.Zero);
            }

            m.RevealingAction();

            if (m.CheckSkill(SkillName.SpiritSpeak, 0, 100))
            {
                if (!m.CanHearGhosts)
                {
                    Timer  t    = new SpiritSpeakTimer(m);
                    double secs = m.Skills[SkillName.SpiritSpeak].Base / 50;
                    secs *= 90;
                    if (secs < 15)
                    {
                        secs = 15;
                    }

                    t.Delay = TimeSpan.FromSeconds(secs);                      //15seconds to 3 minutes
                    t.Start();
                    m.CanHearGhosts = true;
                }

                m.PlaySound(0x24A);
                m.SendLocalizedMessage(502444);                  //You contact the neitherworld.
            }
            else
            {
                m.SendLocalizedMessage(502443);                  //You fail to contact the neitherworld.
                m.CanHearGhosts = false;
            }

            return(TimeSpan.FromSeconds(1.0));
        }
コード例 #5
0
        public static int GetOffset(Mobile caster, Mobile target, StatType type, bool curse)
        {
            if (Core.AOS)
            {
                int adjtotal = 0;

                if (!m_DisableSkillCheck)
                {
                    caster.CheckSkill(SkillName.EvalInt, 0.0, 120.0);

                    if (curse)
                    {
                        target.CheckSkill(SkillName.MagicResist, 0.0, 120.0);
                    }
                }

                double percent = (double)0;
                bool   cleric  = false;

                if (caster is TeiravonMobile)
                {
                    TeiravonMobile m_Player = (TeiravonMobile)caster;
                    int            stat     = 0;
                    switch (type)
                    {
                    case StatType.Str: stat = (int)(target.RawStr);
                        break;

                    case StatType.Dex: stat = (int)(target.RawDex);
                        break;

                    case StatType.Int: stat = (int)(target.RawInt);
                        break;
                    }

                    if (m_Player.IsCleric() || m_Player.IsDarkCleric())
                    {
                        cleric = true;

                        adjtotal += (int)(m_Player.PlayerLevel + (stat * .25));

                        if (curse)
                        {
                            percent = (-(double)m_Player.Karma / (double)25000);
                        }
                        else
                        {
                            percent = ((double)m_Player.Karma / (double)25000);
                        }

                        percent += ((double)m_Player.PlayerLevel / (double)100);

                        if (percent < 0.05)
                        {
                            percent = 0.05;
                        }

                        if (percent > 0.75)
                        {
                            percent = 0.75;
                        }

                        AOS.Scale(adjtotal, (int)percent * 100);
                    }
                }

                if (!cleric)
                {
                    if (curse)
                    {
                        adjtotal += (int)(10 + (caster.Skills.EvalInt.Fixed / 100) - (target.Skills.MagicResist.Fixed / 100));
                        percent   = 8 + (caster.Skills.EvalInt.Fixed / 100) - (target.Skills.MagicResist.Fixed / 100);
                    }
                    else
                    {
                        adjtotal += (int)(10 + (caster.Skills.EvalInt.Fixed / 100));
                        percent   = 1 + (caster.Skills.EvalInt.Fixed / 100);
                    }
                    percent *= 0.01;

                    if (percent < 0)
                    {
                        percent = 0;
                    }

                    AOS.Scale(adjtotal, (int)percent * 100);
                }

                if (target is TeiravonMobile && curse)
                {
                    TeiravonMobile m_Target = (TeiravonMobile)target;

                    if (m_Target.m_CloakOfDarkness)
                    {
                        m_Target.SendMessage("The darkness has protected you.");
                        return(0);
                    }
                }

                switch (type)
                {
                //case StatType.Str: return (int)(target.RawStr * percent);
                //case StatType.Dex: return (int)(target.RawDex * percent);
                //case StatType.Int: return (int)(target.RawInt * percent);
                case StatType.Str: return((int)(adjtotal));

                case StatType.Dex: return((int)(adjtotal));

                case StatType.Int: return((int)(adjtotal));
                }
            }

            return(1 + (int)(caster.Skills[SkillName.Magery].Value * 0.1));
        }