The former owner of a Norfolk seaside restaurant sold up and used the cash from the sale to buy assault rifles for a terror attack, a court has heard.