37 lines
676 B
Plaintext
37 lines
676 B
Plaintext
object oItem;
|
|
|
|
|
|
//This Script is executed by the cleantavernscript
|
|
void main()
|
|
{
|
|
|
|
object oPC = GetExitingObject();
|
|
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
if (GetItemPossessedBy(oPC, "thiskey")!= OBJECT_INVALID)
|
|
{
|
|
oItem = GetFirstItemInInventory(oPC);
|
|
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetTag(oItem)=="barrel") DestroyObject(oItem);
|
|
|
|
oItem = GetNextItemInInventory(oPC);
|
|
}
|
|
|
|
}
|
|
else if (GetItemPossessedBy(oPC, "barrel2")!= OBJECT_INVALID)
|
|
{
|
|
oItem = GetFirstItemInInventory(oPC);
|
|
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetTag(oItem)=="barrel2") DestroyObject(oItem);
|
|
|
|
oItem = GetNextItemInInventory(oPC);
|
|
}
|
|
|
|
}
|
|
}
|