The optical response of embedded silver nanoparticles in terms of their morphology and dielectric environment is studied. Employing a discrete dipole approximation, the extinction efficiencies are calculated for nanoparticles of different shapes and in diverse ambient conditions. A clear dependence of the number, width and position of the surface plasmon resonances (SPRs) is identified for various nanoparticle shapes. For faceted particles, it is found that as the truncation of sides increases, the main resonance is always blue shifted, the SPRs at smaller wavelength are closer to the dominant mode, so, they overlap, and the width of the main resonance increases. The SPRs vanish as the number of faces increases, or when the symmetry of the NP becomes larger. As the vertices become sharper, the number of resonances increases significantly. By changing the refraction index of the environment, the number of SPRs is not affected, although their width and position are modified, so that, for larger the refraction indeces the resonances are red shifted.