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); }
public override void OnDoubleClick(Mobile from) { if (IsChildOf(from.Backpack) || Parent == from) { TeiravonMobile m_Player = (TeiravonMobile)from; CraftSystem system = this.CraftSystem; if (!m_Player.IsTinker()) { if (system == DefAlchemy.CraftSystem || system == DefGlassblowing.CraftSystem) { if (!m_Player.IsAlchemist() && !m_Player.HasFeat(TeiravonMobile.Feats.AlchemyScience) && !m_Player.HasFeat(TeiravonMobile.Feats.ExoticPoisons)) { m_Player.SendMessage("You don't have the skills to use this."); return; } if (!m_Player.HasFeat(TeiravonMobile.Feats.ExoticPoisons)) { if (m_Player.Backpack.FindItemByType(typeof(AlchemyTome)) == null) { m_Player.SendMessage("Where's your Alchemy Tome?"); return; } } } else if (system == DefBlacksmithy.CraftSystem) { if (!m_Player.IsBlacksmith() && !m_Player.IsTinker() && !m_Player.IsMerchant()) { m_Player.SendMessage("You don't have the skills to use this."); return; } } else if (system == DefBowFletching.CraftSystem) { if (!m_Player.IsWoodworker() && !m_Player.IsRanger() && !m_Player.IsArcher() && !m_Player.IsMageSlayer() && !m_Player.IsMerchant() && !m_Player.IsStrider()) { m_Player.SendMessage("You don't have the skills to use this."); return; } } else if (system == DefCarpentry.CraftSystem) { if (!m_Player.IsWoodworker() && !m_Player.IsMerchant()) { m_Player.SendMessage("You don't have the skills to use this."); return; } } else if (system == DefInscription.CraftSystem) { if (!m_Player.HasFeat(TeiravonMobile.Feats.Inscription) && !m_Player.IsAlchemist() && !m_Player.IsMerchant()) { m_Player.SendMessage("You're not sure how to do this."); return; } } else if (system == DefTailoring.CraftSystem) { if (!m_Player.IsTailor() && !m_Player.IsMerchant()) { m_Player.SendMessage("You don't have the skills to use this."); return; } } } int num = system.CanCraft(from, this, null); if (num > 0) { from.SendLocalizedMessage(num); } else { CraftContext context = system.GetContext(from); from.SendGump(new CraftGump(from, system, this, null)); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }