I managed to hit him with the light spell at a distance of 13 tiles! That was not really intended, I realized I used the same range value for the light range in world coordinates and the damage effect range in tiles. So good catch, I just added the missing division by 3 for that effect.
But even with the lower range, this effect will still deal damage to nearby monsters if no obstacle stands between them and the party. The problem here is that this monster stands there with no door or anything in front of him, and your room entrance is right in front of him (3 tiles away!). So you would get the same result with any lost range attack on the same line in your room.
So I think an easy fix would be to move one of the 2 facing entrances one tile away, or put a closing door or a decorative obstacle between them.
Or remove the damage from this spell, it is not very important. But are you okay with every other potential damage triggering him?
Keeping the map as it is and the damage of the spell does not seem possible. I don't see how to change the spell so it does not damage this particular monster, are you suggesting checking some custom immunity, like an "NPC" trait the monster would have? Would he loose it when he starts fighting? I have more questions than answers
