1. How to make an item appear in the shop from the beginning of the game.
To make a shopitem show up, it is attached to a particular building in the city. So if you wish an item to always be available you need to have
You would need to include this for all the city hubs including the forts, towns, and conclaves.
2. How to make an item not appear in the shop ever.
Items by default are not in the shop. But to remove an item you will need to remove the tag I mentioned above on the improvement type. Not sure if you can do this from the mod folder though.
3. How to make an item not appear as loot for huts/quests/loot ever.
This is something given to you via through the quest itself. For the goodie huts and lairs and such most of these lairs are set to give you an item of a particular rarity, which is set on the item itself (common, uncommon and such). But if you would like to specifically give an item then you would need to edit the lair itself and set the probabilty yourself. These are in the CoreGoodieHuts.xml, and you can see what lairs and treasure troves give what types of items.
4. I want to make empire//kingdom versions of a few items, can I set that as a prereq?
5. Can I set bloodline as a prereq?
In a way, I know for particular items like armor and weapons you can set which body types can take this particular item under the art definitions of these files(making it unvailable to everyone else). I suspect that you could also include the pre-req for kingdom and empire or particular race, but I'm not sure about this. A work around is to give a race a particular trait like defensive and then you can call upon that pre-req to force exactly what you are looking for.
6. Is it possible to create a world spell which destroys an item you are wearing?
7. Is it possible to make an item "count" how many battles it has been used in? The idea is to make a crappy armor that after X battles, transforms into better armor.
Not sure. (Most likely no)
8. Is it possible to make a weapon/armor/item get exp to level into a stronger copy of itself? I want to make some "ancestral items" which gain power over time. This can be from the number of battles it wins, or by gaining exp. I would be happy to make 3 versions of a "three stage" sword if need be.
Not sure. (Most likely no)
9. I was looking at the Erog's Token, and am making an item pack that casts spells when attacked. Do I have to use "_Self" to make it summon ME a skeleton when attacked, or cast Growth on ME"? Likewise, can I make it happen when "attacked by ranged weapons" instead of melee or "is the target of hostile spells"?
My limited experience with these things are rather touchy. I don't think it is possible to have a spell shoot off when attacked by ranged weapons or target of hostile spell (which is the same thing by this games code). Casting a spell like summoning is rather difficult as you need a target, so I'm not sure that this is possible.