Add a special effect for the workbench crafting system
This commit is contained in:
parent
623966b907
commit
69e3b24cfe
1 changed files with 36 additions and 1 deletions
|
@ -7,6 +7,9 @@ key g_kFollow = NULL_KEY;
|
||||||
integer g_iProdLink=3;
|
integer g_iProdLink=3;
|
||||||
integer g_iDies=FALSE;
|
integer g_iDies=FALSE;
|
||||||
vector g_vScale;
|
vector g_vScale;
|
||||||
|
integer g_iPreCraft;
|
||||||
|
rotation g_rRot;
|
||||||
|
vector g_vPreCraft;
|
||||||
|
|
||||||
setText() {
|
setText() {
|
||||||
llSetText(g_sIngredientType + ": " + (string)g_iQuantity, <1,1,1>, 1);
|
llSetText(g_sIngredientType + ": " + (string)g_iQuantity, <1,1,1>, 1);
|
||||||
|
@ -149,7 +152,7 @@ default
|
||||||
if(c == global_ingredients) {
|
if(c == global_ingredients) {
|
||||||
if(g_kID == NULL_KEY) return;
|
if(g_kID == NULL_KEY) return;
|
||||||
else {
|
else {
|
||||||
if(llJsonGetValue(params, ["cmd"]) == "query") {
|
if(llJsonGetValue(params, ["cmd"]) == "query" && !g_iPreCraft) {
|
||||||
llRegionSayTo(i,c,xtea_encrypt_string(llList2Json(JSON_OBJECT, ["cmd", "reply", "ingredient", g_sIngredientType, "id", g_kID])));
|
llRegionSayTo(i,c,xtea_encrypt_string(llList2Json(JSON_OBJECT, ["cmd", "reply", "ingredient", g_sIngredientType, "id", g_kID])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +205,39 @@ default
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(g_iDies) llDie();
|
if(g_iDies) llDie();
|
||||||
|
else {
|
||||||
|
if(!g_iPreCraft)return;
|
||||||
|
llTargetOmega(ZERO_VECTOR, 0,0);
|
||||||
|
llSetRot(g_rRot);
|
||||||
|
llSetPos(g_vPreCraft);
|
||||||
|
g_iPreCraft=0;
|
||||||
|
llScaleByFactor(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else if(llJsonGetValue(params, ["cmd"]) == "precraft") {
|
||||||
|
if(g_iPreCraft)return;
|
||||||
|
stopFollowing(g_vScale.z-0.2);
|
||||||
|
g_vRot = llGetRot();
|
||||||
|
g_iPreCraft=1;
|
||||||
|
|
||||||
|
llScaleByFactor(0.025);
|
||||||
|
llTargetOmega(<0,0.1,1>, 0.25, 1);
|
||||||
|
g_vPreCraft = llGetPos();
|
||||||
|
|
||||||
|
llSetPos((vector)llJsonGetValue(params, ["pos"]) + <0,0,0.05>);
|
||||||
|
|
||||||
|
particles(i);
|
||||||
|
} else if(llJsonGetValue(params, ["cmd"]) == "abortcraft") {
|
||||||
|
if(!g_iPreCraft)return;
|
||||||
|
g_iPreCraft = 0;
|
||||||
|
|
||||||
|
llScaleByFactor(1);
|
||||||
|
llTargetOmega(<0,0,0>, 0,0);
|
||||||
|
llSetRot(g_vRot);
|
||||||
|
|
||||||
|
llSetPos(g_vPreCraft);
|
||||||
|
|
||||||
|
particles(llGetKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue