Snow

Written by: Headmaster
string particle_texture = "";
list snow;
integer switch=TRUE;

default
{
    state_entry()
    {
        snow = [ 
            PSYS_PART_FLAGS, PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_FOLLOW_SRC_MASK | PSYS_PART_EMISSIVE_MASK, 
            PSYS_PART_START_COLOR, <1.0,1.0,1.0>, 
            PSYS_PART_END_COLOR, <1.0,1.0,1.0>,
            PSYS_PART_START_ALPHA, 0.7, 
            PSYS_PART_END_ALPHA, 0.5, 
            PSYS_PART_START_SCALE, <0.05,0.05,0.0>,
            PSYS_PART_END_SCALE, <0.1,0.1,0.0>, 
            PSYS_PART_MAX_AGE, 50.0, 
            PSYS_SRC_PATTERN, 
            PSYS_SRC_PATTERN_ANGLE_CONE, 
            PSYS_SRC_INNERANGLE, 0.0, 
            PSYS_SRC_OUTERANGLE, PI,            
            PSYS_SRC_ACCEL,<0,0,-0.05>,
            PSYS_SRC_OMEGA,ZERO_VECTOR, 
            PSYS_SRC_BURST_RATE, 0.1, 
            PSYS_SRC_BURST_PART_COUNT, 100, 
            PSYS_SRC_BURST_RADIUS, PI,
            PSYS_SRC_BURST_SPEED_MIN, 0.25, 
            PSYS_SRC_BURST_SPEED_MAX, 0.5, 
            PSYS_SRC_MAX_AGE, 0.0
            ];
        llListen(0, "", llGetOwner(), "/snow on");
        llListen(0, "", llGetOwner(), "/snow off");

    }

    listen(integer chan, string name, key id, string msg)
    {
        if (msg == "/snow on")
        {
            llSay(0, "Snow on");
            llParticleSystem(snow);
            switch=FALSE;
        }
        if (msg == "/snow off")
        {
            llSay(0, "Snow off");
            llParticleSystem([]);
            switch=TRUE;
        }
    }
}