Thanks for the query.
Severe dandruff could indicate dandruff itself which is significant or can indicate beginning of some other skin condition like Seborrheic dermatitis or Scalp psoriasis. Based on your description of pain on the scalp it looks like a superficial bacterial infection usually caused by staphylococcus aureus. Sometimes they co-exist with fungal folliculitis and can be determined with more precision during a consultation. Kindly consult a dermatologist for exact diagnosis and treatment plan. It is also important to prevent their relapse once you have got it cured. A decolonization regimen suggested by your doctor will help. Upto 100 hairs shedding per day is considered normal.
Your dermatologist will decide a treatment plan for you after a consultation.