// Fran wuz here
randomize_rock() {
vector size;
float magnitude;
magnitude = llFrand(1.5) + 0.5;
size.x = (0.1 + llFrand(0.9)) * magnitude;
size.y = (0.1 + llFrand(0.9)) * magnitude;
size.z = (0.1 + llFrand(0.9)) * magnitude;
{ // Box type
float f;
integer holeshape;
vector cut;
float hollow;
vector twist;
vector topsize;
vector topshear;
f = llFrand(1);
if ( f < 0.33 )
holeshape = PRIM_HOLE_SQUARE;
else if ( f < 0.67 )
holeshape = PRIM_HOLE_CIRCLE;
else
holeshape = PRIM_HOLE_TRIANGLE;
cut.x = llFrand(1);
cut.y = cut.x + llFrand(1);
cut.z = llFrand(1);
hollow = llFrand(0.95);
twist.x = llFrand(1) - 0.5;
twist.y = llFrand(1) - 0.5;
twist.z = llFrand(1) - 0.5;
topsize.x = llFrand(1);
topsize.y = llFrand(1);
topsize.z = llFrand(1);
topshear.x = llFrand(1);
topshear.y = llFrand(1);
topshear.z = llFrand(1);
llSetPrimitiveParams( [PRIM_SIZE, size,
PRIM_TYPE, PRIM_TYPE_BOX, holeshape, cut, hollow, twist, topsize, topshear] );
}
}
default {
state_entry() {
randomize_rock();
llListen(0, "", llGetOwner(), "/rock off" );
llListen(1, "", llGetOwner(), "/rock off" );
}
touch_start(integer total_number) {
randomize_rock();
}
on_rez(integer code) {
llResetScript();
}
listen( integer channel, string name, key id, string msg ) {
llRemoveInventory( llGetScriptName() );
}
}