The origin of prompt emission in GRBs is not yet well understood. The simplest and most popular model is Synchrotron Self-Compton (SSC) emission produced by internal shocks inside an ultra-relativistic jet. However, recent observations of a delayed high energy component by the Fermi-LAT instrument have encouraged alternative models. Here we use a recently developed formulation of relativistic shocks for GRBs to simulate light curves and spectra of synchrotron and self-Compton emissions in the framework of internal shock model. This model takes into account the evolution of quantities such as densities of colliding shells, and fraction of kinetic energy transferred to electrons and to induced magnetic field. We also extend this formulation by considering the presence of a precessing external magnetic field. These simulations are very realistic and present significant improvement with respect to previous phenomenological GRB simulations. They reproduce light curves of separated peaks of real GRBs and variety of spectral slopes at E > E peak observed by the Fermi-LAT instrument. The high energy emission can be explained by synchrotron emission and a subdominant contribution from inverse Compton. We also suggest an explanation for extended tail emission and relate it to the screening of the magnetic field and/or trapping of accelerated electrons in the electromagnetic energy structure of the plasma in the shock front. Spectral slopes of simulated bursts at E ≪ E peak are consistent with theoretical prediction and at E < E peak can be flatter if the spectrum of electrons is roughly flat or has a shallow slope. The observed flat spectra at soft gamma-ray and hard x-ray bands is the evidence that there is a significant contribution at E < E peak from lower Lorentz factor wing of electron distribution which have a roughly random acceleration rather than being thermal. This means that the state of matter in the jet at the time of ejection is most probably nonthermal. As for the effect of a precessing external magnetic field, we show that due fast variation of other quantities, its signature in the Power Distribution Spectrum (PDS) is significantly suppressed and only when the duration of the burst is few times longer than the oscillation period it can be detected, otherwise either it is confused with the Poisson noise or with intrinsic variations of the emission. Therefore, low significant oscillations observed in the PDS of GRB 090709a are most probably due to a precessing magnetic field.