private static TimeSpan Mobile_HitsRegenRate(Mobile from) { bool wounded; wounded = MortalStrike.IsWounded(from); int points = AosAttributes.GetValue(from, AosAttribute.RegenHits); double rate; double hungermod; if (from.Hunger > 12) { hungermod = 1.0; } else { hungermod = (from.Hunger * .08); } if (from is BaseCreature) { if (((BaseCreature)from).IsAnimatedDead) { points -= 50; } else { points += (int)(5 * Math.Log(from.HitsMax)); } if (((BaseCreature)from).IsParagon) { points += 10; } } if (CheckTransform(from, typeof(HorrificBeastSpell))) { points += 20; } if (from is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.HasFeat(TeiravonMobile.Feats.AdvancedHealing)) { points += (points + (int)(m_Player.PlayerLevel) + 2); } if (m_Player.HasFeat(TeiravonMobile.Feats.WholenessOfSelf)) { points += (points + (int)(m_Player.PlayerLevel) + 6); } if (m_Player.IsUndead()) { points += 10; if (m_Player.IsFighter() && m_Player.Shapeshifted) { points += (m_Player.PlayerLevel / 5) * 2; } } } CampfireEntry entry = Campfire.GetEntry(from); if (entry != null && entry.Safe) { points += 40; } if (points < 0 || wounded) { points = 0; } if (from is TeiravonMobile) { if (hungermod > 0) { rate = (1.0 / (0.1 * (1 + points))) / hungermod; } else { rate = 90; } } else { rate = (1.0 / (0.1 * (1 + points))); } if (rate < .05) { rate = .05; } return(TimeSpan.FromSeconds(rate)); }
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); }