//inspired by Xah Lee (http://xahlee.org/sl/)
default
{
state_entry() {
llListen(0, "", NULL_KEY, "");
}
listen(integer channel, string name, key id, string message) {
if (message == "off") {
llParticleSystem([]);
}
else {
if (message == "on") {
integer bounce = 0;
integer glow = 1;
integer interpColor = 1;
integer interpSize = 1;
integer followSource = 0;
integer followVel = 1;
integer wind = 1;
integer pattern = PSYS_SRC_PATTERN_EXPLODE;
key target = "";
float age = 9.0;
float maxSpeed = 3.0;
float minSpeed = 3.0;
string texture = "168e6813-096e-07ea-97ae-fd416826f627";
float startAlpha = 0.9;
float endAlpha = 0.0;
float SC1 = llFrand(1.0); //makes the color random
float SC2 = llFrand(1.0); //you can comment out this section
float SC3 = llFrand(1.0); //and set the start color to your choice
vector startColor = <SC1,SC2,SC3>; //change this to set a particular start color
vector endColor = <0.0,0.0,1.0>;
vector startSize = <0.3,0.3,0>;
vector endSize = <0.1,0.1,0>;
vector push = <0.0,0.0,-0.8>;
float life = 0;
integer count = 100;
float rate = 3.5; //sets the rate of bursts
float radius = 0.1;
float outerAngle = 1;
float innerAngle = 0.9;
vector omega = <0,0,1>;
integer flags = 0;
if (target == "owner") target = llGetOwner();
if (target == "self") target = llGetKey();
if (glow == 1) flags = flags | PSYS_PART_EMISSIVE_MASK;
if (bounce == 1) flags = flags | PSYS_PART_BOUNCE_MASK;
if (interpColor == 1) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
if (interpSize == 1) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
if (wind == 1) flags = flags | PSYS_PART_WIND_MASK;
if (followSource == 1) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
if (followVel == 1) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
llParticleSystem([ PSYS_PART_MAX_AGE,7,
PSYS_PART_FLAGS,flags,
PSYS_PART_START_COLOR, startColor,
PSYS_PART_END_COLOR, endColor,
PSYS_PART_START_SCALE,startSize,
PSYS_PART_END_SCALE,endSize,
PSYS_SRC_PATTERN, pattern,
PSYS_SRC_BURST_RATE,(float)rate,
PSYS_SRC_ACCEL, push,
PSYS_SRC_BURST_PART_COUNT,count,
PSYS_SRC_BURST_RADIUS,(float)radius,
PSYS_SRC_BURST_SPEED_MIN,(float)minSpeed,
PSYS_SRC_BURST_SPEED_MAX,(float)maxSpeed,
PSYS_SRC_TARGET_KEY,target,
PSYS_SRC_INNERANGLE,(float)innerAngle,
PSYS_SRC_OUTERANGLE,(float)outerAngle,
PSYS_SRC_OMEGA, omega,
PSYS_SRC_MAX_AGE, (float)life,
PSYS_SRC_TEXTURE, texture,
PSYS_PART_START_ALPHA, (float)startAlpha,
PSYS_PART_END_ALPHA, (float)endAlpha]);
}
}
}
}