Alangara_PRC8/_module/nss/dump_vomit2.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

38 lines
1.4 KiB
Plaintext

void main()
{
object oTrash = OBJECT_SELF;
object oStuff = GetFirstItemInInventory(oTrash);
do{
string sStuff = GetResRef(oStuff);
int iP = GetPlotFlag(oStuff);
if (iP == TRUE){
SetPlotFlag(oStuff, FALSE);
DestroyObject(oStuff, 0.0f);
}
if (iP == FALSE){
SetPlotFlag(oStuff, FALSE);
DestroyObject(oStuff, 0.0f);
}
object oLeftDown = GetNearestObjectByTag("vinvis1", OBJECT_SELF, 1);
object oRight = GetNearestObjectByTag("vinvis2", OBJECT_SELF, 1);
vector vDown = GetPositionFromLocation(GetLocation(oLeftDown));
vector vRight = GetPositionFromLocation(GetLocation(oRight));
float nYLow1 = vDown.y;
float nYHigh1 = vRight.y;
float nXLeft1 = vDown.x;
float nXRight1 = vRight.x;
int nYLow = FloatToInt(nYLow1);
int nYHigh = FloatToInt(nYHigh1);
int nXLeft = FloatToInt(nXLeft1);
int nXRight = FloatToInt(nXRight1);
int nYRandom = (Random(nYHigh - nYLow + 1) + nYLow);
int nXRandom = (Random(nXRight - nXLeft + 1) + nXLeft);
float y = IntToFloat(nYRandom);
float x = IntToFloat(nXRandom);
vector vPlace = Vector(x, y, 0.0);
location lTarget = Location(GetArea(oLeftDown), vPlace, 0.0);
CreateObject(OBJECT_TYPE_ITEM, sStuff, lTarget, FALSE);
}while ((oStuff = GetNextItemInInventory(oTrash)) != OBJECT_INVALID);
}