Working on a few scripts

I’m working on a few simpler scripts for my module and figured I’d drop my ideas here for some always appreciated help or suggestions.

First: Looking to make a script that Unlocks a Door when 3 Objects in a single area with the tag of “target” no longer exist.

Second: Identify All. I’d like a script that will on conversation choice, will identify all unidentified items in the PC inventory, and charge 150gp per item unidentified.

Third: I’m using a persistent banking chest system which has a really big issue if you put a container bag inside of the chest. It seems to dump the entire persistent chest database for every player on the server. Not ideal for a pw server. The system does have a warning message as it’s safeguard, but it doesn’t stop someone from seeing what happens if they leave a bag in the chest for too long. A store is able to prevent certain types of items from being transferred, is there any way I can have the chest prevent the item transfer for maybe certain tags for the bags/containers?

1: They have all the same Tag? Just
if (!GetIsObjectValid (GetObjectByTag ("target")) OpenTheDoor();
As long as one of the 30 Objects exists, the script would do nothing. I would select a more unique tag. This could be placed in the onDeath- event of the relevant placeables


void main ()
  object oPC = GetPCSpeaker();
  object oItem = GetFirstItemInInventory(oPC);

  while (GetIsObjectValid (oItem))
      if (!GetIdentified(oItem))
           int g = GetGold(oPC);
           if (g<150) return;
           SetIdentified (oItem, TRUE);
           TakeGoldFromCreature (oPC, 150);
      oItem = GetNextItemInInventory(oPC);

3: Just a snipped in the “onDisturbed” - event

    if (GetBaseItemType(oItem) == BASE_ITEM_LARGEBOX)
      SendMessageToPC(oPC, "Do not place Containers within.");
      ActionGiveItem (oItem, oPC);

Hint: The entire scripting above is not tested. There might be typos.


onDisturbed! I was stuck trying to figure out where the script should go. Perfect.

Thanks so much I’ve give these a try today.