Working with the NWN2 toolset does not mean being good at programming, but being good at solving its bugs.
I discovered that, a cleric character created by the player, when left to himself, then to artificial intelligence, if he tries to cast a spell donated to him by his domain, who already owns, but in a different level of spells, the spell does not come completed, and the cleric remains in the closed position of the cast, trying the next round to relaunch this spell, with the same result, remaining stuck in an infinite circle.
I made this test with the divine power, given by the dominion of force, memorized at the third level.
If instead I store the divine power at the fourth level, as it should be, then everything works correctly.
For spells that normally the cleric does not possess, such as stone skin donated by the domain of the earth, the character simply acts as if that spell did not have it.
I’m pretty tired of this bullshit.