You could use MWSE to do something like that. What you would need to do is cycle through the cell for npcs, and make a GetDistance check from the player (is the area effect going to be centered on the player?)
Here's a version of a script I did using reference checks to see if npcs had been changed into rocks by a scripted spell. I use token items to track if the npc is a rock or not:
Begin Uvi_Rock_CellCheck; global script, started from first equip of the new rock wand; cleans up rock items from dead npcs, and adds memitems removed in target scriptShort stateShort doOnceShort framecountShort RandLong tmpLong tmp2Long npcRefLong npctargetFloat notransif ( MenuMode == 1 ) returnendifif ( doOnce == 0 ) set uvi_rocknpc to -99 ;disables old rock dialogue still present in main mod set uvi_rockused to 0 ;disables old pre-greetings still present in main mod set doOnce to 1endifif ( framecount < 20 ) ;using a framecounter instead of timer because timer was too sluggish set framecount to ( framecount + 1 ) returnendififx ( npcRef ) setx npcRef to xNextRef npcRef ;finds the next NPC or creature in the cellelse setx npcRef to xFirstNPC ;finds the first NPC or creature in the cellendifif ( npcRef == 0 ) ;end of list or empty cell set framecount to 0 returnendifsetx tmp to npcRef->xRefTypeif ( tmp != 1598246990 ) ;if not type "NPC_" - presumably a creature set framecount to 0 returnendifsetx npctarget to xGetPCTargetif ( npctarget == npcRef ) ;if npc is targeted, transformation is handled by other script so return set framecount to 0 returnendifxSetRef npcRefset tmp to ( GetItemCount "uvi_memitem_rock" )if ( tmp ) set state to 1 ;this NPC is already a rockelse set state to 0 ;this NPC is not a rockendif;remove spell that temporarily replaces item, and replace item after distance checkxSetRef npcRefset tmp to ( GetSpell "uvi_rock_memory" )xSetRef npcRefif ( GetDistance Player >= 100 ) set tmp2 to 1endififx ( tmp ) ifx ( tmp2 ) npcRef->RemoveSpell "uvi_rock_memory" npcRef->xAddItem "uvi_memitem_wasrock" 1 set tmp2 to 0 endifendif ifx ( state ) ;npc is a rock xSetRef npcRef set tmp to GetHealth if ( tmp > 0 ) ;npc is alive, so don't clean up set framecount to 0 return endif xSetRef npcRef set tmp to ( GetItemCount "uvi_rock_lgauntlet" ) ifx ( tmp ) npcRef->xRemoveItem "uvi_rock_lgauntlet" tmp set tmp to ( tmp - tmp ) endif xSetRef npcRef set tmp to ( GetItemCount "uvi_invisible_rgauntlet" ) ifx ( tmp ) npcRef->xRemoveItem "uvi_invisible_rgauntlet" tmp set tmp to ( tmp - tmp ) endif xSetRef npcRef set tmp to ( GetItemCount "uvi_invisible_robe" ) ifx ( tmp ) npcRef->xRemoveItem "uvi_invisible_robe" tmp set tmp to ( tmp - tmp ) endif; now equip dummy armor and clothing to refresh their inventory; Armor; Apart from a conflict between gauntlets and bracers, all armors can be worn together npcRef->xAddItem "gp_dummy_boots" 1 npcRef->xRemoveItem "gp_dummy_boots" 1 npcRef->xAddItem "gp_dummy_cuirass" 1 npcRef->xRemoveItem "gp_dummy_cuirass" 1 npcRef->xAddItem "gp_dummy_greaves" 1 npcRef->xRemoveItem "gp_dummy_greaves" 1 npcRef->xAddItem "gp_dummy_helm" 1 npcRef->xRemoveItem "gp_dummy_helm" 1 npcRef->xAddItem "gp_dummy_gauntlet_left" 1 ; gauntlets more dominant than bracers npcRef->xRemoveItem "gp_dummy_gauntlet_left" 1 npcRef->xAddItem "gp_dummy_leftbracer" 1 npcRef->xRemoveItem "gp_dummy_leftbracer" 1 npcRef->xAddItem "gp_dummy_pauldron_left" 1 npcRef->xRemoveItem "gp_dummy_pauldron_left" 1 ; pauldron can be worn with gauntlets/bracers so dont effect them npcRef->xAddItem "gp_dummy_gauntlet_right" 1 ; gauntlets more dominant than bracers npcRef->xRemoveItem "gp_dummy_gauntlet_right" 1 npcRef->xAddItem "gp_dummy_rightbracer" 1 npcRef->xRemoveItem "gp_dummy_rightbracer" 1 npcRef->xAddItem "gp_dummy_pauldron_right" 1 npcRef->xRemoveItem "gp_dummy_pauldron_right" 1 npcRef->xAddItem "gp_dummy_towershield" 1 npcRef->xRemoveItem "gp_dummy_towershield" 1; Weapon npcRef->xAddItem "silver dagger" 1 npcRef->xRemoveItem "silver dagger" 1; Clothing; All these 10 clothing items can be worn with each other npcRef->xAddItem "uv_reequipc_amulet" 1 ; even clothing types without bodyparts must still be pushed off as these items are still equipped so arnt seen in inventory without being pushed off npcRef->xRemoveItem "uv_reequipc_amulet" 1 npcRef->xAddItem "uv_reequipc_belt" 1 npcRef->xRemoveItem "uv_reequipc_belt" 1 npcRef->xAddItem "uv_reequipc_leftglove" 1 npcRef->xRemoveItem "uv_reequipc_leftglove" 1 npcRef->xAddItem "uv_reequipc_pants" 1 npcRef->xRemoveItem "uv_reequipc_pants" 1 npcRef->xAddItem "uv_reequipc_rightglove" 1 npcRef->xRemoveItem "uv_reequipc_rightglove" 1 npcRef->xAddItem "uv_reequipc_ring" 1 npcRef->xRemoveItem "uv_reequipc_ring" 1 npcRef->xAddItem "uv_reequipc_robe" 1 npcRef->xRemoveItem "uv_reequipc_robe" 1 npcRef->xAddItem "uv_reequipc_shirt" 1 npcRef->xRemoveItem "uv_reequipc_shirt" 1 npcRef->xAddItem "uv_reequipc_shoes" 1 npcRef->xRemoveItem "uv_reequipc_shoes" 1 npcRef->xAddItem "uv_reequipc_skirt" 1 npcRef->xRemoveItem "uv_reequipc_skirt" 1 xSetRef npcRef ModDisposition 40 PlaySound "mysticism hit" xSetRef npcRef set tmp to ( GetItemCount "uvi_memitem_wasrock" ) ;if npc is dead, remove memitems ifx ( tmp ) npcRef->xRemoveItem "uvi_memitem_wasrock" tmp set tmp to ( tmp - tmp ) endif xSetRef npcRef set tmp to ( GetItemCount "uvi_memitem_rock" ) ;if npc is dead, remove memitems ifx ( tmp ) npcRef->xRemoveItem "uvi_memitem_rock" tmp set tmp to ( tmp - tmp ) endif set state to 0 set framecount to 0endifEnd
This is only one half of the scripting though, the other half performs the transformation by using XGetpCTarget and checks that the rock spell has been cast on the npc before transforming them. The original spell used this script to make that check, but just a warning, it was a bit too slow on the uptake in exterior cells because it had too many objects to check for (and the framecount made it even slower). That is why I use the targeting script in conjunction with this one. However, I use the framecount because the script is constantly running in the background checking for npc rocks. If you are triggering it and stopping the script after it's completed, then you don't need a framecounter to mitigate fps loss.