if ( getDistance player < 100 ) if ( globalFlag != 1 ) set globalFlag to 1 endifelse if ( globalFlag == 1 ) set globalFlag to 0 endifendifApplying a script like this to those walls of ice would set a global variable (globalFlag), then you could run either a startscript or a local script applied to an object in each cell you want this to work for. Something like this.
if ( globalFlag != 1 ) returnendifif ( getInterior == 1 ) if ( player->getPosition Z > getWaterLevel ) return endifelse if ( player->getPosition Z > 0 ) ;water level, outside... not sure if getWaterLevel works outside return endifendifplayer->modCurrentHealth -5 ;or whateverYou can even take into account a player's frost resistance. Here's a script I wrote two years ago that makes fire resistance work for lava damage:
begin lavashort DamageRatefloat timerif ( menumode == 1 ) returnendifif ( CellChanged == 0 ) if ( GetSoundPlaying "lava layer" == 0 ) PlayLoopSound3DVP "lava layer", 1.0, 1.0 endifendifif ( player->GetResistFire > 99 ) set DamageRate to 0elseif ( player->GetResistFire < 100 ) if ( PCRace == 3 ) if ( player->GetResistFire < 80 ) ;Dunmer damage balances out with normal when they get 80% or more Set DamageRate to ( ( -100 + player->GetResistFire - 40 ) / 4 ) else Set DamageRate to ( ( -100 + player->GetResistFire ) / 4 ) endif else Set DamageRate to ( ( -100 + player->GetResistFire ) / 4 ) endifendifset timer to ( timer + GetSecondsPassed )if ( GetStandingPC == 1 ) if ( timer >= 1 ) ;hurt/heal player once every second not frame! player->ModCurrentHealth DamageRate ;X pts of damage a sec (By Default most races get 25, Dunmers get 16.25) player->ModCurrentHealth 20 ;heal PC so no double damage is inflicted set timer to 0 endifendifHurtStandingActor 20 ;for NPC's/creatures (they get 20 pts per second by default)end lava
; interior water check based on Zappara's temperature mod script ; player must be moving / not levitating to detect if ( GetInterior ) set i1 to 0 if ( ab01wlNoInterior != 3 ) ; 3 = splish splashing only, not used if ( GetWindSpeed >= 0.01 ) ; ATTENTION 2 digits only! if ( lastInterior == 0 ) ; only if not just entered set i1 to 5 endif endif endif set lastInterior to GetInterior if ( i1 == 0 ) if ( player->GetSoundPlaying "FootWaterRight" ) set i1 to 1 elseif ( player->GetSoundPlaying "FootWaterLeft" ) set i1 to 2 ;elseif ( player->GetSoundPlaying "Swim Right" ) ;set i1 to 3 ;elseif ( player->GetSoundPlaying "Swim Left" ) ;set i1 to 4 endif endif if ( i1 == 0 ) return endif ; the script does its things starting here.