Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
44
_module/nss/rd_cleararea.nss
Normal file
44
_module/nss/rd_cleararea.nss
Normal file
@@ -0,0 +1,44 @@
|
||||
void ClearArea(object oArea)
|
||||
{
|
||||
int iFlag;
|
||||
int iType;
|
||||
int iObjectFlag;
|
||||
int iCount;
|
||||
int iDoOnce;
|
||||
string sTag;
|
||||
location oLoc;
|
||||
object oObject;
|
||||
|
||||
iFlag = 0;
|
||||
iCount = 0;
|
||||
oObject = GetFirstObjectInArea(oArea);
|
||||
|
||||
while (iFlag == 0)
|
||||
{
|
||||
iCount++;
|
||||
iType = GetObjectType(oObject);
|
||||
if (iType == OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
//check if enemy, hopefully should keep familiars/summoned/henchmen from being destroyed
|
||||
if (GetIsEnemy(GetFirstPC(),oObject))
|
||||
{
|
||||
DestroyObject(oObject);
|
||||
}
|
||||
}
|
||||
//allow respawning of loot in containers
|
||||
iDoOnce = GetLocalInt(oObject,"NW_DO_ONCE");
|
||||
if (iDoOnce != 0)
|
||||
SetLocalInt(oObject,"NW_DO_ONCE",0);
|
||||
|
||||
oObject = GetNextObjectInArea(oArea);
|
||||
if (oObject==OBJECT_INVALID)
|
||||
{
|
||||
iFlag = 1;
|
||||
}
|
||||
if (iCount >1000)
|
||||
{
|
||||
iFlag=1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user