Dynamic Area Lighting Change script
This script allows you to have the lighting for an entire area change
on-the-fly, even if you're in the area. It makes for some great quest
completion effects. I can also imagine that having the entire dungeon go
pitch black when the player steps on a trigger could be interesting as well
The comments cover the use of it, and little has to be changed to adapt it
for your own module. If you find any bugs, e-mail me and complain
NWScript:
void main()
{
vector vTile = Vector(0.0, 0.0, 0.0);
location lTile = Location(GetObjectByTag("AreaTag", 0), vTile, 0.0);
float fx = 0.0;
float fy = 0.0;
while ((fx < 8.0) && (fy < 8.0))
{
vTile = Vector(fx, fy, 0.0);
lTile = Location(GetObjectByTag("AreaTag", 0), vTile, 0.0);
SetTileMainLightColor (lTile, TILE_MAIN_LIGHT_COLOR_WHITE, TILE_MAIN_LIGHT_COLOR_WHITE);
SetTileSourceLightColor (lTile, TILE_MAIN_LIGHT_COLOR_WHITE, TILE_MAIN_LIGHT_COLOR_WHITE);
fx = fx + 1.0;
if(fx >= 8.0)
{
fy = fy + 1.0;
fx = 0.0;
}
}
RecomputeStaticLighting(GetObjectByTag("AreaTag"));
}
_________________
Black Knight: Have at you!
Arthur: You are indeed brave, sir knight, but the fight is mine.
B. Knight: Oh, had enough eh?
Arthur: Look, you stupid bastard. You've got no arms left!
B. Knight: Yes I have.
Arthur: Look!
B. Knight: Just a flesh wound!
|