A major capital city and coastal communities in two states have been warned to prepare homes for a tropical cyclone and days of wild weather.