That didn't work, when I checked the manual I found that if the cast flag is set for a light emitting entity, the light will cast stencil shadows. So set it for the light emitting entity. In my script I wrote the below line before the level_load

shadow_stencil = 4;

But the pillar still don't cast shadows!!

Also I have set the single mesh flag for the room and this dind't prevent the light from penetrating to the other rooms