1) Extract the desired AmbientLight into the map folder (as a new object, name it).
2) Enter the path to it in map.xdb
to
<item href="/path to the file (in your map)/file name.xdb#xpointer(/AmbientLight)">
3) Then, write a script, something like this:
function function()
some magic
...
SetAmbientLight(0, "File Name in Map (here only the file name without the format and everything after the . example: LightHeaven.xdb, in the script it will be: "LightHeaven")", true, 10);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "region", "function");The same applies to the underground, but you need to specify the path in UndergroundAmbientLights.