void main()
{
  object oPC = GetEnteringObject();
  object oItem;
  object oPCLootStorage;
  string sTag;

  if (GetIsPC(oPC) == TRUE)
  {
    // Assign the PC's loot to one of 7 chests
    // on the Water Dragon
    int nPCnum = GetLocalInt(GetArea(oPC),"pcnum");
    nPCnum++;
    if (nPCnum > 6)
      nPCnum = 0;
    SetLocalInt(GetArea(oPC),"pcnum",nPCnum);
    if (nPCnum >= 0 && nPCnum <= 6)
      sTag = "slavers_vault" + IntToString(nPCnum);
    else
      sTag = "slavers_vault0";
    oPCLootStorage = GetObjectByTag(sTag);

    // Take all the PC's items and store them in the vault
    oItem = GetItemInSlot(INVENTORY_SLOT_ARMS,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_ARROWS,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_BELT,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_BOLTS,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_BULLETS,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_HEAD,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_NECK,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    oItem = GetFirstItemInInventory(oPC);
    AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    while (GetIsObjectValid(oItem) == TRUE)
    {
      oItem = GetNextItemInInventory(oPC);
      AssignCommand(oPCLootStorage,ActionTakeItem(oItem,oPC));
    }
    // Move the PC into the Slave Lords' Dungeon
    object oDest = GetWaypointByTag("WP_Dungeon");
    AssignCommand(oPC,DelayCommand(24.0f,ActionJumpToObject(oDest,FALSE)));
  }
}
