For scripting, take a look in the 3rd party tools forum. 
 
For adding spawns to the DB read the worldbuilder forum some, but mostly you will need to take a look at the database, or the db.sql file.  It lists the fileds used in each table with rather descriptive names.  Hint: there are actually 4 tables used to spawn a NPC (plus 2 faction, and 4 for loot) 
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 |