public static double GetQuestDifficulty(this ContractorDefinitions.Quest quest) { var median = 0; if (quest.ObjectiveTypeId == "sailor") { median = Definitions.LevelUpDef.Items.Item.Where(n => n.DefId == Core.GlobalData.Level).First() .MedianCrew; } else { median = Definitions.LevelUpDef.Items.Item.Where(n => n.DefId == Core.GlobalData.Level).First() .MedianCapacity; } return(Math.Ceiling(median / 100D * quest.Difficulty)); }
public static double InputAmount(this ContractorDefinitions.Quest quest) { // 261 var ret = 0D; var diff = quest.GetQuestDifficulty(); { if (quest.Amount > 0) { ret = quest.Amount; } else { ret = diff * quest.Bonus; } } if (quest.Round > 0) { ret = Math.Ceiling(ret / quest.Round) * quest.Round; } return(ret); }