How to script simple instance?

Hi. Can you show little guide how to create instance. For example i want to scripting End time instance. I can script npc, bosses, items, but script instance hard to me.

There are plenty of examples already in the core.

Icecrown Citadel is a good one, it has well scripted bosses and is in my opinion a good example of a well written instance.

PM me if you need tips on getting started.