Searches for Light- and Heavy-flavor Three-jet Resonances in proton-proton Collisions with the CMS Detector at $\sqrt{s}$ = 8 TeV