public bool TryCreateMission(Character character, bool spreadInGang, Mission mission, MissionLocation location, int level, out MissionInProgress missionInProgress, bool isTestMode = false) { if (location.ZoneConfig == ZoneConfiguration.None) { Logger.Error("zone config was not found for zoneId:" + location.ZoneConfig.Id); missionInProgress = null; return(false); } missionInProgress = _missionInProgressFactory(mission); missionInProgress.missionGuid = Guid.NewGuid(); missionInProgress.character = character; missionInProgress.started = DateTime.Now; missionInProgress.expire = DateTime.Now.AddMinutes(mission.durationMinutes); missionInProgress.spreadInGang = spreadInGang; missionInProgress.bonusMultiplier = GetBonusMultiplierForMissionStart(character, mission, location, level); missionInProgress.myLocation = location; missionInProgress.MissionLevel = level; missionInProgress.isTestMode = isTestMode; if (mission.behaviourType == MissionBehaviourType.Config) { //get from cached data missionInProgress.SetIssuerCorporationAndAllianceByConfigMission(); } else { //lookup based on location missionInProgress.SetIssuerCorporationAndAllianceByLocation(); } missionInProgress.SetRewardDivider(); //add targets in progress var success = missionInProgress.CreateAndSolveTargets(mission); return(success); }