Ok after looking deeper into it i think i find out a little how this system work.
I am working on a pet system where you can call pets with a clicky item.
All of my pets dont have any spell entry like mages or necros. So there is only one version of my pet in the pet table.
If i look into the pet tables for example the SumWaterR15 pet has many entries for the this pet. So each for for pet power level the game provides.
SumWaterR15 -1
SumWaterR15 15
SumWaterR15 20
SumWaterR15 25
SumWaterR15 30
SumWaterR15 35
-1 is the normal water pet rank 15 and will be used when you dont have any pet power focus item.
The spellid is used as kind of a lookup for the makepowerpet function to find based on the pet power value which pet to use.
Than it will query the npcid from the pets table with the power to get the correct entry from npc_types table.
So in this case i have 6 npc entries from normal pet level to pet power level possible at this level.
Atm for my pet system the player is able to catch a soul from mob sometimes and recall it with a clicky to use it as pet.
Work so far. But i have arround 45k npc entries in the npc_type/pets table that a player can use as pet.
To support pet power i need to have multiply entries for a npc_types and pets and also a spellid for the pet.
Hmm seems i need to write a programm/query to generate all this entries based on npc level and possible pet power items avaible at this level range.
Maybe i need to expand parts of the makepowerpet to support the calculations without any spellid and just calculate the pet power for one npc_type.