Yes, the code goes in the onplayerleaving script.
The code line you mention retrieves the feat index from each feat item property applied on the hide. I don't know what are seeds and research feats and how to identify them, sorry.
Kato
Ah here's what I mean:
These lines are from IPRP_FEATS.2da
This is one of the seed feats (which I DO want permanently given):
240 16833217 Epic_Seed_Afflict 1 4000
This is one of the spell feats (which I dont want permanently given):
269 16833317 ES_AchillesHeel 11 4030
This is one of the research feats (which I DO want permanently given):
340 16833318 ES_AchillesHeelR 11 4031
The reason I don't want the spell feats permanently given is because they must be able to be given and removed dynamically by the system. If given permanently, the system can't make the necessary adjustments. The system allows the dynamic giving and removing of the epic spell feats based on which research feats the player possesses.
basically only the feats from 240 to 268 AND 340 to 410 would be made permanent