I want to be able to make a hostile npc go after other npcs and players

I want it to be like there are 23 hostile npcs that attack each other but can be come friendly and for the npcs to go after the player when npc decides, is it possible to do?

Yes, of course it’s possible.

I suggest you read up on Artificial Intelligence. This book is a good place to start: http://www.amazon.co.uk/Artificial-Intelligence-Games-Ian-Millington/dp/0123747317