I am not exactly sure on how the PEQ does their numbering but I do not think an NPC can belong to a zone based on the npc_types.id because a given NPC can appear in any number of zones. Such as a Gnoll Pup can be in North Qeynos and Qeynos Hills.
In order to get Loot Table information for the mob in a particular zone you will have to start with Spawn2 to get all the Spawn Groups in that zone as any NPC that spawns in the zone will be an entry in a spawn group. Then you link to npc_types using the ID and from there to LootTable information which is spread out over multiple tables.
I used one query to display some of the information you need but my suggestion would be to write the query in stages pull out all the information from each table you need so you can reinsert the loot information with new ID's to fit your DB.
|