int GetNextShieldIndex( object oShield)
{
  int iIndex = GetItemAppearance( oShield, ITEM_APPR_TYPE_SIMPLE_MODEL, 0);
  iIndex++;
  int iItemtype = GetBaseItemType( oShield);

  //shields
  if( iItemtype == BASE_ITEM_SMALLSHIELD)
  {
    if( iIndex == 14)
      iIndex = 21;
    else if( iIndex == 24)
      iIndex = 31;
    else if( iIndex == 34)
      iIndex = 41;
    else if( iIndex == 44)
      iIndex = 11;

  }
  else if( iItemtype == BASE_ITEM_LARGESHIELD)
  {
    if( iIndex == 14)
      iIndex = 21;
    else if( iIndex == 24)
      iIndex = 31;
    else if( iIndex == 34)
      iIndex = 41;
    else if( iIndex == 44)
      iIndex = 51; //1.69 Shields
    else if( iIndex == 57)
      iIndex = 61;
    else if( iIndex == 76)
      iIndex = 11;

  }
  else if( iItemtype == BASE_ITEM_TOWERSHIELD)
  {
    if( iIndex == 14)
      iIndex = 21;
    else if( iIndex == 24)
      iIndex = 31;
    else if( iIndex == 34)
      iIndex = 41;
    else if( iIndex == 44)
      iIndex = 51; //1.69 Shields
    else if( iIndex == 55)
      iIndex = 11;

  }
  return iIndex;
}

void main()
{
  object oPlayer = GetPCSpeaker();
  object oShield = GetItemInSlot( INVENTORY_SLOT_LEFTHAND, oPlayer);

  int iIndex = GetNextShieldIndex( oShield);

  if( GetIsDM( oPlayer))
    SendMessageToPC( oPlayer, "The index is: " + IntToString( iIndex));

  object oNewShield = CopyItemAndModify(oShield, ITEM_APPR_TYPE_SIMPLE_MODEL, 0, iIndex, TRUE);

  if( GetIsObjectValid( oNewShield))
  {
    AssignCommand( oPlayer, ActionEquipItem( oNewShield, INVENTORY_SLOT_LEFTHAND));
    DestroyObject( oShield);
  }
  else
    DestroyObject( oNewShield);
}