コード例 #1
0
        public virtual int CalculateMana(Mobile from)
        {
            int mana = BaseMana;

            int reduction = (int)(from.Skills[SkillName.ArmsLore].Value / 2);

            mana -= reduction;


/*			double skillTotal = GetSkill( from, SkillName.Swords ) + GetSkill( from, SkillName.Macing )
 + GetSkill( from, SkillName.Fencing ) + GetSkill( from, SkillName.Archery ) + GetSkill( from, SkillName.Parry )
 + GetSkill( from, SkillName.Lumberjacking ) + GetSkill( from, SkillName.Stealth )
 + GetSkill( from, SkillName.Poisoning );
 +
 +                      if ( skillTotal >= 400.0 )
 +                              mana -= 10;
 +                      else if ( skillTotal >= 300.0 )
 +                              mana -= 5;
 +
 +                      double scalar = 1.0;
 +                      if ( !Server.Spells.Necromancy.MindRotSpell.GetMindRotScalar( from, ref scalar ) )
 +                              scalar = 1.0;
 +
 +                      // Lower Mana Cost = 40%
 +                      int lmc = AosAttributes.GetValue( from, AosAttribute.LowerManaCost );
 +                      if ( lmc > 40 )
 +                              lmc = 40;
 +
 +                      scalar -= (double)lmc / 100;
 +                      mana = (int)(mana * scalar);
 */
            // Using a special move within 3 seconds of the previous special move costs double mana
            if (GetContext(from) != null)
            {
                mana *= 2;
            }

            if (from is TeiravonMobile)
            {
                TeiravonMobile m = (TeiravonMobile)from;
                BaseWeapon     w = m.Weapon as BaseWeapon;
                if (m.HasFeat(TeiravonMobile.Feats.AxeFighter) && (m.FindItemOnLayer(Layer.TwoHanded) is BaseAxe) || m.FindItemOnLayer(Layer.OneHanded) is WarAxe)
                {
                    mana /= 2;
                }
                if (m.IsMonk() && (w is BaseStaff || w is Scimitar || w is Club || w is CrescentBlade || w is DoubleBladedStaff))
                {
                    mana /= 2;
                }
            }

            return(mana);
        }
コード例 #2
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);
        }