public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); int armorCap = (int)Math.Ceiling((1402.5f * TargetLevel) - 66502.5f); float levelDifference = 0.2f * (TargetLevel - 70); dictValues.Add("Health", BasicStats.Health.ToString()); dictValues.Add("Armor", BasicStats.Armor.ToString()); dictValues.Add("Stamina", BasicStats.Stamina.ToString()); dictValues.Add("Agility", BasicStats.Agility.ToString()); dictValues.Add("Defense", Defense.ToString()); dictValues.Add("Miss", Miss.ToString() + "%"); dictValues.Add("Dodge", Dodge.ToString() + "%"); dictValues.Add("Parry", Parry.ToString() + "%"); dictValues.Add("Block", Block.ToString() + "%"); dictValues.Add("Block Value", BlockValue.ToString() + "%"); dictValues.Add("Avoidance", Avoidance.ToString() + "%"); dictValues.Add("Mitigation", Mitigation.ToString()); dictValues.Add("Spell Damage", _basicStats.SpellDamageRating.ToString()); dictValues.Add("Total Mitigation", TotalMitigation.ToString() + "%"); if (CritAvoidance == (5f + levelDifference)) { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + "%*Exactly enough defense rating/resilience to be uncrittable by bosses."); } else if (CritAvoidance < (5f + levelDifference)) { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + string.Format("%*CRITTABLE! Short by {0} defense rating or {1} resilience to be uncrittable by bosses.", Math.Ceiling(((5f + levelDifference) - CritAvoidance) * 60f), Math.Ceiling(((5f + levelDifference) - CritAvoidance) * 39.423f))); } else { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + string.Format("%*Uncrittable by bosses. {0} defense rating or {1} resilience over the crit cap.", Math.Floor(((5f + levelDifference) - CritAvoidance) * -60f), Math.Floor(((5f + levelDifference) - CritAvoidance) * -39.423f))); } dictValues.Add("Overall Points", OverallPoints.ToString()); dictValues.Add("Mitigation Points", MitigationPoints.ToString()); dictValues.Add("Survival Points", SurvivalPoints.ToString()); dictValues.Add("Overall", Math.Round(OverallTPS) + " tps"); dictValues.Add("Holy Shield", Math.Round(HolyShieldTPS) + " tps"); dictValues.Add("Seal of Right", Math.Round(SoRTPS) + " tps"); dictValues.Add("Judgement of Right", Math.Round(JoRTPS) + " tps"); dictValues.Add("Consecrate", Math.Round(ConsecrateTPS) + " tps"); dictValues.Add("Misc", Math.Round(MiscTPS) + " tps"); return(dictValues); }
public static BlockValue GetBlockValueByNameOrId(string idOrName) { BlockValue bv = new BlockValue(); int blockId; if (int.TryParse(idOrName, out blockId)) //checkById { foreach (Block b in Block.list) { if (b.blockID == blockId) { bv = Block.GetBlockValue(b.GetBlockName()); break; } } } else //checkByName { bv = Block.GetBlockValue(idOrName); } Log.Out(bv.ToString()); return(bv); }
private void RemoveBlock(List <string> _params) { string steamid = PersistentContainer.Instance.Players.GetSteamID(_params [0], true); if (steamid == null) { SdtdConsole.Instance.Output("Playername or entity/steamid id not found or no" + "infos saved (first saved after a player has been online for 30s)."); return; } Player p1 = PersistentContainer.Instance.Players [steamid, false]; if (p1 == null) { SdtdConsole.Instance.Output("Target playername or entity/steamid id not found."); return; } if (!p1.IsOnline) { SdtdConsole.Instance.Output("Target player not online."); return; } Vector3i position = default(Vector3i); position = p1.LastPosition; List <BlockChangeInfo> list = new List <BlockChangeInfo>(); SdtdConsole.Instance.Output(string.Concat( "Liste en cours. ", "", " Please wait...") ); try { position.y -= 1; World world = GameManager.Instance.World; BlockValue block = (BlockValue)world.GetBlock(position); SdtdConsole.Instance.Output(string.Concat("posy: ", (position.y), " blockraw:", block.rawData, ", block type: ", block.type, ", block string: ", block.ToString())); return; }catch (Exception ex) { Log.Out("RemoveBlocks check block error: " + ex.Message); } SdtdConsole.Instance.Output(string.Concat("List error.")); return; }
private void RemoveBlock(List <string> _params) { string steamid = PersistentContainer.Instance.Players.GetSteamID(_params [0], true); if (steamid == null) { SdtdConsole.Instance.Output("Playername or entity/steamid id not found or no inventory saved (first saved after a player has been online for 30s)."); return; } Player p1 = PersistentContainer.Instance.Players [steamid, false]; if (p1 == null) { SdtdConsole.Instance.Output("Target playername or entity/steamid id not found."); return; } if (!p1.IsOnline) { SdtdConsole.Instance.Output("Target player not online."); return; } int targetBlockId = 0; int newBlockId = 0; int sizex = 0; int sizez = 0; int sizey = 0; if (!int.TryParse(_params[1], out targetBlockId) || !int.TryParse(_params[2], out newBlockId) || !int.TryParse(_params[3], out sizex) || !int.TryParse(_params[4], out sizez) || !int.TryParse(_params[5], out sizey)) { SdtdConsole.Instance.Output("Not a good value..."); return; } Vector3i position = default(Vector3i); position = p1.LastPosition; List <BlockChangeInfo> list = new List <BlockChangeInfo>(); SdtdConsole.Instance.Output(string.Concat( "Effacement en cours. ", "", " Please wait...") ); int midSizex = (int)Math.Floor((sizex / 2d)); int midSizez = (int)Math.Floor((sizez / 2d)); int midSizey = (int)Math.Floor((sizey / 2d)); SdtdConsole.Instance.Output(string.Concat("targetBlockId: ", targetBlockId, " newBlockId: ", newBlockId)); World world = GameManager.Instance.World; Vector3i prefabPos = default(Vector3i); try { for (prefabPos.x = -midSizex; prefabPos.x <= midSizex; prefabPos.x++) { for (prefabPos.z = -midSizez; prefabPos.z <= midSizez; prefabPos.z++) { for (prefabPos.y = -midSizey; prefabPos.y <= midSizey; prefabPos.y++) { BlockValue block = world.GetBlock(prefabPos + position); try { SdtdConsole.Instance.Output(string.Concat("posx: ", (prefabPos.x + position.x), " blockraw:", block.rawData, ", block type: ", block.type, ", block string: ", block.ToString())); if (block.type == targetBlockId || targetBlockId == -1) { block.damage = 0; //reparatoin SdtdConsole.Instance.Output(string.Concat("int1: ", newBlockId)); uint int1 = (uint)newBlockId; SdtdConsole.Instance.Output(string.Concat("int1: ", int1)); BlockChangeInfo item = new BlockChangeInfo(prefabPos + position, int1, true); list.Add(item); } }catch (Exception ex) { Log.Out("RemoveBlocksd check block error: " + ex.Message); } } } } }catch (Exception ex) { Log.Out("RemoveBlocks check block error: " + ex.Message); } if (list.Count > 0) { GameManager.Instance.SetBlocksRPC(list); SdtdConsole.Instance.Output(string.Concat("Nettoyage terminé : ", list.Count, " blocks effacés.")); } else { SdtdConsole.Instance.Output(string.Concat("Nettoyage impossible ", newBlockId, " block introuvable.")); } }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); int armorCap = (int)Math.Ceiling((1402.5f * TargetLevel) - 66502.5f); float levelDifference = 0.2f * (TargetLevel - 70); float targetCritReduction = 5f + levelDifference; float currentCritReduction = ((float)Math.Floor( (BasicStats.DefenseRating * WarriorConversions.DefenseRatingToDefense + BasicStats.Defense)) * WarriorConversions.DefenseToCritReduction) + (BasicStats.Resilience * WarriorConversions.ResilienceRatingToCritReduction); int defToCap = 0, resToCap = 0; if (currentCritReduction < targetCritReduction) { while ((((float)Math.Floor( ((BasicStats.DefenseRating + defToCap) * WarriorConversions.DefenseRatingToDefense + BasicStats.Defense)) * WarriorConversions.DefenseToCritReduction) + (BasicStats.Resilience * WarriorConversions.ResilienceRatingToCritReduction)) < targetCritReduction) { defToCap++; } while ((((float)Math.Floor( (BasicStats.DefenseRating * WarriorConversions.DefenseRatingToDefense + BasicStats.Defense)) * WarriorConversions.DefenseToCritReduction) + ((BasicStats.Resilience + resToCap) * WarriorConversions.ResilienceRatingToCritReduction)) < targetCritReduction) { resToCap++; } } else if (currentCritReduction > targetCritReduction) { while ((((float)Math.Floor( ((BasicStats.DefenseRating + defToCap) * WarriorConversions.DefenseRatingToDefense + BasicStats.Defense)) * WarriorConversions.DefenseToCritReduction) + (BasicStats.Resilience * WarriorConversions.ResilienceRatingToCritReduction)) > targetCritReduction) { defToCap--; } while ((((float)Math.Floor( (BasicStats.DefenseRating * WarriorConversions.DefenseRatingToDefense + BasicStats.Defense)) * WarriorConversions.DefenseToCritReduction) + ((BasicStats.Resilience + resToCap) * WarriorConversions.ResilienceRatingToCritReduction)) > targetCritReduction) { resToCap--; } defToCap++; resToCap++; } dictValues.Add("Health", BasicStats.Health.ToString()); dictValues.Add("Strength", BasicStats.Strength.ToString()); dictValues.Add("Agility", BasicStats.Agility.ToString()); dictValues.Add("Stamina", BasicStats.Stamina.ToString()); dictValues.Add("Armor", BasicStats.Armor.ToString()); dictValues.Add("Defense", Defense.ToString() + string.Format("*Defense Rating {0}", BasicStats.DefenseRating)); dictValues.Add("Dodge", Dodge.ToString() + string.Format("%*Dodge Rating {0}", BasicStats.DodgeRating)); dictValues.Add("Parry", Parry.ToString() + string.Format("%*Parry Rating {0}", BasicStats.ParryRating)); if (BlockOverCap > 0f) { dictValues.Add("Block", (Block + BlockOverCap).ToString() + string.Format("%*Block Rating {0}. Over the crush cap by {1}% block", BasicStats.BlockRating, BlockOverCap)); } else { dictValues.Add("Block", Block.ToString() + string.Format("%*Block Rating {0}", BasicStats.BlockRating)); } dictValues.Add("Miss", Miss.ToString() + "%"); dictValues.Add("Resilience", BasicStats.Resilience.ToString() + string.Format(@"*Reduces periodic damage and chance to be critically hit by {0}%. Reduces the effect of mana-drains and the damage of critical strikes by {1}%.", BasicStats.Resilience * WarriorConversions.ResilienceRatingToCritReduction, BasicStats.Resilience * WarriorConversions.ResilienceRatingToCritReduction * 2)); dictValues.Add("Block Value", BlockValue.ToString()); #region Offensive Stats dictValues["Attack Power"] = BasicStats.AttackPower.ToString(); dictValues["Hit"] = (BasicStats.HitRating * WarriorConversions.HitRatingToHit + BasicStats.Hit).ToString() + string.Format("%*Hit Rating {0}", BasicStats.HitRating); dictValues["Expertise"] = (Math.Round(BasicStats.ExpertiseRating * WarriorConversions.ExpertiseRatingToExpertise + BasicStats.Expertise)).ToString() + string.Format(@"*Expertise Rating {0} Reduces chance to be dodged or parried by {1}%.", BasicStats.ExpertiseRating, Math.Round((BasicStats.ExpertiseRating * WarriorConversions.ExpertiseRatingToExpertise + BasicStats.Expertise) * WarriorConversions.ExpertiseToDodgeParryReduction)); dictValues["Haste"] = (BasicStats.HasteRating * WarriorConversions.HasteRatingToHaste).ToString() + string.Format("%*Haste Rating {0}", BasicStats.HasteRating); dictValues["Armor Penetration"] = BasicStats.ArmorPenetration.ToString(); dictValues["Crit"] = Crit.ToString() + string.Format("%*Crit Rating {0}", BasicStats.CritRating); dictValues["Weapon Damage"] = BasicStats.WeaponDamage.ToString(); dictValues.Add("Missed Attacks", AvoidedAttacks.ToString() + string.Format(@"%*Out of 100 attacks: Attacks Missed: {0}% Attacks Dodged: {1}% Attacks Parried: {2}%", MissedAttacks, DodgedAttacks, ParriedAttacks)); dictValues.Add("Limited Threat", (LimitedThreat / ThreatScale).ToString() + string.Format(@"*White TPS: {0} Shield Slam TPS: {1} Revenge TPS: {2} Devastate TPS: {3} Windfury TPS: {4}", WhiteThreat, ShieldSlamThreat, RevengeThreat, DevastateThreat, WindfuryThreat)); dictValues.Add("Unlimited Threat", (UnlimitedThreat / ThreatScale).ToString() + string.Format(@"*Heroic Strike TPS: {0} Shield Slam TPS: {1} Revenge TPS: {2} Devastate TPS: {3} Windfury TPS: {4}", HeroicStrikeThreat, ShieldSlamThreat, RevengeThreat, DevastateThreat, WindfuryThreat)); #endregion dictValues["Nature Resist"] = (BasicStats.NatureResistance + BasicStats.AllResist).ToString(); dictValues["Arcane Resist"] = (BasicStats.ArcaneResistance + BasicStats.AllResist).ToString(); dictValues["Frost Resist"] = (BasicStats.FrostResistance + BasicStats.AllResist).ToString(); dictValues["Fire Resist"] = (BasicStats.FireResistance + BasicStats.AllResist).ToString(); dictValues["Shadow Resist"] = (BasicStats.ShadowResistance + BasicStats.AllResist).ToString(); if (BasicStats.Armor == armorCap) { dictValues.Add("Mitigation", Mitigation.ToString() + string.Format("%*Exactly at the armor cap against level {0} mobs.", TargetLevel)); } else if (BasicStats.Armor > armorCap) { dictValues.Add("Mitigation", Mitigation.ToString() + string.Format("%*Over the armor cap by {0} armor.", BasicStats.Armor - armorCap)); } else { dictValues.Add("Mitigation", Mitigation.ToString() + string.Format("%*Short of the armor cap by {0} armor.", armorCap - BasicStats.Armor)); } dictValues.Add("Avoidance", DodgePlusMissPlusParry.ToString() + "%"); dictValues.Add("Avoidance + Block", DodgePlusMissPlusParryPlusBlock.ToString() + "%"); dictValues.Add("Total Mitigation", TotalMitigation.ToString() + "%"); dictValues.Add("Damage Taken", DamageTaken.ToString() + "%"); if (defToCap == 0 && resToCap == 0) { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritReduction).ToString() + "%*Exactly enough defense rating/resilience to be uncrittable by bosses."); } else if (defToCap + resToCap > 0) { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritReduction).ToString() + string.Format("%*CRITTABLE! Short by {0} defense rating ({1} defense) or {2} resilience to be uncrittable by bosses.", defToCap, defToCap * WarriorConversions.DefenseRatingToDefense, resToCap)); } else { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritReduction).ToString() + string.Format("%*Uncrittable by bosses. {0} defense rating ({1} defense) or {2} resilience over the crit cap.", -defToCap, -defToCap * WarriorConversions.DefenseRatingToDefense, -resToCap)); } dictValues.Add("Chance Crushed", CrushChance.ToString() + "%"); dictValues.Add("Overall Points", OverallPoints.ToString()); dictValues.Add("Mitigation Points", MitigationPoints.ToString()); dictValues.Add("Survival Points", SurvivalPoints.ToString()); dictValues.Add("Threat Points", ThreatPoints.ToString()); dictValues["Nature Survival"] = NatureSurvivalPoints.ToString(); dictValues["Frost Survival"] = FrostSurvivalPoints.ToString(); dictValues["Fire Survival"] = FireSurvivalPoints.ToString(); dictValues["Shadow Survival"] = ShadowSurvivalPoints.ToString(); dictValues["Arcane Survival"] = ArcaneSurvivalPoints.ToString(); return(dictValues); }
private void RemoveBlock(List <string> _params) { string steamid = PersistentContainer.Instance.Players.GetSteamID(_params [0], true); if (steamid == null) { SdtdConsole.Instance.Output("Playername or entity/steamid id not found or no inventory saved (first saved after a player has been online for 30s)."); return; } Player p1 = PersistentContainer.Instance.Players [steamid, false]; if (p1 == null) { SdtdConsole.Instance.Output("Target playername or entity/steamid id not found."); return; } if (!p1.IsOnline) { SdtdConsole.Instance.Output("Target player not online."); return; } Vector3i position = default(Vector3i); position = p1.LastPosition; List <BlockChangeInfo> list = new List <BlockChangeInfo>(); SdtdConsole.Instance.Output(string.Concat( "Effacement en cours. ", "", " Please wait...") ); //Vector3i prefabPos = default(Vector3i); World world = GameManager.Instance.World; try { position.z -= 1; SdtdConsole.Instance.Output(position.ToString()); BlockValue block = world.GetBlock(position); SdtdConsole.Instance.Output(block.type.ToString()); try { SdtdConsole.Instance.Output(string.Concat("posz: ", (position.z), " blockraw:", block.rawData, ", block type: ", block.type, ", block string: ", block.ToString())); if (block.type == 875) { block.damage = 0; //reparatoin uint int1 = (uint)874; SdtdConsole.Instance.Output(string.Concat("int1: ", int1)); BlockChangeInfo item = new BlockChangeInfo(position, int1, true); list.Add(item); } }catch (Exception ex) { Log.Out("RemoveBlocksd check block error: " + ex.Message); } }catch (Exception ex) { Log.Out("RemoveBlocks check block error: " + ex.Message); } if (list.Count > 0) { GameManager.Instance.SetBlocksRPC(list); SdtdConsole.Instance.Output(string.Concat("Nettoyage terminé : ", list.Count, " blocks effacés.")); } else { SdtdConsole.Instance.Output(string.Concat("Nettoyage impossible ", 874, " block introuvable.")); } }