// Name : Persistent containers inventory disturbed // Purpose : Called when a player messes with the inventory of a persistent container // Author : Ingmar Stieger - Heavily altered by: Josh Dalton (Lanthar D'Alton) // Modified : February 25, 2003 // This file is licensed under the terms of the // GNU GENERAL PUBLIC LICENSE (GPL) Version 2 #include "aps_include" // Note: The OnDisturbed event doesn't work reliable with stackable items // so they are not supported in this implementation int GetIsItemStackable(object oItem) { int iType = GetBaseItemType(oItem); if (iType == BASE_ITEM_GEM || iType == BASE_ITEM_POTIONS || iType == BASE_ITEM_HEALERSKIT || iType == BASE_ITEM_THIEVESTOOLS || iType == BASE_ITEM_SCROLL || iType == BASE_ITEM_ARROW || iType == BASE_ITEM_BOLT || iType == BASE_ITEM_BULLET || iType == BASE_ITEM_DART || iType == BASE_ITEM_THROWINGAXE || iType == BASE_ITEM_SHURIKEN || iType == BASE_ITEM_GOLD) return TRUE; else return FALSE; } void main() { object oPC = GetLastDisturbed(); if (!GetIsPC(oPC)) return; object oItem = GetInventoryDisturbItem(); if (!GetIsObjectValid(oItem)) return; SetLocalObject(oItem, "owner", oPC); //so we can return if not saveable. return; }