Add ability to transfer well contents via API
This commit is contained in:
parent
69e3b24cfe
commit
a31b0deea1
1 changed files with 63 additions and 2 deletions
|
@ -12,7 +12,7 @@ float g_fEmpty = -1.142;
|
||||||
float g_fFull = -0.202;
|
float g_fFull = -0.202;
|
||||||
integer g_iRequestTime = 0;
|
integer g_iRequestTime = 0;
|
||||||
string WATER_WELL_NAME = "WoodStoneWaterWell";
|
string WATER_WELL_NAME = "WoodStoneWaterWell";
|
||||||
string VERSION = "1.0.1";
|
string VERSION = "1.0.2";
|
||||||
integer g_iWaterPrim;
|
integer g_iWaterPrim;
|
||||||
integer g_iRoofPrim;
|
integer g_iRoofPrim;
|
||||||
integer g_iDestroyed = 0;
|
integer g_iDestroyed = 0;
|
||||||
|
@ -55,6 +55,48 @@ integer g_iWaitDelivery = 0;
|
||||||
string g_sCallbackURL;
|
string g_sCallbackURL;
|
||||||
key g_kCallbackURLRequest;
|
key g_kCallbackURLRequest;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
particles(key kTarget) {
|
||||||
|
if(kTarget == NULL_KEY) llParticleSystem([]);
|
||||||
|
else {
|
||||||
|
llParticleSystem(
|
||||||
|
[
|
||||||
|
// texture parameters:
|
||||||
|
PSYS_SRC_TEXTURE , "",
|
||||||
|
PSYS_PART_START_SCALE , <0.67,0.58,0.00>, PSYS_PART_END_SCALE , <0.09,0.09,0.00>,
|
||||||
|
PSYS_PART_START_COLOR , WATER_PARTICLE, PSYS_PART_END_COLOR , <0.16,0.71,0.83>,
|
||||||
|
PSYS_PART_START_ALPHA , (float)1.00, PSYS_PART_END_ALPHA , (float)1.00,
|
||||||
|
// production parameters:
|
||||||
|
PSYS_SRC_BURST_PART_COUNT , 16,
|
||||||
|
PSYS_SRC_BURST_RATE , (float)0.10,
|
||||||
|
PSYS_PART_MAX_AGE , (float)6.54,
|
||||||
|
PSYS_SRC_MAX_AGE , (float)0.18,
|
||||||
|
// placement parameters:
|
||||||
|
PSYS_SRC_PATTERN , 2,
|
||||||
|
PSYS_SRC_BURST_SPEED_MIN , (float)1.00, PSYS_SRC_BURST_SPEED_MAX , (float)1.00,
|
||||||
|
PSYS_SRC_BURST_RADIUS , (float)0.00,
|
||||||
|
// placement parameters (for angles only):
|
||||||
|
PSYS_SRC_ANGLE_BEGIN , (float)0.00,
|
||||||
|
PSYS_SRC_ANGLE_END , (float)0.00,
|
||||||
|
PSYS_SRC_OMEGA , <0.00,0.00,0.00>,
|
||||||
|
// after-effects & influences:
|
||||||
|
PSYS_SRC_ACCEL , <0.00,0.00,0.00>,
|
||||||
|
PSYS_SRC_TARGET_KEY , kTarget,
|
||||||
|
PSYS_PART_FLAGS , ( 0 // texture & influence options:
|
||||||
|
// | PSYS_PART_INTERP_COLOR_MASK
|
||||||
|
| PSYS_PART_INTERP_SCALE_MASK
|
||||||
|
// | PSYS_PART_BOUNCE_MASK
|
||||||
|
// | PSYS_PART_WIND_MASK
|
||||||
|
// | PSYS_PART_FOLLOW_SRC_MASK
|
||||||
|
| PSYS_PART_FOLLOW_VELOCITY_MASK
|
||||||
|
| PSYS_PART_TARGET_POS_MASK
|
||||||
|
// | PSYS_PART_TARGET_LINEAR_MASK
|
||||||
|
| PSYS_PART_EMISSIVE_MASK
|
||||||
|
)] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default
|
default
|
||||||
{
|
{
|
||||||
state_entry()
|
state_entry()
|
||||||
|
@ -122,6 +164,25 @@ default
|
||||||
setText();
|
setText();
|
||||||
updateLevel();
|
updateLevel();
|
||||||
}
|
}
|
||||||
|
} else if(llJsonGetValue(sJson, ["cmd"]) == "query" && llJsonGetValue(sJson, ["product"]) == "water well") {
|
||||||
|
llRegionSayTo(i,c,xtea_encrypt_string(llList2Json(JSON_OBJECT, ["cmd", "reply", "ingredient", "Water", "id", llGetKey()])));
|
||||||
|
|
||||||
|
} else if(llJsonGetValue(sJson, ["cmd"]) == "use" && llJsonGetValue(sJson, ["id"]) == llGetKey()) {
|
||||||
|
particles(i);
|
||||||
|
if(g_iTotalWater == 0)
|
||||||
|
{
|
||||||
|
llRegionSayTo(i,global_ingredients,llList2Json(JSON_OBJECT, ["cmd", "use_reply", "id", NULL_KEY, "amount", 0]));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_iTotalWater--;
|
||||||
|
updateLevel();
|
||||||
|
setText();
|
||||||
|
|
||||||
|
llSetTimerEvent(1);
|
||||||
|
|
||||||
|
|
||||||
|
llRegionSayTo(i,global_ingredients,llList2Json(JSON_OBJECT, ["cmd", "use_reply", "id", llGetKey(), "amount", 4, "ingredient", "Water"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +232,7 @@ default
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(llGetUnixTime() > (g_iLastFillTime + 30)) {
|
if(llGetUnixTime() > (g_iLastFillTime + 60)) {
|
||||||
g_iLastFillTime = llGetUnixTime();
|
g_iLastFillTime = llGetUnixTime();
|
||||||
g_iTotalWater ++;
|
g_iTotalWater ++;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue