Initial upload

Initial upload.
This commit is contained in:
Jaysyn904
2023-11-14 12:09:02 -05:00
parent 657466db0c
commit 08e84b4e71
1674 changed files with 1227255 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
//=============================================
//=============================================
//Automatic Item Decay
//Written by Gary Blauvelt, Ithalyan of
// Grim's Tavern
//=============================================
//=============================================
void main()
{
//Cleans finds objects that are flagged for decay and counts down the timer
//that should have been placed on them.
int nDecay;
object oArea = GetArea(OBJECT_SELF);
object oItem = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oItem))
{
if(GetObjectType(oItem)==OBJECT_TYPE_ITEM || (GetObjectType(oItem)==64 && GetTag(oItem) == "Body Bag"))
{
if(GetLocalInt(oItem,"DecayFlag")==0)
{
//Set Plot Flag Decay here
//AssignCommand(oItem,ActionSpeakString("Decay Flag Set"));
SetLocalInt(oItem,"DecayFlag",1); //Set the flags that aren't set
SetLocalInt(oItem,"DecayTime",50);
}
else //Count Down
{
nDecay = GetLocalInt(oItem,"DecayTime");
nDecay--;
if(nDecay < 1) //DestroyObject the item
{
if (GetObjectType(oItem)==64)
{
object oInven = GetFirstItemInInventory(oItem);
while(GetIsObjectValid(oInven))
{
DestroyObject(oInven,0.0);
oInven = GetNextItemInInventory(oItem);
}
}
else
{
DestroyObject(oItem,0.0);
}
}
else
{
//AssignCommand(oItem,ActionSpeakString("Decay Going"));
SetLocalInt(oItem,"DecayTime",nDecay);
}
}
}
oItem = GetNextObjectInArea(oArea);
}
}