internal static SkillPowerAffixData RecalculatePowerAffixesForSkill(PowerTypesEnum powerType, CastTypesEnum castType, ISkillAffixProcStat affixStat, DamageSkillStat skillData, List <AffixMetadataEnum> md) { var empoweredAffixData = new SkillPowerAffixData(); var level = powerType == PowerTypesEnum.AngelicPower ? skillData.AngelicPower : powerType == PowerTypesEnum.DemonicPower ? skillData.DemonicPower : skillData.AncestralPower; var rng = SkillStatHelper.GetRNG(powerType); var affix = new SkillAffixProcStat(); var isHighTier = skillData.Tier > 2; var procChance = affixStat.ProcChance; // var procBonus = SkillStatHelper.GetProcChance(level, powerType, isHighTier, castType, md); // procChance += procBonus; var selectedAffix = affixStat.SelectedAffix; empoweredAffixData.PowerData = new SkillAffixProcStat(procChance, powerType, selectedAffix, skillData, md); empoweredAffixData.PowerData.ProcAmount = affixStat.ProcAmount; var skillUp = skillData; if (powerType == PowerTypesEnum.AngelicPower) { skillUp.AngelicPower += 1; } else if (powerType == PowerTypesEnum.DemonicPower) { skillUp.DemonicPower += 1; } else if (powerType == PowerTypesEnum.AncestralPower) { skillUp.AncestralPower += 1; } empoweredAffixData.PowerUp = new SkillAffixProcStat(procChance, powerType, selectedAffix, skillUp, md); return(empoweredAffixData); }
public static SkillPowerAffixData GetPowerAffixesForSkill(PowerTypesEnum powerType, List <CastTypesEnum> castTypes, List <DamageTypesEnum> damageTypes, DamageSkillStat skillData, List <AffixMetadataEnum> skillMetadata) { var skillPowerAffixData = new SkillPowerAffixData(); var level = (powerType == PowerTypesEnum.AngelicPower) ? skillData.AngelicPower : (powerType == PowerTypesEnum.DemonicPower) ? skillData.DemonicPower : skillData.AncestralPower; var selectedPowerData = new SkillAffixProcStat(); var selectedAffix = string.Empty; var isCC = skillData.IsCC; var rand = SkillStatHelper.GetRNG(powerType); var isHighTier = skillData.Tier > 2; var procsBuff = false; var procChance = SkillStatHelper.GetProcChance(level, powerType, isHighTier, castTypes, skillMetadata); if (!isHighTier) { if (isCC) { selectedAffix = calculateAffix2(powerType, skillMetadata, rand, ref selectedPowerData); } else { selectedAffix = calculateAffix1(powerType, skillMetadata, rand, ref selectedPowerData); } } else { if (isCC) { selectedAffix = calculateAffix4(powerType, skillMetadata, rand, ref selectedPowerData); } else { selectedAffix = calculateAffix3(powerType, skillMetadata, rand, ref selectedPowerData); } } if (selectedAffix == EnumHelper.GetName <LBsEnum>(LBsEnum.RandomShoutOrCry)) { procsBuff = true; } if (selectedAffix == EnumHelper.GetName <LBsEnum>(LBsEnum.OtherRandomLPROnDeathForX)) { var isProjectile = skillMetadata.Contains(AffixMetadataEnum.Projectile); var isDoT = skillMetadata.Contains(AffixMetadataEnum.HasDoT); var isUltimate = skillMetadata.Contains(AffixMetadataEnum.Ultimate); var apRand = isProjectile ? 12 : isDoT ? 10 : 9;// : isDoA ? 9 : 10; selectedAffix = EnumHelper.GetName <LPRsEnum>((LPRsEnum)rand.Next(0, apRand)); if (isUltimate) { procChance += 0.1m; selectedPowerData.Stackable = true; } procsBuff = true; } if (selectedAffix == EnumHelper.GetName <LDBsEnum>(LDBsEnum.LowPercCastRandomEP)) { selectedAffix = EnumHelper.GetName <EPs_HighDBsEnum>((EPs_HighDBsEnum)rand.Next(0, isHighTier ? 7 : 3)); if (!isHighTier) { procChance -= 0.05m; } } if (selectedAffix == EnumHelper.GetName <EPs_HighDBsEnum>(EPs_HighDBsEnum.RandomCC)) { selectedAffix = EnumHelper.GetName <CCsEnum>((CCsEnum)rand.Next(0, isHighTier ? 4 : 2)); } if (selectedAffix == EnumHelper.GetName <EPs_HighDBsEnum>(EPs_HighDBsEnum.RandomCurse)) { selectedAffix = EnumHelper.GetName <CursesEnum>((CursesEnum)rand.Next(0, isHighTier ? 9 : 3)); } if (selectedAffix == EnumHelper.GetName <EPs_HighDBsEnum>(EPs_HighDBsEnum.RandomTotemOrBanner)) { selectedAffix = EnumHelper.GetName <CursesEnum>((CursesEnum)rand.Next(0, isHighTier ? 9 : 3)); if (!isHighTier) { procChance -= 0.10m; } } if (procsBuff) { skillMetadata.Add(AffixMetadataEnum.ProcsBuff); } skillPowerAffixData.PowerData = new SkillAffixProcStat(procChance, powerType, selectedAffix, skillData, skillMetadata); var skillUp = skillData; if (powerType == PowerTypesEnum.AngelicPower) { skillUp.AngelicPower += 1; } else if (powerType == PowerTypesEnum.DemonicPower) { skillUp.DemonicPower += 1; } else if (powerType == PowerTypesEnum.AncestralPower) { skillUp.AncestralPower += 1; } skillPowerAffixData.PowerUp = new SkillAffixProcStat(procChance, powerType, selectedAffix, skillUp, skillMetadata); return(skillPowerAffixData); }